From: marina Date: Tue, 1 Jul 2025 13:34:25 +0000 (+0300) Subject: ERP-433 Отчет по остаткам букетов для МП и причинам, если логика не проходит. Возможн... X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b9807b4c4cf83fdf55d9ce65d0784779ddf68fa7;p=erp24_rep%2Fyii-erp24%2F.git ERP-433 Отчет по остаткам букетов для МП и причинам, если логика не проходит. Возможность ручной выгрузки из ERP в Excel --- diff --git a/erp24/actions/marketplace/ReportAction.php b/erp24/actions/marketplace/ReportAction.php index 1ae811e7..7e9ffd98 100644 --- a/erp24/actions/marketplace/ReportAction.php +++ b/erp24/actions/marketplace/ReportAction.php @@ -26,6 +26,7 @@ class ReportAction extends Action $productsRaw = Products1c::find() ->where(['in', 'parent_id', $subQuery]) + ->limit(10) ->all(); $marketplaceService = new MarketplaceService(); @@ -33,7 +34,7 @@ class ReportAction extends Action $products = []; foreach ($productsRaw as $product) { - $check = $marketplaceService->checkProducts($product); + $check = $marketplaceService->checkProducts($product, true); $products[] = [ 'id' => $product->id, 'name' => $product->name, @@ -42,7 +43,6 @@ class ReportAction extends Action ]; } - $dataProvider = new ArrayDataProvider([ 'allModels' => $products, 'pagination' => ['pageSize' => 20], diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index a7d5b795..e309da99 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -473,21 +473,26 @@ class MarketplaceService return $result; } - - public function checkProducts($product): array|false { + + public function checkProducts($product, $isView = false): array|false + { $properties = MarketplaceService::getProductPropertiesByGuid($product->id); if (!$properties) { - $message = "Товар с GUID {$product->id} не имеет свойств в MatrixErpProperty и был исключен из фида."; - Yii::error($message, __METHOD__); - InfoLogService::setInfoLog(__FILE__, __LINE__, $message, 'Missing properties error'); + if ($isView) { + $message = "Товар с GUID {$product->id} не имеет свойств в MatrixErpProperty и был исключен из фида."; + Yii::error($message, __METHOD__); + InfoLogService::setInfoLog(__FILE__, __LINE__, $message, 'Missing properties error'); + } return false; } $price = MarketplaceService::getProductPrice($product->id); if ($price == 0) { - $message = "У товара {$product->id} отсутствует цена и он будет исключен из фида."; - Yii::error($message, __METHOD__); - InfoLogService::setInfoLog(__FILE__, __LINE__, $message, 'Zero price error'); + if ($isView) { + $message = "У товара {$product->id} отсутствует цена и он будет исключен из фида."; + Yii::error($message, __METHOD__); + InfoLogService::setInfoLog(__FILE__, __LINE__, $message, 'Zero price error'); + } return false; }