99 lines
2.6 KiB
PHP
99 lines
2.6 KiB
PHP
<?php
|
|
|
|
use common\models\Account;
|
|
use common\models\Discount;
|
|
use frontend\assets\ProductSellAsset;
|
|
use frontend\components\ReceptionWidget;
|
|
use yii\bootstrap\ActiveForm;
|
|
use yii\helpers\Url;
|
|
|
|
/* @var $this yii\web\View */
|
|
/* @var $form yii\bootstrap\ActiveForm */
|
|
/* @var $currencies common\models\Currency[] */
|
|
|
|
ProductSellAsset::register($this);
|
|
|
|
$options = [];
|
|
|
|
$options['lookup_product_url'] = Url::toRoute(['product/lookup']);
|
|
$options['find_product_url'] = Url::toRoute(['product/find']);
|
|
$options['url_pay_user_cart'] = Url::toRoute(['product/payout-user-cart']);
|
|
$options['user_cart'] = $userTransfers;
|
|
$options['products'] = $model->products;
|
|
if ( isset($model->card) ){
|
|
$options['url_pay_customer_card'] = Url::toRoute(['product/payout-customer-cart','number' => $model->card->number]);
|
|
$options['customer_cart'] = $model->customerCart;
|
|
}
|
|
$options['discounts'] = Discount::modelsToArray($discounts);
|
|
$options['id_account'] = Account::readDefault();
|
|
|
|
|
|
$this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
|
|
|
|
$this->params['breadcrumbs'][] = Yii::t('frontend/product', 'Products') ;
|
|
$this->params['breadcrumbs'][] = Yii::t('frontend/product', 'Sale');
|
|
|
|
?>
|
|
|
|
<style>
|
|
/*
|
|
.product-form input, .product-form select, .product-form textarea{
|
|
width: 100%;
|
|
}
|
|
*/
|
|
.product-count{
|
|
text-align: right;
|
|
}
|
|
|
|
.form-group{
|
|
margin-bottom: 3px;
|
|
}
|
|
|
|
.table-transfers thead th{
|
|
text-align: center;
|
|
}
|
|
|
|
.table-transfers tfoot .product-money,
|
|
.table-transfers tfoot .product-count,
|
|
.table-transfers tbody .product-money,
|
|
.table-transfers tbody .product-count,
|
|
.table-transfers tbody .sale-price
|
|
{
|
|
text-align: right;
|
|
}
|
|
.table-transfers tbody .product-name,
|
|
.table-transfers tbody .product-time
|
|
{
|
|
text-align: left;
|
|
}
|
|
.table-transfers .product-time{
|
|
width: 140px;
|
|
}
|
|
.table-transfers .product-count{
|
|
width: 50px;
|
|
}
|
|
.table-transfers .sale-price{
|
|
width: 80px;
|
|
}
|
|
.table-transfers .product-money{
|
|
width: 100px;
|
|
}
|
|
|
|
</style>
|
|
|
|
<?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' ,[ 'receptionForm' => $receptionForm, 'model' =>$model , 'lookupModel' =>$lookupModel, 'currencies' => $currencies, 'accounts' => $accounts,'discounts' => $discounts ]) ?>
|
|
</div>
|
|
<div class='col-md-6'>
|
|
<?php if ( $receptionForm->isCardWithCustomer() ){ ?>
|
|
<?php echo $this->render('_customer_cart' ) ?>
|
|
<?php }?>
|
|
<?php echo $this->render('_user_cart' ) ?>
|
|
|
|
</div>
|
|
</div>
|