add editable account on reception/customer-cart, add towel handling

This commit is contained in:
2016-10-21 20:39:02 +02:00
parent 8585286150
commit 90c598f8c6
26 changed files with 649 additions and 37 deletions

View File

@@ -38,6 +38,10 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'customer_email',
'label' => 'E-mail',
],
[
'attribute' => 'towel_count',
'label' => 'Törölköző (db)',
],
// [
// 'attribute' => 'customer.name',
// 'value' => 'customer.name',
@@ -45,7 +49,7 @@ $this->params['breadcrumbs'][] = $this->title;
['class' => 'yii\grid\ActionColumn',
'template' => '{ticket} {product} {ticket_history} {keys} {contract}',
'template' => '{ticket} {product} {ticket_history} {keys} {contract} {towel}',
'buttons' => [
'ticket' => function ($url, $model, $key) {
return Html::a('Új bérlet', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
@@ -61,6 +65,9 @@ $this->params['breadcrumbs'][] = $this->title;
},
'contract' => function ($url, $model, $key) {
return Html::a('Szerződések', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
},
'towel' => function ($url, $model, $key) {
return Html::a('Törölközők', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
},
],
'urlCreator' => function ($action, $model, $key, $index){
@@ -75,6 +82,9 @@ $this->params['breadcrumbs'][] = $this->title;
$url = Url::to(['key/index','id_card' => $model['card_id_card']]);
}else if ( 'contract' == $action ){
$url = Url::to(['contract/index','id_card' => $model['card_id_card']]);
}else if ( 'towel' == $action ){
$start = Yii::$app->formatter->asDatetime(strtotime('today UTC'));
$url = Url::to(['log/towel','id_card' => $model['card_id_card'] ,'LogSearch[start]' =>$start ]);
}
return $url;
}