From 2a6096ee73af7e6b913304e92cd67b9efb9779fb Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 29 May 2024 15:49:44 +0300 Subject: [PATCH] add new write_offs_type --- erp24/controllers/WriteOffsErpController.php | 1 - erp24/records/WriteOffsErp.php | 9 +-------- erp24/views/write_offs_erp/_form.php | 5 +++++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/erp24/controllers/WriteOffsErpController.php b/erp24/controllers/WriteOffsErpController.php index 1076949..21af8a5 100644 --- a/erp24/controllers/WriteOffsErpController.php +++ b/erp24/controllers/WriteOffsErpController.php @@ -426,7 +426,6 @@ class WriteOffsErpController extends Controller $model->setNumberDefault(); $model->setStatusCreated(); $model->setCreatedDate(); - $model->setCreatedWriteOffsType(); $model->setStoreGuidCreated(); $model->setCreatedAt(); $model->setCauseGroupId(); diff --git a/erp24/records/WriteOffsErp.php b/erp24/records/WriteOffsErp.php index 7c6b1d0..33182e8 100644 --- a/erp24/records/WriteOffsErp.php +++ b/erp24/records/WriteOffsErp.php @@ -118,6 +118,7 @@ class WriteOffsErp extends \yii\db\ActiveRecord const STATUS_ERROR_1С = 8; const STATUS_DISABLE = 5; const WRITE_OFFS_TYPE_BRAK = "Брак"; + const WRITE_OFFS_TYPE_RETURN_KALUGA = "Возврат нереализованного товара (Калуга)"; public function custom_function_validation($attribute, $params) { @@ -576,14 +577,6 @@ class WriteOffsErp extends \yii\db\ActiveRecord $this->write_offs_type = $write_offs_type; } - /** - * @param string $write_offs_type - */ - public function setCreatedWriteOffsType(): void - { - $this->write_offs_type = self::WRITE_OFFS_TYPE_BRAK; - } - /** * @return float */ diff --git a/erp24/views/write_offs_erp/_form.php b/erp24/views/write_offs_erp/_form.php index 9209d2f..226fd02 100644 --- a/erp24/views/write_offs_erp/_form.php +++ b/erp24/views/write_offs_erp/_form.php @@ -77,6 +77,11 @@ $this->registerJsFile('/js/heic_to_jpg_replace.js', ['position' => \yii\web\View ?> + field($model, 'write_offs_type')->dropDownList([ + WriteOffsErp::WRITE_OFFS_TYPE_BRAK => WriteOffsErp::WRITE_OFFS_TYPE_BRAK, + WriteOffsErp::WRITE_OFFS_TYPE_RETURN_KALUGA => WriteOffsErp::WRITE_OFFS_TYPE_RETURN_KALUGA, + ]) ?> + field($model, 'store_id')->dropDownList($listCityStoreNames) ?> field($model, 'comment')->textInput() ?> -- 2.39.5