]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
fix part 022 no products in provider
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 23 May 2024 11:50:23 +0000 (14:50 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 23 May 2024 11:50:23 +0000 (14:50 +0300)
erp24/modul/shipment/fields/sales_4weeks_cnt.php
erp24/modul/shipment/fields/sales_amount.php
erp24/modul/shipment/fields/sales_cnt.php
erp24/modul/shipment/fields/write_downs.php
erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php
erp24/modul/shipment/fields/write_offs_4week_sum.php

index 8f8b47a07342c9c4be3fcac557fe4f21a9bd5d4c..d8daf8dfae47fab4164ea5572aa443c454576ad6 100644 (file)
@@ -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
index b3cbc06a3bdcbf43729ecb9889c0ee9c0e85a59d..e74ecf05640a20dde48380a256ffd294394dad61 100644 (file)
@@ -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  
index 4c13b7c07e062de5d28d8ea4a705f32a6289a102..4c9fd76096bad534a6a3af888e6b1126bccbea4e 100644 (file)
@@ -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
index 04481e3783856d5d11b9d6f50e42d79d008db3c7..122f8fa21e54972ae6a9e35af78731cb7bca61d9 100644 (file)
@@ -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='Брак' 
index 7cef63d20d1aa8c88a9b45c904eb49dd88a82d81..0977540b245eba60adeb14df774f88289e42d1cd 100644 (file)
@@ -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  
index fdc063ca88f75b53c33ce3e24c450e2b2571d4e3..f006a972d72c868570f9858d28cc0737ae6dc18d 100644 (file)
@@ -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='Брак'