From 28c06232b596feaf94d2bac3e3e9263d7dfe17a1 Mon Sep 17 00:00:00 2001 From: marina Date: Wed, 18 Jun 2025 17:53:10 +0300 Subject: [PATCH] =?utf8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/commands/CronController.php | 2 -- erp24/web/js/autoplannogramma/autoplannogramma.js | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index d3b91b49..70351a11 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1614,8 +1614,6 @@ class CronController extends Controller $week = $item['week']; $quantity = (float)($item['forecast_week_pieces'] ?? 0); - $this->stderr(implode("\n", $item), BaseConsole::FG_GREEN); - $details = []; $total = $quantity; diff --git a/erp24/web/js/autoplannogramma/autoplannogramma.js b/erp24/web/js/autoplannogramma/autoplannogramma.js index fa0cfa4d..79415357 100644 --- a/erp24/web/js/autoplannogramma/autoplannogramma.js +++ b/erp24/web/js/autoplannogramma/autoplannogramma.js @@ -388,7 +388,16 @@ function getMonthNumberByWeek(week, year) { return startMonth; } -const generateTitleString = (titleObj) => { +const safeParseJson = (str) => { + try { + return JSON.parse(str); + } catch { + return null; + } +}; + +const generateTitleString = (titleRaw) => { + const titleObj = typeof titleRaw === 'string' ? safeParseJson(titleRaw) : titleRaw; if (!titleObj || typeof titleObj !== 'object') return ''; const typeTitles = { -- 2.39.5