From: marina Date: Tue, 17 Jun 2025 09:25:38 +0000 (+0300) Subject: ERP-360 Сборка страницы автопм X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=83f6d7eec95ef01d1ecd78100fec20cf103334e6;p=erp24_rep%2Fyii-erp24%2F.git ERP-360 Сборка страницы автопм --- diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index 308659f7..fc8b48ec 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -210,7 +210,6 @@ class AutoPlannogrammaController extends BaseController foreach ($result as $productId => &$productData) { foreach ($productData['values'] as &$value) { $storeId = $value['store_id']; - $group = $value['group']; $quantity = $value['quantity']; $value['title'] = []; @@ -218,21 +217,15 @@ class AutoPlannogrammaController extends BaseController 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); - } + foreach (['offline', 'marketplace', 'online'] as $channel) { + if (isset($forecast[$storeId][$channel]['share']) && is_numeric($forecast[$storeId][$channel]['share'])) { + $coef = $forecast[$storeId][$channel]['share']; + $value['title'][$channel] = round($quantity * $coef, 2); } } } } - return array_values($result); }