From f061fb77088edc23d9c475a37c64161b7a2d738c Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Wed, 20 Aug 2025 12:57:30 +0300 Subject: [PATCH] =?utf8?q?=D0=A3=D0=B1=D0=B8=D1=80=D0=B0=D0=B5=D0=BC=20?= =?utf8?q?=D0=B0=D0=BA=D1=82=D1=83=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D1=81?= =?utf8?q?=D1=82=D1=8C=20=D0=B8=D0=B7=20=D1=80=D0=B0=D1=81=D1=87=D0=B5?= =?utf8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/StorePlanService.php | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/erp24/services/StorePlanService.php b/erp24/services/StorePlanService.php index 76d285a3..b46e1110 100755 --- a/erp24/services/StorePlanService.php +++ b/erp24/services/StorePlanService.php @@ -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'], -- 2.39.5