|
- <?php
-
-
-
- use domain\Feature\Feature\Feature;
- use domain\Feature\Feature\FeatureModule;
- use domain\Payment\PaymentModule;
- use yii\grid\GridView;
-
- $paymentManager = PaymentModule::getInstance();
- $featureChecker = FeatureModule::getInstance()->getChecker();
- $producer = $this->context->getProducerCurrent();
- $this->setTitle('Cagnotte <div id="credit-user">' . number_format($creditUser, 2, ',', ' ') . ' €</div>');
- $this->setPageTitle('Cagnotte');
-
- if ($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT) && $this->context->getProducerCurrent()->online_payment) {
- $this->addButton(
- [
- 'label' => '<i class="bi bi-credit-card"></i> Créditer ma cagnotte',
- 'url' => 'credit/add',
- 'class' => 'btn btn-primary'
- ]
- );
- }
-
- ?>
-
- <div class="table-responsive">
- <?= GridView::widget([
- 'summary' => '',
- 'dataProvider' => $dataProvider,
- 'columns' => [
- [
- 'attribute' => 'date',
- 'value' => function ($model) use ($paymentManager) {
- return $paymentManager->getDate($model, true);
- }
- ],
-
-
- [
- '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' => 'Montant',
- 'format' => 'raw',
- 'value' => function ($model) use ($paymentManager) {
- if ($paymentManager->isTypeDebit($model)) {
- return '- ' . $paymentManager->getAmount($model, true);
- }
- elseif($paymentManager->isTypeCredit($model)) {
- return '<span class="payment-positive">+ ' . $paymentManager->getAmount($model, true).'</span>';
- }
- return '';
- }
- ],
- ],
- ]);
- ?>
- </div>
|