From 97250d6723e5364285cd440993064965f6b4e075 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Mon, 2 Sep 2024 14:30:30 +0300 Subject: [PATCH] =?utf8?q?[ERP-130]=20=D0=94=D0=B5=D0=B1=D0=B0=D0=B3=20010?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MotivationService.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 9c8f6568..0afaf554 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -458,8 +458,7 @@ class MotivationService ->where(['between', 'date', $weekStart, $weekEnd]) ->andWhere(['store_id' => $exportImportTable->export_val]) ->asArray()->all(); -var_dump($writeOffs); -var_dump("---------------"); + $selfCostProduct = SelfCostProduct::find()->select(['price', 'product_guid']) ->where(['between', 'date', $weekStart, $weekEnd]) ->andWhere(['store_id' => $store_id]) @@ -467,11 +466,11 @@ var_dump("---------------"); ->asArray()->all(); foreach (MotivationCostsItem::getWriteOffsItems() as $key) { + $sum = 0; foreach($writeOffs as $data) { if (($data['type'] ?? '') != $key) { continue; } - $sum = 0; if (!empty($data)) { try { $json = Json::decode($data['items'] ?? '[]'); @@ -492,7 +491,7 @@ var_dump("---------------"); } } } -die; + if ($motivation) { $motivation->save(); if ($motivation->getErrors()) { -- 2.39.5