From a284ddf00f16e7679cfe603a99280b55a440b018 Mon Sep 17 00:00:00 2001 From: marina Date: Wed, 18 Jun 2025 10:38:59 +0300 Subject: [PATCH] =?utf8?q?ERP-360=20=D0=A1=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= =?utf8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=B0?= =?utf8?q?=D0=B2=D1=82=D0=BE=D0=BF=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/commands/CronController.php | 19 ++++++++++ ...18_062332_alter_autoplannogramma_table.php | 38 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 erp24/migrations/m250618_062332_alter_autoplannogramma_table.php 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'); + } + +} -- 2.39.5