]> gitweb.erp-flowers.ru Git - yii-erp24/.git/commitdiff
shipment bugfixment
authorAlexander Smirnov <fredeom@mail.ru>
Tue, 23 Apr 2024 14:39:55 +0000 (17:39 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Tue, 23 Apr 2024 14:39:55 +0000 (17:39 +0300)
erp24/modul/shipment/ajaxField.php
erp24/modul/shipment/functionsShipment.php
erp24/modul/shipment/shipment.php

index 14991f3e10927ab240d0a70548a400a8a1523d2b..66d215db8e3c4098d1f4f27a496e5622ba52ffb1 100644 (file)
@@ -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.'  ';
   
index 12efe8195fcf84f7300fc5ce4b8c05fd693af5e4..0c6e7a0510ea7171e3e8203bb3604d9980749a8c 100644 (file)
@@ -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"; 
        
 
index 443e20243968daa480c06f8d15e819c941358c67..4017db6811953cb9aacd881cc8aa39e72567f70e 100644 (file)
@@ -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"];
    }