]> gitweb.erp-flowers.ru Git - yii-erp24/.git/commitdiff
add new write_offs_type
authorAlexander Smirnov <fredeom@mail.ru>
Wed, 29 May 2024 12:49:44 +0000 (15:49 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Wed, 29 May 2024 12:49:44 +0000 (15:49 +0300)
erp24/controllers/WriteOffsErpController.php
erp24/records/WriteOffsErp.php
erp24/views/write_offs_erp/_form.php

index 1076949321875c3410c796e09898deccb15e1b29..21af8a510b5534714bd40dedbecf49cc1f43cb8b 100644 (file)
@@ -426,7 +426,6 @@ class WriteOffsErpController extends Controller
                 $model->setNumberDefault();
                 $model->setStatusCreated();
                 $model->setCreatedDate();
-                $model->setCreatedWriteOffsType();
                 $model->setStoreGuidCreated();
                 $model->setCreatedAt();
                 $model->setCauseGroupId();
index 7c6b1d014459600d6a5612b29df3814b3b118020..33182e8dfca9c1d2efee13431012d034fbe86a46 100644 (file)
@@ -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
      */
index 9209d2fe08c266591a03b40f0fc0105d55bd4fef..226fd0253d53df7aa0ab459c327684c18ea829b7 100644 (file)
@@ -77,6 +77,11 @@ $this->registerJsFile('/js/heic_to_jpg_replace.js', ['position' => \yii\web\View
 
     ?>
 
+    <?= $form->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,
+    ]) ?>
+
     <?= $form->field($model, 'store_id')->dropDownList($listCityStoreNames) ?>
 
     <?= $form->field($model, 'comment')->textInput() ?>