From: marina Date: Wed, 18 Jun 2025 07:38:59 +0000 (+0300) Subject: ERP-360 Сборка страницы автопм X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=a284ddf00f16e7679cfe603a99280b55a440b018;p=erp24_rep%2Fyii-erp24%2F.git ERP-360 Сборка страницы автопм --- diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 26184896..2424c57f 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1571,6 +1571,23 @@ class CronController extends Controller $month = $date->format('m'); $year = $date->format('Y'); + $service = new AutoPlannogrammaService(); + $writeOffsForecast = $service->getWeeklyProductsWriteoffsForecast($month, $year, 2); + $forecast = $service->getWeeklyBouquetProductsForecast($month, $year, 2); + + foreach ($forecast as $item) { + + $this->stdout('прогноз', BaseConsole::FG_GREEN); + $this->stdout(print_r($item, true), BaseConsole::FG_GREEN); + break; + } + + foreach ($writeOffsForecast as $item) { + $this->stdout('списание', BaseConsole::FG_GREEN); + $this->stdout(print_r($item, true), BaseConsole::FG_GREEN); + break; + } + $this->stdout("Начало расчетов автопланограммы для $planDate\n", BaseConsole::FG_GREEN); $service = new AutoPlannogrammaService(); @@ -1592,6 +1609,8 @@ class CronController extends Controller ]); $writeOffsForecast = $service->getWeeklyProductsWriteoffsForecast($month, $year, $store->id); + $forecast = $service->getWeeklyBouquetProductsForecast($month, $year, $store->id); + $this->stdout("Рассчитана автопланограмма для магазина {$store->name}\n", BaseConsole::FG_GREEN); } catch (\Throwable $e) { diff --git a/erp24/migrations/m250618_062332_alter_autoplannogramma_table.php b/erp24/migrations/m250618_062332_alter_autoplannogramma_table.php new file mode 100644 index 00000000..152dffb1 --- /dev/null +++ b/erp24/migrations/m250618_062332_alter_autoplannogramma_table.php @@ -0,0 +1,38 @@ +addColumn('autoplannogramma', 'calculate', $this->float()->comment('Суммарное расчетное значение')); + $this->addColumn('autoplannogramma', 'modify', $this->float()->comment('Значение проставленное закупщиком')); + $this->addColumn('autoplannogramma', 'total', $this->float()->comment('Расчетное значение продаж')); + $this->addColumn('autoplannogramma', 'details', $this->json()->comment('Детализация итоговой суммы')); + + $this->dropColumn('autoplannogramma', 'quantity_forecast'); + $this->dropColumn('autoplannogramma', 'quantity'); + $this->dropColumn('autoplannogramma', 'writeoffs_forecast'); + + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->addColumn('autoplannogramma', 'quantity_forecast', $this->float()->comment('Расчетное количество')); + $this->addColumn('autoplannogramma', 'quantity', $this->float()->comment('Измененное количество')); + $this->addColumn('autoplannogramma', 'writeoffs_forecast', $this->float()->comment('Прогноз списаний')); + + $this->dropColumn('autoplannogramma', 'details'); + $this->dropColumn('autoplannogramma', 'total'); + $this->dropColumn('autoplannogramma', 'modify'); + $this->dropColumn('autoplannogramma', 'calculate'); + } + +}