From d74d7e8b45b1bd0473302eee52badeb045b8dbb3 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Mon, 2 Sep 2024 15:33:02 +0300 Subject: [PATCH] =?utf8?q?[ERP-130]=20=D0=94=D0=B5=D0=B1=D0=B0=D0=B3=20019?= =?utf8?q?=20=D0=B7=D0=B0=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MotivationService.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 40e18f8a..4f0727fd 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -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()) { -- 2.39.5