]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-130] Дебаг 010
authorAlexander Smirnov <fredeom@mail.ru>
Mon, 2 Sep 2024 11:30:30 +0000 (14:30 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Mon, 2 Sep 2024 11:30:30 +0000 (14:30 +0300)
erp24/services/MotivationService.php

index 9c8f656837633d2846c604c158352cf42d21fa38..0afaf5549549fcf607010ea0638d5b46ba67a6c0 100644 (file)
@@ -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()) {