|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
-
-
-
- use common\components\View;
- use yii\grid\GridView;
- use yii\helpers\Html;
-
-
-
- $userModule = $this->getUserModule();
- $orderModule = $this->getOrderModule();
-
- $this->setTitle('Commandes') ;
- $this->addBreadcrumb('Commandes') ;
-
- ?>
-
- <div class="order-admin-index">
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'columns' => [
- [
- 'label' => 'Statut',
- 'format' => 'raw',
- 'value' => function ($order) use ($orderModule) {
- return $orderModule->getSolver()->getLabelOrderStatus($order, true);
- }
- ],
- [
- 'label' => 'Producteur',
- 'format' => 'raw',
- 'value' => function ($order) use ($orderModule) {
- return Html::encode($order->distribution->producer->name);
- }
- ],
- [
- 'label' => 'Utilisateur',
- 'format' => 'raw',
- 'value' => function ($order) use ($orderModule) {
- return $orderModule->getSolver()->getOrderUsername($order)
- .'<br />'.$orderModule->getSolver()->getLabelOrigin($order, true);
- }
- ],
- [
- 'attribute' => 'distribution.date',
- 'label' => 'Distribution',
- 'value' => function ($order) {
- return date('d/m/Y',strtotime($order->distribution->date));
- }
- ],
- [
- 'label' => 'Point de vente',
- 'format' => 'raw',
- 'value' => function ($order) use ($orderModule) {
- return $orderModule->getSolver()->getPointSaleSummary($order);
- }
- ],
- [
- 'label' => 'Produits',
- 'format' => 'raw',
- 'value' => function ($order) use ($orderModule) {
- return $orderModule->getRepository()->getCartSummary($order);
- }
- ],
- [
- 'label' => 'Montant',
- 'format' => 'raw',
- 'value' => function ($order) use ($orderModule) {
- $orderModule->initOrder($order);
- return $orderModule->getRepository()->getAmountSummary($order);
- }
- ]
- ],
- ]); ?>
- </div>
|