getUserModule();
$orderModule = $this->getOrderModule();
$userModule = UserModule::getInstance();
$username = Html::encode($userModule->getSolver()->getUsername($user));
$this->setTitle($username.' (#'.$user->id.')') ;
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => $username]) ;
$this->addBreadcrumb('Commandes') ;
?>
= $this->render('_menu_navigation', [
'action' => 'orders',
'user' => $user
]); ?>
= GridView::widget([
//'filterModel' => $searchModel,
'dataProvider' => $dataProvider,
'columns' => [
[
'label' => 'Statut',
'format' => 'raw',
'value' => function ($order) use ($orderModule) {
return $orderModule->getSolver()->getLabelOrderStatus($order);
}
],
[
'label' => 'Origine',
'format' => 'raw',
'value' => function ($order) use ($orderModule) {
return $orderModule->getSolver()->getLabelOrigin($order);;
}
],
[
'attribute' => 'distribution.date',
'label' => 'Date',
'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->getPointSaleSummary($order);
}
],
/*[
'label' => 'Historique',
'format' => 'raw',
'value' => function ($order) use ($orderModule) {
return $orderModule->getHistorySummary($order);
}
],*/
[
'label' => 'Produits',
'format' => 'raw',
'value' => function ($order) use ($orderModule) {
return $orderModule->getCartSummary($order);
}
],
[
'label' => 'Montant',
'format' => 'raw',
'value' => function ($order) use ($orderModule) {
$orderModule->initOrder($order);
return $orderModule->getAmountSummary($order);
}
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update}',
'headerOptions' => ['class' => 'column-actions'],
'contentOptions' => ['class' => 'column-actions'],
'buttons' => [
'update' => function ($url, $model) {
$url = Yii::$app->urlManager->createUrl(['distribution/index', 'idOrderUpdate' => $model->id]);
return Html::a('', $url, [
'title' => 'Modifier', 'class' => 'btn btn-default'
]);
},
],
]
],
]); ?>