From: Alexander Smirnov Date: Mon, 20 May 2024 14:32:51 +0000 (+0300) Subject: fix part 002 X-Git-Tag: 1.1~18^2~21 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=9f315bec84d9052153cc7a0d0514bb2858494807;p=erp24_rep%2Fyii-erp24%2F.git fix part 002 --- 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