]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-360 Сборка страницы автопм
authormarina <m.zozirova@gmail.com>
Wed, 18 Jun 2025 13:32:10 +0000 (16:32 +0300)
committermarina <m.zozirova@gmail.com>
Wed, 18 Jun 2025 13:32:10 +0000 (16:32 +0300)
erp24/commands/CronController.php
erp24/controllers/AutoPlannogrammaController.php
erp24/services/AutoPlannogrammaService.php

index 2330ba88620a3e52f303a6e05a1f958d28f6c204..d3b91b498a8185f52e09b17c06dc17e1b89ce60e 100644 (file)
@@ -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);
index 719e2121cfb5fe022bbba90cdc5c6c7f5ff9ca34..95ca7a364ecd99f3209e702bcc94299d2044a04c 100644 (file)
@@ -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;
             }
index 00084cd971a95f24598a0af7bbbb9e703908a9ab..7c05a948fa5efd9d99eab93369015521775f7cf5 100644 (file)
@@ -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(),