]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Удаление автоплана при перерасчете
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 12 Sep 2025 13:04:36 +0000 (16:04 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 12 Sep 2025 13:04:36 +0000 (16:04 +0300)
erp24/commands/CronController.php

index 5a9678f7f28b006d762e33e37414f2c4194e3a95..b8a506e404f58eb5d621c2fc4a10fa515d6f7212 100644 (file)
@@ -1668,7 +1668,7 @@ class CronController extends Controller
         $planDate = $date->format('Y-m-01');
         $month = (int)$date->format('m');
         $year = (int)$date->format('Y');
-
+        Autoplannogramma::deleteAll(['month' =>  $month , 'year' => $year]);
         $service = new AutoPlannogrammaService();
         $stores = CityStore::find()->where(['visible' => CityStore::IS_VISIBLE])->all();
         $categories = Products1cNomenclature::find()->select('category')->distinct()->andWhere(['not in', 'category', ['', 'букет', 'сборка', 'сервис']])->column();
@@ -1860,7 +1860,7 @@ class CronController extends Controller
                 LogService::apiErrorLog(json_encode(["error_id" => 8, "error" => $scriptLauncherLog->getErrors()], JSON_UNESCAPED_UNICODE));
             }
 
-
+            Autoplannogramma::deleteAll(['store_id' => (int)$task['storeId'], 'month' => (int)$task['month'], 'year' => (int)$task['year']]);
             $service = new AutoPlannogrammaService();
             $year = (int)$task['year'];
             $month = (int)$task['month'];