]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Рефактор
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 11 Jun 2025 10:02:42 +0000 (13:02 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 11 Jun 2025 10:02:42 +0000 (13:02 +0300)
erp24/services/AutoPlannogrammaService.php

index d0ef4f9d9943759b10a785ab62ddc195fe43f9fb..ecdff13bcdfef8643cda81f4b23533164a346efa 100644 (file)
@@ -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');