add product sell discount js changes

This commit is contained in:
2015-10-20 17:23:52 +02:00
parent 1a1477b26b
commit f2e30779f0
10 changed files with 165 additions and 90 deletions

View File

@@ -48,21 +48,6 @@ AppAsset::register($this);
'class' => 'navbar-inverse navbar-fixed-top',
],
]);
$menuItems = [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'About', 'url' => ['/site/about']],
['label' => 'Contact', 'url' => ['/site/contact']],
];
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
$menuItems[] = [
'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
'url' => ['/site/logout'],
'linkOptions' => ['data-method' => 'post']
];
}
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => $items,

View File

@@ -2,6 +2,8 @@
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use kartik\widgets\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model frontend\models\MoneyMovementSearch */
@@ -15,27 +17,27 @@ use yii\widgets\ActiveForm;
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_money_movement') ?>
<?= $form->field($model, 'id_account') ?>
<?= $form->field($model, 'id_user') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'type') ?>
<?php // echo $form->field($model, 'money') ?>
<?php // echo $form->field($model, 'comment') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd hh:ii'
]
]) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd hh:ii'
]
]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('backend/money-movement', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend/money-movement', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>

View File

@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="money-movement-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('backend/money-movement', 'Create Money Movement'), ['create'], ['class' => 'btn btn-success']) ?>

View File

@@ -8,6 +8,7 @@ use frontend\assets\ProductSellAsset;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Discount;
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
@@ -20,6 +21,8 @@ $options = [];
$options['lookup_product_url'] = Url::toRoute(['product/lookup']);
$options['clear_list_url'] = Url::toRoute(['product/clear-list']);
$options['sold_items'] = $userTransfers;
$options['discounts'] = Discount::modelsToArray($discounts);
$this->registerJs ( 'new ProductSell( '. json_encode($options).');' );

View File

@@ -15,35 +15,25 @@ use yii\widgets\ActiveForm;
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_transfer') ?>
<?= $form->field($model, 'id_discount') ?>
<?= $form->field($model, 'id_currency') ?>
<?= $form->field($model, 'id_object') ?>
<?= $form->field($model, 'status') ?>
<?php // echo $form->field($model, 'type') ?>
<?php // echo $form->field($model, 'item_price') ?>
<?php // echo $form->field($model, 'count') ?>
<?php // echo $form->field($model, 'money') ?>
<?php // echo $form->field($model, 'money_currency') ?>
<?php // echo $form->field($model, 'rate') ?>
<?php // echo $form->field($model, 'id_user') ?>
<?php // echo $form->field($model, 'comment') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>