]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-360 Сборка страницы автопм
authormarina <m.zozirova@gmail.com>
Tue, 17 Jun 2025 09:22:41 +0000 (12:22 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 17 Jun 2025 09:22:41 +0000 (12:22 +0300)
erp24/controllers/AutoPlannogrammaController.php

index b5dbd86f93d36944114947a6ff44fb49634237de..308659f7cbb52285765aa030d7fedd2e9fd1a532 100644 (file)
@@ -214,13 +214,19 @@ class AutoPlannogrammaController extends BaseController
                 $quantity = $value['quantity'];
                 $value['title'] = [];
 
-                foreach (['offline', 'marketplace', 'online'] as $channel) {
-                    if (
-                        isset($forecast[$storeId][$channel][$group]) &&
-                        is_numeric($forecast[$storeId][$channel][$group])
-                    ) {
-                        $coef = $forecast[$storeId][$channel][$group];
-                        $value['title'][$channel] = round($quantity * $coef, 2);
+                if (!isset($forecast[$storeId])) {
+                    continue;
+                }
+
+                if (isset($forecast[$storeId][$productId])) {
+                    foreach (['offline', 'marketplace', 'online'] as $channel) {
+                        if (
+                            isset($forecast[$storeId][$productId][$channel][$group]) &&
+                            is_numeric($forecast[$storeId][$productId][$channel][$group])
+                        ) {
+                            $coef = $forecast[$storeId][$productId][$channel][$group];
+                            $value['title'][$channel] = round($quantity * $coef, 2);
+                        }
                     }
                 }
             }