From 9f315bec84d9052153cc7a0d0514bb2858494807 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Mon, 20 May 2024 17:32:51 +0300 Subject: [PATCH] fix part 002 --- erp24/modul/shipment/fields/quantity_fact.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/erp24/modul/shipment/fields/quantity_fact.php b/erp24/modul/shipment/fields/quantity_fact.php index acd21eac..5b8bafbd 100644 --- a/erp24/modul/shipment/fields/quantity_fact.php +++ b/erp24/modul/shipment/fields/quantity_fact.php @@ -1,11 +1,17 @@ -0 +if ($whereInProductsId != " in ()") { + $store_products_fact = $db::getRows("SELECT product_id,quantity, store_id,color FROM store_products_fact WHERE quantity>0 AND date_id=? AND store_id $orderStoresArrayRelation_in -AND product_id $whereInProductsId",[$date_id]); -foreach($store_products_fact as $row) { - $data_up[$row["product_id"]][$row["store_id"]][$row["color"]] +=$row["quantity"]; - $data_up[$row["product_id"]][0][$row["color"]] +=$row["quantity"]; +AND product_id $whereInProductsId", [$date_id]); + + foreach ($store_products_fact as $row) { + $data_up[$row["product_id"]][$row["store_id"]][$row["color"]] = ($data_up[$row["product_id"]][$row["store_id"]][$row["color"]] ?? 0) + $row["quantity"]; + $data_up[$row["product_id"]][0][$row["color"]] = ($data_up[$row["product_id"]][0][$row["color"]] ?? 0) + $row["quantity"]; + } } \ No newline at end of file -- 2.39.5