From: marina Date: Tue, 17 Jun 2025 09:22:41 +0000 (+0300) Subject: ERP-360 Сборка страницы автопм X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=fca5a5fcf9a38b6e4c40b3bd3825f22194d4f813;p=erp24_rep%2Fyii-erp24%2F.git ERP-360 Сборка страницы автопм --- diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index b5dbd86f..308659f7 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -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); + } } } }