]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
shipment shipment fix 2
authorAlexander Smirnov <fredeom@mail.ru>
Tue, 23 Apr 2024 18:43:28 +0000 (21:43 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Tue, 23 Apr 2024 18:43:28 +0000 (21:43 +0300)
erp24/modul/shipment/ajaxField.php
erp24/modul/shipment/shipment.php

index 66d215db8e3c4098d1f4f27a496e5622ba52ffb1..648366d3e6751543704371c6b84d23f537e9873e 100644 (file)
@@ -126,8 +126,8 @@ if($name_eng=="quantity_zakup_new") {
  //$db::sql("DELETE FROM store_orders_fields_data WHERE product_id=? AND order_id=? AND store_id=? AND field_name=? AND field_id=? AND color=?",[$product_id,$id,$store_id,$name_eng,$fieldId,$color]);
  //echo"удаление пустой записи";
 
-$upFields = "product_id, order_id, store_id, field_name, field_id, color, date_update, hand, value, title";
-$valuesFields= "'$product_id', '$id', '$store_id', '$name_eng', '$fieldId', '$color', NOW(), 1, 0, 0";
+$upFields = "product_id, order_id, store_id, field_name, field_id, color, date_update, hand, $pole, title";
+$valuesFields= "'$product_id', '$id', '$store_id', '$name_eng', '$fieldId', '$color', NOW(), 1, '$value', 0";
 
 $value_old=$db::getValue("SELECT $pole FROM store_orders_fields_data WHERE product_id=? AND order_id=?
 AND store_id=? AND field_name=? AND field_id=? AND color=? LIMIT 1",[$product_id,$id,$store_id,$name_eng,$fieldId,$color]);
index 4017db6811953cb9aacd881cc8aa39e72567f70e..83c107801651c8326e70a60fadf8100917aefe20 100644 (file)
@@ -262,7 +262,7 @@ $sql = "SELECT field_name, sum(value) as value,product_id FROM store_orders_fiel
   AND order_id=". ($orderId ?? 0) . " AND color='' AND store_id!='' group by product_id,field_name";
 $data=$db::getRows($sql);
      foreach($data as $row) {
-            $shipments_group_id=$ProductsOptions[$row["product_id"]]["shipments_group_id"];
+            $shipments_group_id=$ProductsOptions[$row["product_id"]]["shipments_group_id"] ?? 0;
             $data_field[$row["field_name"]][$shipments_group_id] = ($data_field[$row["field_name"]][$shipments_group_id] ?? 0) + $row["value"];
    }  
 
@@ -279,7 +279,7 @@ $data=$db::getRows($sql);
    foreach($shipments_group_products as $shipments_group_id => $name) {
       if($data_field["sales_4weeks_cnt"][$shipments_group_id] ?? false) {
      echo"<tr><td>$name</td>";
-      foreach($field_stats_array as $fieldN)   echo"<td>".$data_field[$fieldN][$shipments_group_id]."</td>"; 
+      foreach($field_stats_array as $fieldN)   echo"<td>".($data_field[$fieldN][$shipments_group_id] ?? '')."</td>";
     echo"</tr>";
        }