From dca97ee0b0dae391c4b171e1951c0d6a2c323d44 Mon Sep 17 00:00:00 2001 From: marina Date: Wed, 18 Jun 2025 16:32:10 +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 --- erp24/commands/CronController.php | 2 +- erp24/controllers/AutoPlannogrammaController.php | 2 ++ erp24/services/AutoPlannogrammaService.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 2330ba88..d3b91b49 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1592,7 +1592,7 @@ class CronController extends Controller ]; $forecast = $service->calculateFullForecastForWeek($forecastParams); - $writeOffsForecast = $service->getWeeklyProductsWriteoffsForecast($month, $year, $store->id); + $writeOffsForecast = $service->getWeeklyProductsWriteoffsForecast($month, $year, $forecast, $store->id); $salesForecast = $service->getWeeklyBouquetProductsSalesForecast($month, $year, $store->id); $this->stdout("Рассчитана автопланограмма для магазина {$store->name}\n", BaseConsole::FG_GREEN); diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index 719e2121..95ca7a36 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -173,6 +173,7 @@ class AutoPlannogrammaController extends BaseController $model = Autoplannogramma::findOne($item['id']); if ($model !== null) { $model->modify = $item['value']; + $model->total = $item['value']; $model->auto_forecast = false; } } else { @@ -183,6 +184,7 @@ class AutoPlannogrammaController extends BaseController $model->month = $item['month'] ?? null; $model->week = $item['week'] ?? null; $model->modify = $item['value']; + $model->total = 0; $model->calculate = 0; $model->auto_forecast = false; } diff --git a/erp24/services/AutoPlannogrammaService.php b/erp24/services/AutoPlannogrammaService.php index 00084cd9..7c05a948 100644 --- a/erp24/services/AutoPlannogrammaService.php +++ b/erp24/services/AutoPlannogrammaService.php @@ -2937,7 +2937,7 @@ class AutoPlannogrammaService return $weeksProductForecast; }*/ - public function getWeeklyBouquetProductsForecast($month, $year, $storeId = null, $weekNumber = null) + public function getWeeklyBouquetProductsSalesForecast($month, $year, $storeId = null, $weekNumber = null) { $matrixGroups = ArrayHelper::map( MatrixBouquetForecast::find()->select(['group'])->distinct()->asArray()->all(), -- 2.39.5