From: Vladimir Fomichev Date: Fri, 4 Jul 2025 08:35:54 +0000 (+0300) Subject: Добавление $auto_forecast X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=9981ee6b42d78f8c6f86571f604b9117d5617fc6;p=erp24_rep%2Fyii-erp24%2F.git Добавление $auto_forecast --- diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 70ffee7c..22f012bb 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -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, diff --git a/erp24/controllers/CategoryPlanController.php b/erp24/controllers/CategoryPlanController.php index 275fcf75..fe18bf81 100644 --- a/erp24/controllers/CategoryPlanController.php +++ b/erp24/controllers/CategoryPlanController.php @@ -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']; diff --git a/erp24/web/js/category-plan/index.js b/erp24/web/js/category-plan/index.js index a613d116..be55dbde 100644 --- a/erp24/web/js/category-plan/index.js +++ b/erp24/web/js/category-plan/index.js @@ -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) {