From: Aleksey Filippov Date: Mon, 22 Apr 2024 09:15:41 +0000 (+0300) Subject: правки по автозаказу фактические остатки X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=5faaf50a53aa7142db53bb356556430d8c7a107e;p=yii-erp24%2F.git правки по автозаказу фактические остатки --- diff --git a/erp24/modul/shipment/storeProductsFact.php b/erp24/modul/shipment/storeProductsFact.php index e727097..fc5d956 100644 --- a/erp24/modul/shipment/storeProductsFact.php +++ b/erp24/modul/shipment/storeProductsFact.php @@ -375,7 +375,7 @@ if(!in_array($row["category_id"],$category_idIn) and !empty($products_group[$row if(($store_planogram[$row["id"]] ?? 0)>0 or $_SESSION["show_planogram_0"]==1) { $difference=($store_planogram[$row["id"]] ?? 0)-($values_in[$row["id"]]["quantity"] ?? 0); if(!empty($store_planogram[$row["id"]])) $difference_percent=100-round(100*$difference/$store_planogram[$row["id"]]); -else $difference_percent=""; +else $difference_percent=0; echo"'.$difference.' '.$difference_percent.''; diff --git a/erp24/modul/shipment/storeProductsFactEdit.php b/erp24/modul/shipment/storeProductsFactEdit.php index 72da4f7..47f593a 100644 --- a/erp24/modul/shipment/storeProductsFactEdit.php +++ b/erp24/modul/shipment/storeProductsFactEdit.php @@ -15,7 +15,7 @@ echo"Сохранили количество =$quantity" . " $product_id,$color, if($color!="NULL") $color=str_replace('"','',$color); else $color=''; -$sql = "INSERT INTO store_products_fact (store_id, product_id, date_id, color, quantity) VALUES ('$store_id','$product_id','$date_id','$color','$quantity')" +$sql = "INSERT INTO store_products_fact (store_id, product_id, date_id, color, quantity, quantity_polnogramm, difference, difference_percent) VALUES ('$store_id','$product_id','$date_id','$color','$quantity', 0, 0, 0)" . " ON CONFLICT(date_id, product_id, color, store_id) DO UPDATE SET quantity=$quantity"; //echo"

++$color++$sql"; $db::sql($sql);