From 12c79cba52952368f15b81bf7ba55a4052f09fa8 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Wed, 11 Jun 2025 13:02:42 +0300 Subject: [PATCH] =?utf8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/AutoPlannogrammaService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erp24/services/AutoPlannogrammaService.php b/erp24/services/AutoPlannogrammaService.php index d0ef4f9d..ecdff13b 100644 --- a/erp24/services/AutoPlannogrammaService.php +++ b/erp24/services/AutoPlannogrammaService.php @@ -29,7 +29,7 @@ class AutoPlannogrammaService public const TYPE_WRITE_OFFS = 'writeOffs'; // Тип операции: списания private const CATEGORY_LOOKBACK_MONTHS = 3; // Период для анализа категорий (месяцы) private const LOOKBACK_MONTHS = 2; // Отступаемый шаг от плановой даты перед расчетами - + //private const HELIUM_GUID = '2b72702a-792f-11e8-9edd-1c6f659fb563'; /** * Получение списка видимых магазинов @@ -1977,6 +1977,7 @@ class AutoPlannogrammaService */ public function getProductsComponentsInCategory(int $storeId, string $month, string $year, string $type = self::TYPE_SALES): array { + $heliumConstant = __CLASS__ . '::HELIUM_GUID'; $storeParams = CityStoreParams::find() ->where(['store_id' => $storeId]) ->one(); @@ -2126,7 +2127,7 @@ class AutoPlannogrammaService $price = 0; $dailyPrices = []; foreach ($pricesByProduct[$productId] ?? [] as $priceRecordForProduct) { - if (isset(self::HELIUM_GUID) && $productId == self::HELIUM_GUID) { + if (defined($heliumConstant) && $productId == constant($heliumConstant)) { $saleDay = (new \DateTime($componentDataRecord['sale_date']))->format('Y-m-d'); $fromDay = (new \DateTime($priceRecordForProduct->date_from))->modify('-1 day')->format('Y-m-d'); $toDay = (new \DateTime($priceRecordForProduct->date_to ))->modify('+1 day')->format('Y-m-d'); -- 2.39.5