From 985b6d7daa19d3df9a395e72f81f45ea2df1b19f Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 7 Aug 2024 11:45:20 +0300 Subject: [PATCH] =?utf8?q?=D0=9A=D0=B0=D0=BB=D1=83=D0=B3=D0=B0=20=D1=83?= =?utf8?q?=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20=D0=B8=D0=B7=20=D0=B1=D1=80?= =?utf8?q?=D0=B0=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/records/MotivationCostsItem.php | 2 +- erp24/services/MotivationService.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/erp24/records/MotivationCostsItem.php b/erp24/records/MotivationCostsItem.php index 9492f9c6..1f9de0be 100644 --- a/erp24/records/MotivationCostsItem.php +++ b/erp24/records/MotivationCostsItem.php @@ -35,7 +35,7 @@ class MotivationCostsItem extends ActiveRecord case WriteOffsErp::WRITE_OFFS_TYPE_DELIVERY_BRAK: return self::ITEM_DEFECTIVE_DELIVERY; case WriteOffsErp::WRITE_OFFS_TYPE_DUE_TO_EQUIPMENT_FAILURE_BRAK: return self::ITEM_DEFECT_DUE_TO_EQUIPMENT_FAILURE; case WriteOffsErp::WRITE_OFFS_TYPE_RESORTING_DOES_NOT_COUNT_TOWARDS_COST: return self::ITEM_REGRADING; - default: return self::ITEM_WRITE_OFF_OF_ILLIQUID_GOODS_SPOILAGE_EXPIRATION_OF_SHELF_LIFE; + default: return ''; } } diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index f94585cc..6e2371b3 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -356,6 +356,9 @@ class MotivationService foreach ($writeOffs as $key => $data) { $motivationItemType = MotivationCostsItem::writeOffsToMotivationItemMap($key); + if (empty($motivationItemType)) { + continue; + } $motivationCostsItem = MotivationCostsItem::find()->where(['name' => $motivationItemType])->one(); /** @var $motivationCostsItem MotivationCostsItem */ if ($motivation) { -- 2.39.5