From dc79485f9cb2e10990552ab71ed2c0161503cefc Mon Sep 17 00:00:00 2001 From: fomichev Date: Tue, 13 May 2025 15:05:20 +0300 Subject: [PATCH] =?utf8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=B4=D0=BE?= =?utf8?q?=D0=BF=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B4=D0=BB?= =?utf8?q?=D1=8F=20=D0=BF=D0=BE=D0=B4=D0=BA=D0=B0=D1=82=D0=B5=D0=B3=D0=BE?= =?utf8?q?=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/AutoPlannogrammaController.php | 5 +++++ erp24/views/auto-plannogramma/control-species.php | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index 13a38e85..babc6d2b 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -325,7 +325,12 @@ class AutoPlannogrammaController extends BaseController unset($row); $monthSubcategoryGoal = $service->getMonthSubcategoryGoal($monthSubcategoryShare, $monthCategoryGoal); } + // var_dump($monthSubcategoryShare); die(); + foreach ($monthSubcategoryShare as $subcat) { + $monthCategoryShareResult[$subcat['store_id']][$subcat['category']][$subcat['subcategory']]['total_sum'] = $subcat['total_sum']; + $monthCategoryShareResult[$subcat['store_id']][$subcat['category']][$subcat['subcategory']]['percent_of_month'] = $subcat['percent_of_month']; + } $monthSpeciesShare = $service->getMonthSpeciesShareOrWriteOffWeighted($datePlan, $datePlan, $filters, null, $filters['type']); $monthSpeciesGoal = $service->getMonthSpeciesGoalDirty($monthSpeciesShare, $monthSubcategoryGoal); if ($filters['type'] === 'writeOffs') { diff --git a/erp24/views/auto-plannogramma/control-species.php b/erp24/views/auto-plannogramma/control-species.php index 50acfe62..e19017cf 100644 --- a/erp24/views/auto-plannogramma/control-species.php +++ b/erp24/views/auto-plannogramma/control-species.php @@ -97,7 +97,11 @@ use yii_app\records\Products1c; Категория + Категория сумма + Категория доля Подкатегория + Подкатегория сумма + Подкатегория доля Вид Неделя Доля (%) @@ -108,8 +112,12 @@ use yii_app\records\Products1c; - storeId][$r['category']]['total_sum_cat'] ?> formatter->asPercent($monthCategoryShare[$model->storeId][$r['category']]['share_of_total'], 2) ?> + + storeId][$r['category']]['total_sum_cat'] ?> + formatter->asPercent($monthCategoryShare[$model->storeId][$r['category']]['share_of_total'], 2) ?> + storeId][$r['category']][$r['subcategory']]['total_sum'] ?> + formatter->asPercent($monthCategoryShare[$model->storeId][$r['category']][$r['subcategory']]['percent_of_month'], 2) ?> неделя - начало -- 2.39.5