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

@@ -7,7 +7,7 @@ use yii\helpers\Url;
$route = \Yii::$app->controller->id .'/'. \Yii::$app->controller->action->id;
$todayDateTime = Yii::$app->formatter->asDatetime(strtotime('today UTC'));
@@ -22,6 +22,7 @@ $items = [
[ 'Szerződések', ['contract/index', 'id_card' => $card->id_card ]],
[ 'Kosár', ['transfer/customer-cart', 'id_card' => $card->id_card ]],
[ 'Kártya', ['card/info', 'id_card' => $card->id_card ]],
[ 'Törölköző Bérlés', ['log/towel', 'id_card' => $card->id_card , 'LogSearch[start]' => $todayDateTime ]],
];

View File

@@ -36,6 +36,10 @@ if ( $model->isCardWithCustomer() ){
'label' => 'Telefon',
'value' => $model->customer->phone
],
[
'label' => 'Kiadott törölközők',
'value' => $model->customer->towel_count
],
[
'label' => 'Kulcsok',
'value' =>

View File

@@ -81,5 +81,28 @@ $card = $model->card;
</div>
<?php ActiveForm::end(); ?>
<?php if ( isset($model->customer) ) { ?>
<?php $form = ActiveForm::begin([
'action' => ['customer/towel', 'number' => $model->getCardNumber()],
'method' => 'post',
]); ?>
<div class="row" style="margin-top: 6px; margin-bottom: 6px;">
<div class='col-md-12'>
<?php echo Html::hiddenInput('TowelForm[number]', $model->getCardNumber())?>
<?php echo Html::textInput('TowelForm[count]','',['class'=>"form-control", 'placeholder' =>'Törölköző darab' ,'type' => 'number']) ?>
</div>
</div>
<div class="row">
<div class='col-md-6'>
<?= Html::submitButton(Yii::t('frontend/collection', 'Bérel'), [ 'name' => 'TowelForm[direction]', 'value' => 'out', 'class' => 'btn btn-primary btn-block']) ?>
</div>
<div class='col-md-6'>
<?= Html::submitButton(Yii::t('frontend/collection', 'Vissza ad'), ['name' => 'TowelForm[direction]', 'value' => 'in', 'class' => 'btn btn-primary btn-block']) ?>
</div>
</div>
<?php ActiveForm::end(); ?>
<?php }?>

View File

@@ -136,4 +136,23 @@ if ( isset( $model->unpaidTickets ) ) {
}
if ( isset($model->customer)){
if ( $model->customer->towel_count > 0 ){
$towelText = "Kiadott törölközők (db):" . $model->customer->towel_count;
$towelClass = "alert alert-danger";
}else{
$towelText = "Nincs kiadott törölköző";
$towelClass = "alert alert-success";
}
echo Html::beginTag("div",['class'=> $towelClass, "role"=>"alert"]);
echo Html::beginTag("strong",[ ]);
echo $towelText;
echo Html::endTag("strong");
echo Html::endTag("div");
}
?>