From: Alexander Smirnov Date: Tue, 23 Apr 2024 14:39:55 +0000 (+0300) Subject: shipment bugfixment X-Git-Tag: 1.1~111^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=42797b73c67983f4223b3e0ffe07156f90e2ab9e;p=erp24_rep%2Fyii-erp24%2F.git shipment bugfixment --- diff --git a/erp24/modul/shipment/ajaxField.php b/erp24/modul/shipment/ajaxField.php index 14991f3e..66d215db 100644 --- a/erp24/modul/shipment/ajaxField.php +++ b/erp24/modul/shipment/ajaxField.php @@ -7,7 +7,7 @@ $product_id=htmlentities($_REQUEST["product_id"]); $store_id=htmlentities($_REQUEST["store_id"]); $name_eng=htmlentities($_REQUEST["name_eng"]); $value=htmlentities($_REQUEST["value"]); -$provider_id=intval($_REQUEST["provider_id"]); +//$provider_id=intval($_REQUEST["provider_id"]); $color=htmlentities($_REQUEST["color"]); @@ -19,7 +19,7 @@ $product_id=htmlentities($_REQUEST["product_id"]); $store_id=htmlentities($_REQUEST["store_id"]); $name_eng=htmlentities($_REQUEST["name_eng"]); $value=htmlentities($_REQUEST["value"]); -$provider_id=intval($_REQUEST["provider_id"]); +//$provider_id=intval($_REQUEST["provider_id"]); $color=htmlentities($_REQUEST["color"]); @@ -133,7 +133,6 @@ $value_old=$db::getValue("SELECT $pole FROM store_orders_fields_data WHERE produ AND store_id=? AND field_name=? AND field_id=? AND color=? LIMIT 1",[$product_id,$id,$store_id,$name_eng,$fieldId,$color]); $value_old=str_replace('.000','',$value_old); $sql="INSERT INTO store_orders_fields_data ($upFields) VALUES ($valuesFields) ON CONFLICT (order_id, product_id, store_id, field_id, field_name, color) DO UPDATE SET $pole='$value'"; - $db::sql($sql); //echo'сохранили '.$name_eng.' store_id='.$store_id.' '.$name_eng.' color='.$color.' value='.$value.' '; diff --git a/erp24/modul/shipment/functionsShipment.php b/erp24/modul/shipment/functionsShipment.php index 12efe819..0c6e7a05 100644 --- a/erp24/modul/shipment/functionsShipment.php +++ b/erp24/modul/shipment/functionsShipment.php @@ -524,7 +524,7 @@ $value=$FiledsData[$field_name][$productId][$storeId][$color] ?? 0; if($field_name=="color_percent") { //$tip="string"; //$value="p=$productId store= $storeId v=".$FiledsData[$field_name][$productId][$storeId][$color]; - $value=round($FiledsData[$field_name][$productId][$storeId][$color],2); + $value=round($FiledsData[$field_name][$productId][$storeId][$color] ?? 0,2); } @@ -604,8 +604,8 @@ global $dostup_fields,$bg_fields,$fieldsRows, $rowArraySum, $FiledsData; //print_r($dostup_fields); exit(); $fieldId=$fieldsRows[$fieldName]["id"]; - $dostup=$dostup_fields[$fieldId]; - $bg=$bg_fields[$fieldId]; + $dostup=$dostup_fields[$fieldId] ?? ''; + $bg=$bg_fields[$fieldId] ?? ''; // $dostup="edit"; diff --git a/erp24/modul/shipment/shipment.php b/erp24/modul/shipment/shipment.php index 443e2024..4017db68 100644 --- a/erp24/modul/shipment/shipment.php +++ b/erp24/modul/shipment/shipment.php @@ -263,7 +263,7 @@ $sql = "SELECT field_name, sum(value) as value,product_id FROM store_orders_fiel $data=$db::getRows($sql); foreach($data as $row) { $shipments_group_id=$ProductsOptions[$row["product_id"]]["shipments_group_id"]; - $data_field[$row["field_name"]][$shipments_group_id] +=$row["value"]; + $data_field[$row["field_name"]][$shipments_group_id] = ($data_field[$row["field_name"]][$shipments_group_id] ?? 0) + $row["value"]; }