From: Alexander Smirnov Date: Thu, 23 May 2024 11:50:23 +0000 (+0300) Subject: fix part 022 no products in provider X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=ad6d1e4d902d32af121e00e0752485184a7ac5fc;p=yii-erp24%2F.git fix part 022 no products in provider --- diff --git a/erp24/modul/shipment/fields/sales_4weeks_cnt.php b/erp24/modul/shipment/fields/sales_4weeks_cnt.php index 8f8b47a..d8daf8d 100644 --- a/erp24/modul/shipment/fields/sales_4weeks_cnt.php +++ b/erp24/modul/shipment/fields/sales_4weeks_cnt.php @@ -4,7 +4,7 @@ global $whereInProductsId, $orderStoresArrayRelation_in, $date_start_sale, $data $day_sales = 7 * 4; $data_up = []; -if (!empty($date_start_sale)) { +if (!empty($date_start_sale) && $whereInProductsId != " in ()") { $sql = "SELECT i.product_id, s.store_id_1c as store_id,sum(CASE WHEN s.operation='Продажа' THEN i.quantity ELSE 0 END) as sale_cnt, sum(CASE WHEN s.operation='Возврат' THEN i.quantity ELSE 0 END) as vozvr_cnt FROM sales as s, sales_products as i WHERE s.id=i.check_id AND i.product_id $whereInProductsId diff --git a/erp24/modul/shipment/fields/sales_amount.php b/erp24/modul/shipment/fields/sales_amount.php index b3cbc06..e74ecf0 100644 --- a/erp24/modul/shipment/fields/sales_amount.php +++ b/erp24/modul/shipment/fields/sales_amount.php @@ -20,7 +20,7 @@ foreach($productGroupArray as $group =>$pArray) { } } -if (!empty($date_start_sale)) { +if (!empty($date_start_sale) && $whereInProductsId != " in ()") { $sql = "SELECT i.product_id, s.store_id_1c as store_id,sum(CASE WHEN s.operation='Продажа' THEN i.summ ELSE 0 END) as sale_cnt, sum(CASE WHEN s.operation='Возврат' THEN i.summ ELSE 0 END) as vozvr_cnt FROM sales as s, sales_products as i WHERE s.id=i.check_id AND diff --git a/erp24/modul/shipment/fields/sales_cnt.php b/erp24/modul/shipment/fields/sales_cnt.php index 4c13b7c..4c9fd76 100644 --- a/erp24/modul/shipment/fields/sales_cnt.php +++ b/erp24/modul/shipment/fields/sales_cnt.php @@ -5,7 +5,7 @@ global $whereInProductsId, $orderStoresArrayRelation_in, $date_start_sale, $data $data_up = []; $day_sales = 7; -if (!empty($date_start_sale)) { +if (!empty($date_start_sale) && $whereInProductsId != " in ()") { $sql = "SELECT i.product_id, s.store_id_1c as store_id, sum(CASE WHEN s.operation='Продажа' THEN i.quantity ELSE 0 END) as sale_cnt, sum(CASE WHEN s.operation='Возврат' THEN i.quantity ELSE 0 END) as vozvr_cnt FROM sales as s, sales_products as i WHERE s.id=i.check_id AND i.product_id $whereInProductsId diff --git a/erp24/modul/shipment/fields/write_downs.php b/erp24/modul/shipment/fields/write_downs.php index 04481e3..122f8fa 100644 --- a/erp24/modul/shipment/fields/write_downs.php +++ b/erp24/modul/shipment/fields/write_downs.php @@ -4,7 +4,7 @@ global $orderStoresArrayRelation_in, $whereInProductsId, $date_start_sale, $data //списания за 7 дней- недельное списание от даты старта / 4 = среднее за неделю $periodDaysStats = 7; -if(!empty($orderStoresArrayRelation_in) && !empty($date_start_sale)) { +if(!empty($orderStoresArrayRelation_in) && !empty($date_start_sale) && $whereInProductsId != " in ()") { $sql = "SELECT p.product_id,sum(p.quantity) as cnt, w.store_id FROM write_offs as w, write_offs_products as p WHERE p.write_offs_id=w.id AND w.type='Брак' diff --git a/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php b/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php index 7cef63d..0977540 100644 --- a/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php +++ b/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php @@ -4,7 +4,7 @@ global $orderStoresArrayRelation_in, $whereInProductsId, $date_start_sale, $data //списания за 4 недели среднее - 4-х недельное списание от даты старта / 4 = среднее за неделю $periodDaysStats=28; -if(!empty($orderStoresArrayRelation_in) && !empty($date_start_sale)) { +if(!empty($orderStoresArrayRelation_in) && !empty($date_start_sale) && $whereInProductsId != " in ()") { $sql = "SELECT p.product_id,sum(p.quantity) as cnt, w.store_id FROM write_offs as w, write_offs_products as p WHERE p.write_offs_id=w.id diff --git a/erp24/modul/shipment/fields/write_offs_4week_sum.php b/erp24/modul/shipment/fields/write_offs_4week_sum.php index fdc063c..f006a97 100644 --- a/erp24/modul/shipment/fields/write_offs_4week_sum.php +++ b/erp24/modul/shipment/fields/write_offs_4week_sum.php @@ -4,7 +4,7 @@ global $orderStoresArrayRelation_in, $whereInProductsId, $date_start_sale; //списания за 4 недели среднее - 4-х недельное списание от даты старта / 4 = среднее за неделю в рублях $periodDaysStats = 28; -if(!empty($orderStoresArrayRelation_in) && !empty($date_start_sale)) { +if(!empty($orderStoresArrayRelation_in) && !empty($date_start_sale) && $whereInProductsId != " in ()") { $sql = "SELECT p.product_id,p.summ, w.store_id FROM write_offs as w, write_offs_products as p WHERE p.write_offs_id=w.id AND w.type='Брак'