From: Alexander Smirnov Date: Wed, 7 Aug 2024 08:45:20 +0000 (+0300) Subject: Калуга убрана из брака X-Git-Tag: 1.4~43^2~3 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=985b6d7daa19d3df9a395e72f81f45ea2df1b19f;p=erp24_rep%2Fyii-erp24%2F.git Калуга убрана из брака --- 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) {