diff --git a/backend/controllers/DiscountController.php b/backend/controllers/DiscountController.php index ec82815..91a75b8 100644 --- a/backend/controllers/DiscountController.php +++ b/backend/controllers/DiscountController.php @@ -92,18 +92,6 @@ class DiscountController extends Controller } } - /** - * Deletes an existing Discount model. - * If deletion is successful, the browser will be redirected to the 'index' page. - * @param integer $id - * @return mixed - */ - public function actionDelete($id) - { - $this->findModel($id)->delete(); - - return $this->redirect(['index']); - } /** * Finds the Discount model based on its primary key value. diff --git a/backend/controllers/WarehouseController.php b/backend/controllers/WarehouseController.php index f4097d4..325c8fc 100644 --- a/backend/controllers/WarehouseController.php +++ b/backend/controllers/WarehouseController.php @@ -62,7 +62,7 @@ class WarehouseController extends Controller public function actionCreate() { $model = new Warehouse(); - + $model->status = Warehouse::STATUS_ACTIVE; if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id_warehouse]); } else { diff --git a/backend/views/discount/index.php b/backend/views/discount/index.php index a7eba8f..ea37fc9 100644 --- a/backend/views/discount/index.php +++ b/backend/views/discount/index.php @@ -21,7 +21,6 @@ $this->params['breadcrumbs'][] = $this->title; $dataProvider, - 'filterModel' => $searchModel, 'columns' => [ 'name', [ @@ -36,7 +35,10 @@ $this->params['breadcrumbs'][] = $this->title; 'created_at:datetime', 'updated_at:datetime', - ['class' => 'yii\grid\ActionColumn'], + [ + 'class' => 'yii\grid\ActionColumn', + 'template' => '{view} {update}' + ], ], ]); ?> diff --git a/backend/views/discount/view.php b/backend/views/discount/view.php index 75091c1..1365857 100644 --- a/backend/views/discount/view.php +++ b/backend/views/discount/view.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title;

$model->id_warehouse], ['class' => 'btn btn-primary']) ?> - $model->id_warehouse], [ 'class' => 'btn btn-danger', 'data' => [ @@ -30,10 +30,18 @@ $this->params['breadcrumbs'][] = $this->title; $model, 'attributes' => [ - 'id_warehouse', 'name', - 'status', - 'type', + [ + 'attribute' => 'status', + 'label' => Yii::t('common/discount', "Active"), + 'value' => $model->statusHuman + ], + [ + 'attribute' => 'type', + 'value' => $model->typeHuman + ], +// 'status', +// 'type', 'value', 'created_at', 'updated_at', diff --git a/common/models/Account.php b/common/models/Account.php index d4db0bd..291465e 100644 --- a/common/models/Account.php +++ b/common/models/Account.php @@ -99,7 +99,7 @@ class Account extends \yii\db\ActiveRecord $result = null; $s = self::types($this->type); if ( array_key_exists($this->type, $s)){ - $result = $s[$this->status]; + $result = $s[$this->type]; } return $result; } diff --git a/common/models/Discount.php b/common/models/Discount.php index 9e6bb4c..6d2350d 100644 --- a/common/models/Discount.php +++ b/common/models/Discount.php @@ -98,7 +98,7 @@ class Discount extends \yii\db\ActiveRecord $result = null; $s = self::types($this->type); if ( array_key_exists($this->type, $s)){ - $result = $s[$this->status]; + $result = $s[$this->type]; } return $result; } diff --git a/composer.lock b/composer.lock index 6a29fb3..e7e2ee1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "8580bd82955b1fbb80d47024e184056e", + "hash": "5fe15fcdcc6c43b39968ffd29104ac62", "packages": [ { "name": "bower-asset/bootstrap",