setTitle('Bons de livraison');
$this->addBreadcrumb($this->getTitle());
$this->addButton(['label' => 'Nouveau bon de livraison ', 'url' => 'delivery-note/create', 'class' => 'btn btn-primary']);
?>
= GridView::widget([
'filterModel' => $searchModel,
'dataProvider' => $dataProvider,
'columns' => [
'reference',
'name',
[
'attribute' => 'date',
'header' => 'Date',
'value' => function($model) {
return date('d/m/Y',strtotime($model->date)) ;
}
],
[
'attribute' => 'point_sale',
'header' => 'Point de vente',
'format' => 'raw',
'value' => function($model) {
$pointSale = $model->getPointSale() ;
$distribution = $model->getDistribution() ;
if($pointSale && $distribution) {
return Html::encode($pointSale->name).'
'
.'le '.date('d/m/Y', strtotime($distribution->date));
}
return '' ;
}
],
[
'attribute' => 'amount',
'header' => 'Montant',
'value' => function($invoice) {
return $invoice->getAmount(Order::AMOUNT_TOTAL, true) ;
}
]
/*[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {delete}',
'headerOptions' => ['class' => 'column-actions'],
'contentOptions' => ['class' => 'column-actions'],
'buttons' => [
'update' => function ($url, $model) {
return Html::a('', $url, [
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default'
]);
},
'delete' => function ($url, $model) {
return Html::a('', $url, [
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default'
]);
}
],
],*/
],
]); ?>