add default account to frontend
This commit is contained in:
@@ -9,6 +9,8 @@ use yii\helpers\Url;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\models\Discount;
|
||||
use frontend\components\ReceptionWidget;
|
||||
use common\models\Account;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $form yii\bootstrap\ActiveForm */
|
||||
@@ -26,7 +28,7 @@ if ( isset($model->card) ){
|
||||
$options['customer_cart'] = $model->customerCart;
|
||||
}
|
||||
$options['discounts'] = Discount::modelsToArray($discounts);
|
||||
|
||||
$options['id_account'] = Account::readDefault();
|
||||
|
||||
|
||||
$this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
|
||||
@@ -67,21 +69,15 @@ $this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
|
||||
|
||||
</style>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-3'>
|
||||
<?php echo ReceptionMenuWidget::widget( [ 'customer' => $customer, 'card' => $card] ) ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo ReceptionCardNumberWidget::widget( [ 'customer' => $customer, 'card' =>$card, 'route' => ['product/sale'] ] )?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo ReceptionWidget::widget( ['form' => $receptionForm, 'route' => ['customer/reception'] ] )?>
|
||||
|
||||
<div class='row '>
|
||||
<div class='col-md-6 product-form'>
|
||||
<h1><?php echo Yii::t('frontend/product','Sell product')?></h1>
|
||||
<?php echo $this->render('_sale_form' ,['model' =>$model , 'lookupModel' =>$lookupModel, 'currencies' => $currencies, 'accounts' => $accounts,'discounts' => $discounts ]) ?>
|
||||
<?php echo $this->render('_sale_form' ,[ 'receptionForm' => $receptionForm, 'model' =>$model , 'lookupModel' =>$lookupModel, 'currencies' => $currencies, 'accounts' => $accounts,'discounts' => $discounts ]) ?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php if ( isset($card) ){ ?>
|
||||
<?php if ( $receptionForm->isCardWithCustomer() ){ ?>
|
||||
<?php echo $this->render('_customer_cart' ) ?>
|
||||
<?php }?>
|
||||
<?php echo $this->render('_user_cart' ) ?>
|
||||
|
||||
Reference in New Issue
Block a user