From: Aleksey Filippov Date: Thu, 18 Apr 2024 11:26:50 +0000 (+0300) Subject: правки по автозаказу X-Git-Tag: 1.1~135^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=25c980a80a87ad2d12eb1a6ab24f42bec6a78a0f;p=erp24_rep%2Fyii-erp24%2F.git правки по автозаказу --- 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 bfccf8dd..1fbb25ac 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 0e8a1fcd..adbeef16 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 + +;