Sfoglia il codice sorgente

[Backend] Affichage du bon crédit utilisateur dans la modal de paiement des commandes

refactoring
parent
commit
b62e085566
2 ha cambiato i file con 10 aggiunte e 3 eliminazioni
  1. +8
    -1
      backend/controllers/DistributionController.php
  2. +2
    -2
      backend/views/distribution/index.php

+ 8
- 1
backend/controllers/DistributionController.php Vedi File

@@ -167,16 +167,23 @@ class DistributionController extends BackendController
] ;
}
$arrayCreditUser = [] ;
if(isset($order->user) && isset($order->user->userProducer)) {
$arrayCreditUser['credit'] = $order->user->userProducer[0]->credit ;
}
$order = array_merge($order->getAttributes(), [
'amount' => $order->getAmount(Order::AMOUNT_TOTAL),
'amount_paid' => $order->getAmount(Order::AMOUNT_PAID),
'amount_remaining' => $order->getAmount(Order::AMOUNT_REMAINING),
'amount_surplus' => $order->getAmount(Order::AMOUNT_SURPLUS),
'user' => (isset($order->user)) ? $order->user->getAttributes() : null,
'user' => (isset($order->user)) ? array_merge($order->user->getAttributes(), $arrayCreditUser) : null,
'pointSale' => ['id' => $order->pointSale->id, 'name' => $order->pointSale->name],
'productOrder' => $productOrderArray,
'creditHistory' => $creditHistoryArray
]) ;
}
}

+ 2
- 2
backend/views/distribution/index.php Vedi File

@@ -294,10 +294,10 @@ $this->setPageTitle('Distributions') ;
</div>
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-user"></i></span>
<span :class="'info-box-icon ' +((order.user.credit > 0) ? 'bg-green' : 'bg-red')"><i class="fa fa-user"></i></span>
<div class="info-box-content">
<span class="info-box-text">Crédit utilisateur</span>
<span class="info-box-number">24,00 €</span>
<span class="info-box-number">{{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}</span>
</div>
</div>

Loading…
Annulla
Salva