From: fomichev Date: Fri, 30 May 2025 11:43:13 +0000 (+0300) Subject: Правки по товарам без истории X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=2f149fa33bc2b016f9849438ad8e2aeda0cfefe2;p=erp24_rep%2Fyii-erp24%2F.git Правки по товарам без истории --- diff --git a/erp24/services/AutoPlannogrammaService.php b/erp24/services/AutoPlannogrammaService.php index 8a9dd24d..a84b3ef5 100644 --- a/erp24/services/AutoPlannogrammaService.php +++ b/erp24/services/AutoPlannogrammaService.php @@ -928,7 +928,7 @@ class AutoPlannogrammaService { $region = CityStoreParams::find() ->where(['store_id' => $storeId]) - ->one()->address_region; + ->one()->address_region ?? null; if (!$region) { $cityId = CityStore::find()->select('city_id')->where(['id' => $storeId])->scalar(); diff --git a/erp24/services/StorePlanService.php b/erp24/services/StorePlanService.php index c732738d..20d954b5 100755 --- a/erp24/services/StorePlanService.php +++ b/erp24/services/StorePlanService.php @@ -345,9 +345,12 @@ class StorePlanService ]) ->innerJoin('sales_products sp', 's.id = sp.check_id') ->innerJoin('products_1c_nomenclature p1c', 'p1c.id = sp.product_id') + ->leftJoin('products_1c p1', 'p1.id = sp.product_id') ->where(['s.store_id' => $storeId]) ->andWhere(['between', 's.date', $dateStart, $dateEnd]) ->andWhere(['order_id' => ['', '0']]) + ->andWhere(['p1.components' => '']) + ->andWhere(['not in', 'p1c.category', ['', 'букет', 'сборка', 'сервис']]) ->andFilterWhere(['p1c.category' => $category]) ->andFilterWhere(['p1c.subcategory' => $subcategory]) ->andFilterWhere(['p1c.species' => $species])