]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-224 Доработать Факт в таблице мотивации feature_zozirova_erp-224_modify_fact_on_motivation origin/feature_zozirova_erp-224_modify_fact_on_motivation
authormarina <m.zozirova@gmail.com>
Tue, 15 Oct 2024 07:49:47 +0000 (10:49 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 15 Oct 2024 07:49:47 +0000 (10:49 +0300)
erp24/services/MotivationService.php

index 3ab5b4166f99318d4450f64a12fde55111846297..0f98f9fe6e4c74497fbbed80e2cfd74ef691946c 100644 (file)
@@ -217,6 +217,7 @@ class MotivationService
                     'forecast' => null,
                     'fact' => null,
                     'deviation' => null,
+                    'is_combined' => $costsItem->is_combined
                 ];
             }
 
@@ -234,8 +235,12 @@ class MotivationService
             }
 
                 $result[$costsItem->order][$groupAlias] = $actualValue;
-        }
 
+            if ($result[$costsItem->order]['is_combined'] == true
+                && (empty($result[$costsItem->order]['fact']) || $result[$costsItem->order]['fact'] == 0)) {
+                $result[$costsItem->order]['fact'] = $result[$costsItem->order]['plan'];
+            }
+        }
 
         // Подстановка значений расходных материалов
         //190 - порядок для расходных материалов