getPaymentModule(); $producerModule = $this->getProducerModule(); $userModule = $this->getUserModule(); $userModule = UserModule::getInstance(); $username = Html::encode($userModule->getSolver()->getUsername($user)); $this->setTitle($username.' (#'.$user->id.')') ; $this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; $this->addBreadcrumb(['label' => $username]) ; $this->addBreadcrumb('Crédit') ; ?> render('_menu_navigation', [ 'action' => 'credit', 'user' => $user ]); ?>
findOneProducerById(GlobalParam::getCurrentProducerId()); if(!$producer->credit) { echo '
Attention, la fonctionnalité Crédit est désactivée dans vos paramètres.' . ' Pensez à l\'activer si vous souhaitez qu\'elle soit visible de vos utilisateurs.
' ; } ?>
getCredit($user), 2); ?> €

Crédit obligatoire credit_active ? 'Désactiver' : 'Activer', ['user/state-credit', 'idUser' => $user->id,'state' => !$userProducer->credit_active], ['class' => 'btn btn-default btn-xs']); ?>

Active ou désactive le crédit de l'utilisateur pour les points de vente avec l'option Basée sur l'utilisateur.

credit_active): ?>
Activé
Désactivé

Crédit / débit

field($creditForm, 'type')->dropDownList([ Payment::TYPE_CREDIT => 'Crédit', Payment::TYPE_DEBIT => 'Débit', ]) ?> field($creditForm, 'mean_payment')->dropDownList([ MeanPayment::MONEY => MeanPayment::getStrBy(MeanPayment::MONEY), MeanPayment::CREDIT_CARD => MeanPayment::getStrBy(MeanPayment::CREDIT_CARD), MeanPayment::CHEQUE => MeanPayment::getStrBy(MeanPayment::CHEQUE), MeanPayment::TRANSFER => MeanPayment::getStrBy(MeanPayment::TRANSFER), MeanPayment::OTHER => MeanPayment::getStrBy(MeanPayment::OTHER), ]) ?> field($creditForm, 'amount')->textInput() ?>
field($creditForm, 'comment')->textarea() ?> field($creditForm, 'date_transaction')->textInput([ 'class' => 'datepicker form-control' ]) ?>
field($creditForm, 'send_mail')->checkbox() ?>
'btn btn-primary']) ?>

Historique

$dataProvider, 'columns' => [ [ 'attribute' => 'date', 'value' => function ($model) use ($paymentManager) { return $paymentManager->getDate($model, true); } ], [ 'attribute' => 'id_user_action', 'value' => function ($model) use ($paymentManager) { return $paymentManager->getStrUserAction($model); } ], [ 'label' => 'Type', 'format' => 'raw', 'value' => function ($model) use ($paymentManager) { return $paymentManager->getStrWording($model); } ], [ 'attribute' => 'mean_payment', 'value' => function ($model) use ($paymentManager) { return $paymentManager->getStrMeanPayment($model); } ], [ 'label' => '- Débit', 'format' => 'raw', 'value' => function ($model) use ($paymentManager) { if ($paymentManager->isTypeDebit($model)) { return '- ' . $paymentManager->getAmount($model, true); } return ''; } ], [ 'label' => '+ Crédit', 'format' => 'raw', 'value' => function ($model) use ($paymentManager) { if ($paymentManager->isTypeCredit($model)) { return '+ ' . $paymentManager->getAmount($model, true); } return ''; } ], [ 'label' => 'Commentaire', 'format' => 'raw', 'value' => function ($model) { if($model->comment) { return nl2br($model->comment); } return ''; } ], [ 'label' => 'Transaction', 'format' => 'raw', 'value' => function ($model) { if($model->date_transaction) { return date('d/m/Y', strtotime($model->date_transaction)); } return ''; } ], ], ]); ?>