]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-130] Дебаг 019 зачистка
authorAlexander Smirnov <fredeom@mail.ru>
Mon, 2 Sep 2024 12:33:02 +0000 (15:33 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Mon, 2 Sep 2024 12:33:02 +0000 (15:33 +0300)
erp24/services/MotivationService.php

index 40e18f8a74615385af015454b309b4b605813403..4f0727fddbf10e228e884aa7e29ccfecb8e5fd05 100644 (file)
@@ -476,11 +476,7 @@ class MotivationService
                         if (($data['type'] ?? '') != $key) {
                             continue;
                         }
-                        $sum += ($selfCostProductMap[$data['date']][$data['product_id']] ?? 0) * ($data['quantity'] ?? 0);
-                        if ($ind == 3) {
-                            var_dump($data['quantity']);
-                            var_dump($selfCostProductMap[$data['date']][$data['product_id']]);
-                        }
+                        $sum += ($selfCostProductMap[date("Y-m-d", strtotime($data['date']))][$data['product_id']] ?? 0) * ($data['quantity'] ?? 0);
                     }
 
                     $motivationItemType = MotivationCostsItem::writeOffsToMotivationItemMap($key);
@@ -493,7 +489,7 @@ class MotivationService
                 }
             }
         }
-die;
+
         if ($motivation) {
             $motivation->save();
             if ($motivation->getErrors()) {