add discount to product sell js
This commit is contained in:
@@ -65,7 +65,7 @@ class DiscountController extends Controller
|
||||
$model->status = Discount::STATUS_ACTIVE;
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id_warehouse]);
|
||||
return $this->redirect(['view', 'id' => $model->id_discount]);
|
||||
} else {
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
@@ -84,7 +84,7 @@ class DiscountController extends Controller
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id_warehouse]);
|
||||
return $this->redirect(['view', 'id' => $model->id_discount]);
|
||||
} else {
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
|
||||
@@ -18,7 +18,7 @@ class DiscountSearch extends Discount
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_warehouse', 'status', 'type', 'value'], 'integer'],
|
||||
[['id_discount', 'status', 'type', 'value'], 'integer'],
|
||||
[['name', 'created_at', 'updated_at'], 'safe'],
|
||||
];
|
||||
}
|
||||
@@ -56,7 +56,7 @@ class DiscountSearch extends Discount
|
||||
}
|
||||
|
||||
$query->andFilterWhere([
|
||||
'id_warehouse' => $this->id_warehouse,
|
||||
'id_discount' => $this->id_discount,
|
||||
'status' => $this->status,
|
||||
'type' => $this->type,
|
||||
'value' => $this->value,
|
||||
|
||||
@@ -9,7 +9,7 @@ $this->title = Yii::t('common/discount', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Discount',
|
||||
]) . ' ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/discount', 'Discounts'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_warehouse]];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_discount]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('common/discount', 'Update');
|
||||
?>
|
||||
<div class="discount-update">
|
||||
|
||||
@@ -15,9 +15,9 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/discount', 'Update'), ['update', 'id' => $model->id_warehouse], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('common/discount', 'Update'), ['update', 'id' => $model->id_discount], ['class' => 'btn btn-primary']) ?>
|
||||
<?php
|
||||
/* Html::a(Yii::t('common/discount', 'Delete'), ['delete', 'id' => $model->id_warehouse], [
|
||||
/* Html::a(Yii::t('common/discount', 'Delete'), ['delete', 'id' => $model->id_discount], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('common/discount', 'Are you sure you want to delete this item?'),
|
||||
|
||||
Reference in New Issue
Block a user