]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Убираем актуальность из расчета
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 20 Aug 2025 09:57:30 +0000 (12:57 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 20 Aug 2025 09:57:30 +0000 (12:57 +0300)
erp24/services/StorePlanService.php

index 76d285a3a4e522fdf951fcb332c849ac5977c1e7..b46e11105ef41c2c52d37157aeb335e3fe5d4bdd 100755 (executable)
@@ -418,36 +418,7 @@ class StorePlanService
         $productsWithHistory    = [];
         $productsWithoutHistory = [];
 
-        $guids = array_keys($salesHistory);
-        $actualities = Products1cNomenclatureActuality::find()
-            ->where(['guid' => $guids, 'active' => 1])
-            ->indexBy('guid')
-            ->all();
-
         foreach ($salesHistory as $guid => $info) {
-            if (!isset($actualities[$guid])) {
-                continue;
-            }
-            $act   = $actualities[$guid];
-            $actFrom = new \DateTime($act->date_from);
-            $actTo   = $act->date_to
-                ? new \DateTime($act->date_to)
-                : (new \DateTime())->modify('+1 years');
-
-            $isInsideActivity = true;
-            foreach ($periods as $periodKey => $periodData) {
-                $pStart = \DateTime::createFromFormat('Y-m', $periodKey);
-                $pStart->modify('first day of this month')->setTime(0, 0, 0);
-                $pEnd = (clone $pStart)->modify('last day of this month')->setTime(23, 59, 59);
-
-                if ($pStart < $actFrom || $pEnd > $actTo) {
-                    $isInsideActivity = false;
-                    break;
-                }
-            }
-            if (!$isInsideActivity) {
-                continue;
-            }
             $monthsData    = $info['data'];
             $metaFields    = [
                 'store_id' => $info['store_id'],