From fca5a5fcf9a38b6e4c40b3bd3825f22194d4f813 Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 17 Jun 2025 12:22:41 +0300 Subject: [PATCH] =?utf8?q?ERP-360=20=D0=A1=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= =?utf8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=B0?= =?utf8?q?=D0=B2=D1=82=D0=BE=D0=BF=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../AutoPlannogrammaController.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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); + } } } } -- 2.39.5