|
- <?php
-
-
-
- use common\logic\User\CreditHistory\Wrapper\CreditHistoryManager;
- use yii\grid\GridView;
-
- $creditHistoryManager = CreditHistoryManager::getInstance();
- $producer = $this->context->getProducerCurrent();
- $this->setTitle('Crédit : <span id="credit-user">' . number_format($creditUser, 2) . ' €</span>');
- $this->setPageTitle('Crédit');
-
- if ($this->context->getProducerCurrent()->online_payment) {
- $this->addButton(
- [
- 'label' => '<span class="glyphicon glyphicon-credit-card"></span> Créditer mon compte',
- 'url' => 'credit/add',
- 'class' => 'btn btn-primary'
- ]
- );
- }
-
- ?>
-
- <?= GridView::widget([
- 'dataProvider' => $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 '';
- }
- ],
- ],
- ]);
- ?>
|