From: Alexander Smirnov Date: Mon, 2 Sep 2024 11:30:30 +0000 (+0300) Subject: [ERP-130] Дебаг 010 X-Git-Tag: 1.4~11^2~15 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=97250d6723e5364285cd440993064965f6b4e075;p=erp24_rep%2Fyii-erp24%2F.git [ERP-130] Дебаг 010 --- 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()) {