From: Alexander Smirnov Date: Tue, 20 Aug 2024 08:07:21 +0000 (+0300) Subject: [ERP-140] Добавляет коррекцию для оставшихся полей X-Git-Tag: 1.4~5^2~21 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=28808ec6f2be22f78292001cd2e575394273ec45;p=erp24_rep%2Fyii-erp24%2F.git [ERP-140] Добавляет коррекцию для оставшихся полей --- diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 358600ef..65f870e7 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -1304,8 +1304,9 @@ class MotivationService foreach ($motivations as $motivation) { $plan = self::getMotivationValue($motivation->id, 7, 27); + $adjustment = self::getMotivationValue($motivation->id, 8, 27); self::saveOrUpdateMotivationValue($motivation->id, - "fact", 27, "float", $plan); + "fact", 27, "float", $plan + $adjustment); } } @@ -1316,8 +1317,9 @@ class MotivationService foreach ($motivations as $motivation) { $plan = self::getMotivationValue($motivation->id, 7, 28); + $adjustment = self::getMotivationValue($motivation->id, 8, 28); self::saveOrUpdateMotivationValue($motivation->id, - "fact", 28, "float", $plan); + "fact", 28, "float", $plan + $adjustment); } } @@ -1339,8 +1341,9 @@ class MotivationService foreach ($motivations as $motivation) { /** @var $motivation Motivation */ $tariff = self::getMotivationValue($motivation->id, 7, 36); + $adjustment = self::getMotivationValue($motivation->id, 8, 36); self::saveOrUpdateMotivationValue($motivation->id, - "fact", 29, "float", $tariff * ($timetableFactModels[$motivation->store_id]['cnt'] ?? 0)); + "fact", 29, "float", $tariff * ($timetableFactModels[$motivation->store_id]['cnt'] ?? 0) + $adjustment); } } @@ -1351,8 +1354,9 @@ class MotivationService foreach ($motivations as $motivation) { $plan = self::getMotivationValue($motivation->id, 7, 31); + $adjustment = self::getMotivationValue($motivation->id, 8, 31); self::saveOrUpdateMotivationValue($motivation->id, - "fact", 31, "float", $plan); + "fact", 31, "float", $plan + $adjustment); } } @@ -1363,8 +1367,9 @@ class MotivationService foreach ($motivations as $motivation) { $plan = self::getMotivationValue($motivation->id, 7, 32); + $adjustment = self::getMotivationValue($motivation->id, 8, 32); self::saveOrUpdateMotivationValue($motivation->id, - "fact", 32, "float", $plan); + "fact", 32, "float", $plan + $adjustment); } }