]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Заменил на функцию origin/feature_fomichev_erp-298_add_prefix_to_write_offs_type
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 28 Jan 2025 15:14:17 +0000 (18:14 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 28 Jan 2025 15:14:17 +0000 (18:14 +0300)
erp24/api2/controllers/DataController.php
erp24/records/WriteOffsErp.php

index 34f73dff102190f43bf96333666c4f7d08b2a4ba..5c3088f88af92eed6248e44b481d0222b218006a 100644 (file)
@@ -311,6 +311,16 @@ class DataController extends BaseController
         }
     }
 
+    private function setPrefixToWriteOffsType($type)
+    {
+        $typeWriteOffs = $type;
+        if ($type === 'Брак') {
+            $typeWriteOffs = '2_' . $type;
+        }
+
+        return $typeWriteOffs;
+    }
+
     private function getWriteOffsDoc(): array
     {
         $writeOff = [];
@@ -374,7 +384,7 @@ class DataController extends BaseController
                 }
 
                 foreach ($writeOff as $row) {
-                    $typeWithPrefix = WriteOffsErp::WRITE_OFFS_TYPE_BRAK_PREFIX . $row['write_offs_type'];
+                    $typeWithPrefix = $this->setPrefixToWriteOffsType($row['write_offs_type']);
                     $writeOffResult[] = [
                         'id' => $row['guid'],
                         'store_id' => $row['store_guid'],
index 3da261c733d078568c0b4e46563b5b4d24c26fdb..77b135ac88ac6a2b9c65cfb1f82ac26a7540ffb6 100644 (file)
@@ -118,7 +118,6 @@ class WriteOffsErp extends \yii\db\ActiveRecord
     const STATUS_ERROR_1С = 8;
     const STATUS_DISABLE = 5;
     const WRITE_OFFS_TYPE_BRAK = "Брак";
-    const WRITE_OFFS_TYPE_BRAK_PREFIX = "2_";
     const WRITE_OFFS_TYPE_RETURN_KALUGA = "Возврат нереализованного товара (Калуга)";
     const WRITE_OFFS_TYPE_DELIVERY_BRAK = 'Брак с поставки';
     const WRITE_OFFS_TYPE_DUE_TO_EQUIPMENT_FAILURE_BRAK = 'Брак из-за поломки оборудования';