add contract started_at field

This commit is contained in:
2016-03-03 07:57:17 +01:00
parent b2c1cc0a6d
commit fd4122a983
13 changed files with 222 additions and 16 deletions

View File

@@ -8,6 +8,7 @@ use frontend\components\HtmlHelper;
use kartik\widgets\DatePicker;
use common\models\Transfer;
use common\models\Discount;
use frontend\assets\ContractMakeAsset;
/* @var $this yii\web\View */
/* @var $model common\models\Contract */
@@ -17,12 +18,26 @@ use common\models\Discount;
<?php
ContractMakeAsset::register($this);
$types = TicketType::findAll(['status' => TicketType::STATUS_ACTIVE ,'installment_enabled' => '1']);
$typeOptions = TicketType::modelsToArray($types);
$types = HtmlHelper::mkTicketTypeOptions($types);
$discounts = Discount::readTicketDiscounts();
$discountOptions = Discount::modelsToArray($discounts,[]);
$discounts = ['' => ''] + HtmlHelper::mkDiscountOptions($discounts);
$options = [];
$options['ticket_types'] = $typeOptions;
$options['discounts'] = $discountOptions;
$this->registerJs(' contract_make.init( '. json_encode($options) .' );');
?>
<h1>Szerződés létrehozása</h1>
<div class="contract-form">
@@ -92,7 +107,12 @@ use common\models\Discount;
<?= $form->field($model, 'ticket_type')->dropDownList($types) ?>
</div>
<div class="col-md-6">
<?= $form->field($model, 'started_at')->widget(\kartik\date\DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class="row">
@@ -106,8 +126,19 @@ use common\models\Discount;
<p>
Figyelem: A szerződés létrehozásakor a szerződés első bérlete bekerül a vásálró kosarába.
</p>
<table class="table table-striped">
<tr>
<td>Bérlet ára</td>
<td class="ticket-price"></td>
</tr>
<tr>
<td>Összesen</td>
<td class="ticket-total"></td>
</tr>
</table>
<div class="form-group">