]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавление $auto_forecast
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 4 Jul 2025 08:35:54 +0000 (11:35 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 4 Jul 2025 08:35:54 +0000 (11:35 +0300)
erp24/commands/CronController.php
erp24/controllers/CategoryPlanController.php
erp24/web/js/category-plan/index.js

index 70ffee7c38523b8f340552da56d485bc9762ba2d..22f012bb5bb49c43bc7ce22aa6e2a6ee88f052b7 100644 (file)
@@ -1713,6 +1713,7 @@ class CronController extends Controller
                             'product_id' => $productId,
                             'store_id' => $store->id,
                             'is_archive' => false,
+                            'auto_forecast' => true,
                             'capacity_type' => 1,
                             'details' => json_encode($details, JSON_UNESCAPED_UNICODE),
                             'calculate' => $quantity,
index 275fcf753c6b6cfa1b392c3b879922aeb04d08ef..fe18bf8194524af4db74da62d24d18af78f0d0ff 100644 (file)
@@ -263,6 +263,7 @@ class CategoryPlanController extends Controller {
                                 'month'     => $model->month,
                                 'storeId'   => $model->store_id,
                                 'status'    => 'pending',
+                                'info'      => 'auto',
                                 'startTime' => date('Y-m-d H:i:s'),
                                 'progress'  => 0,
                                 'error'     => null
@@ -275,6 +276,7 @@ class CategoryPlanController extends Controller {
                             $log->context = json_encode($cacheValue, JSON_UNESCAPED_UNICODE);
                             $log->year = (int)$cacheValue['year'];
                             $log->month = (int)$cacheValue['month'];
+                            $log->info = $cacheValue['info'];
                             $log->active = 1;
                             $log->progress = 0;
                             $log->status = 1;
@@ -606,6 +608,8 @@ class CategoryPlanController extends Controller {
         $year  = (int)Yii::$app->request->get('year');
         $month = (int)Yii::$app->request->get('month');
         $store = (int)Yii::$app->request->get('store_id');
+        $changes = (int)Yii::$app->request->get('changes');
+        var_dump($year, $month, $store, $changes); die();
         $taskName = "taskApRecalculate";
         $scriptLauncherLog = ScriptLauncherLog::find()
             ->andWhere(['name' => $taskName])
@@ -621,6 +625,7 @@ class CategoryPlanController extends Controller {
                 'year'      => $year,
                 'month'     => $month,
                 'storeId'   => $store,
+                'info'      => 'corrected',
                 'status'    => 'pending',
                 'startTime' => date('Y-m-d H:i:s'),
                 'progress'  => 0,
@@ -631,6 +636,7 @@ class CategoryPlanController extends Controller {
             $log->category = 'autoplannogramma';
             $log->prefix = 'actionAutoplannogrammaRecalculate';
             $log->name = $taskName;
+            $log->info = $cacheValue['info'];
             $log->context = json_encode($cacheValue, JSON_UNESCAPED_UNICODE);
             $log->year = (int)$cacheValue['year'];
             $log->month = (int)$cacheValue['month'];
index a613d1161e34ef3b4adc310f4fff53408acfe70c..be55dbdee330d3e26fee048922ff9b60d1ae63e6 100644 (file)
@@ -222,6 +222,7 @@ $(document).ready(() => {
                 year: $('#dynamicmodel-year').val(),
                 month: $('#dynamicmodel-month').val(),
                 store_id: store_id,
+                changes: localStorage.getItem('planChanges'),
                 [param26]:      token26
             },
             success: function (data) {