add payment method

This commit is contained in:
2016-01-17 16:21:37 +01:00
parent abb69ce92d
commit d043759b1d
20 changed files with 751 additions and 168 deletions

View File

@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Transfer;
/* @var $this yii\web\View */
/* @var $model frontend\models\ProductSaleForm */
@@ -94,6 +95,11 @@ $discountOptions = mkOptions( ArrayHelper::map($discounts, 'id_discount', 'name'
<?php echo $form->field($model,'id_discount')->dropDownList($discountOptions) ?>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<?php echo $form->field($model,'payment_method')->dropDownList(Transfer::paymentMethods()) ?>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<?php echo $form->field( $model,'comment' )->textarea() ?>

View File

@@ -5,6 +5,7 @@ use yii\widgets\ActiveForm;
use frontend\components\HtmlHelper;
use kartik\widgets\DatePicker;
use common\models\Account;
use common\models\Transfer;
/* @var $this yii\web\View */
/* @var $model common\models\Ticket */
@@ -43,7 +44,9 @@ use common\models\Account;
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
<?php //echo $form->field($model, 'id_discount')->dropDownList($discountOptions) ?>
<?php echo $form->field($model,'payment_method')->dropDownList(Transfer::paymentMethods()) ?>
<?php echo $form->field($model, 'id_discount')->dropDownList($discountOptions) ?>
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
'pluginOptions' => [

View File

@@ -40,6 +40,15 @@ if ( isset($receptionForm->card) ){
$options['customer_cart'] = $model->customerCart;
}
$discountItems = [];
foreach ($discounts as $d){
$item = [];
$item['id_discount'] = $d->id_discount;
$item['value'] = $d->value;
$discountItems[] = $item;
}
$options['discounts'] = $discountItems;
$this->registerJs ( 'new TicketSell( '. json_encode($options).');' );
?>
<div class="ticket-create">

View File

@@ -31,6 +31,9 @@ $formatter = Yii::$app->formatter;
<dt><?php echo $model->getAttributeLabel( 'status') ?></dt>
<dd><?php echo Html::getAttributeValue($model, 'statusName') ?></dd>
<dt><?php echo $model->getAttributeLabel( 'payment_method') ?></dt>
<dd><?php echo Html::getAttributeValue($model, 'paymentMethodName') ?></dd>
</dl>
</div>
<div class='col-md-4'>