From: marina Date: Wed, 18 Jun 2025 13:32:10 +0000 (+0300) Subject: ERP-360 Сборка страницы автопм X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=dca97ee0b0dae391c4b171e1951c0d6a2c323d44;p=erp24_rep%2Fyii-erp24%2F.git ERP-360 Сборка страницы автопм --- 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(),