context->getProducerCurrent(); $this->setTitle('Crédit : ' . number_format($creditUser, 2) . ' €'); $this->setPageTitle('Crédit'); if ($this->context->getProducerCurrent()->online_payment) { $this->addButton( [ 'label' => ' Créditer mon compte', 'url' => 'credit/add', 'class' => 'btn btn-primary' ] ); } ?> $dataProvider, 'columns' => [ [ 'attribute' => 'date', 'value' => function ($model) use ($creditHistoryManager) { return $creditHistoryManager->getDate($model, true); } ], [ 'attribute' => 'id_user_action', 'value' => function ($model) use ($creditHistoryManager) { return $creditHistoryManager->getStrUserAction($model); } ], [ 'label' => 'Type', 'format' => 'raw', 'value' => function ($model) use ($creditHistoryManager) { return $creditHistoryManager->getStrWording($model); } ], [ 'attribute' => 'mean_payment', 'value' => function ($model) use ($creditHistoryManager) { return $creditHistoryManager->getStrMeanPayment($model); } ], [ 'label' => '- Débit', 'format' => 'raw', 'value' => function ($model) use ($creditHistoryManager) { if ($creditHistoryManager->isTypeDebit($model)) { return '- ' . $creditHistoryManager->getAmount($model, true); } return ''; } ], [ 'label' => '+ Crédit', 'format' => 'raw', 'value' => function ($model) use ($creditHistoryManager) { if ($creditHistoryManager->isTypeCredit($model)) { return '+ ' . $creditHistoryManager->getAmount($model, true); } return ''; } ], ], ]); ?>