From: Vladimir Fomichev Date: Wed, 11 Jun 2025 10:02:42 +0000 (+0300) Subject: Рефактор X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=12c79cba52952368f15b81bf7ba55a4052f09fa8;p=erp24_rep%2Fyii-erp24%2F.git Рефактор --- 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');