From 25c980a80a87ad2d12eb1a6ab24f42bec6a78a0f Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Thu, 18 Apr 2024 14:26:50 +0300 Subject: [PATCH] =?utf8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?utf8?q?=D0=BE=20=D0=B0=D0=B2=D1=82=D0=BE=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7?= =?utf8?q?=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../modul/shipment/fields/sales_division_4weeks_cnt_avg.php | 4 ++-- erp24/modul/shipment/functionsShipment.php | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php b/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php index bfccf8d..1fbb25a 100644 --- a/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php +++ b/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php @@ -7,8 +7,8 @@ $data2=$db::getRows("SELECT i.product_id, s.store_id_1c as store_id,sum(CASE WHE FROM sales as s, sales_products as i WHERE s.id=i.check_id AND i.product_id $whereInProductsId -AND store_id $orderStoresArrayRelation_in -AND s.date<='$date_start_division 00:00:00' AND s.date>='$date_start_division' -interval '$day_sales day' group BY i.product_id, s.store_id "); +AND store_id_1c $orderStoresArrayRelation_in +AND s.date<='$date_start_division 00:00:00' AND s.date>=('$date_start_division'::date - '$day_sales day'::interval) group BY i.product_id, s.store_id_1c "); foreach($data2 as $row2) { $cnt=round(($row2["sale_cnt"]-$row2["vozvr_cnt"])/4); if(!empty($cnt)) { diff --git a/erp24/modul/shipment/functionsShipment.php b/erp24/modul/shipment/functionsShipment.php index 0e8a1fc..adbeef1 100644 --- a/erp24/modul/shipment/functionsShipment.php +++ b/erp24/modul/shipment/functionsShipment.php @@ -21,7 +21,10 @@ $ProductsOptions, $orderStoresArrayRelation, // массив с гуидами магазинов закупки по которым считаем статистику, $orderStoresArrayRelation_in // SQL условие для выборки по магазинам IN('store_id') , $productGroupArray // массив с ID подгруппы группы товаров для автозакупки Короткие розы -,$related_order_id; +,$related_order_id +,$date_start_division + +; -- 2.39.5