ShuanghongS 2 ماه پیش
والد
کامیت
03823766d1
1فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 9 4
      utils/common.class.php

+ 9 - 4
utils/common.class.php

@@ -4096,7 +4096,11 @@ class common {
                 $total_weight += $_ctnr_info['grs_kgs'];
                 $total_volume += $_ctnr_info['cbm'];
                 $detail_row_count +=1;
-            }      
+            } 
+             
+            $total_pcs = empty($total_pcs) ? "null" : "'".$total_pcs."'";
+            $total_weight = empty($total_weight) ? "null" : "'".$total_weight."'";
+            $total_volume = empty($total_volume) ? "null" : "'".$total_volume."'";
 
             $do_serial_no = common::uuid();
             $sql .="INSERT INTO public.do_header(
@@ -4111,7 +4115,7 @@ class common {
                 consignee, consignee_name, consignee_exp,delivery_to_address_sync_key)
             VALUES ('".$do_serial_no."','".$detail_row_count."','Ocean', '".$oceanInfo['agent']."','".$biztype."','Awaiting Confirmation','".$mode_type."',
                 '".$serial_no."','".$oceanInfo['m_bol']."','".$oceanInfo['h_bol']."','".$oceanInfo['job_no']."',now(),
-                '".$total_pcs."','".$total_pcs_unit."','".$total_weight."','".$total_weight_unit."','".$total_volume."','".$total_volume_unit."',
+                ".$total_pcs.",'".$total_pcs_unit."',".$total_weight.",'".$total_weight_unit."',".$total_volume.",'".$total_volume_unit."',
                 '".$delivery_booking['_delivery_date']."','".$delivery_booking['_delivery_time']."',
                 '".$delivery_booking['special_requirements']."',
                 'KLN_Online',now(),'Subcontractor','Diesel','".$consignee."','".$consignee_name."','".$consignee_exp."','".$consignee_sync_key."');"; 
@@ -4124,15 +4128,16 @@ class common {
                 $l4_width = empty($ctnr['l4_width']) ? "null" : "'".$ctnr['l4_width']."'";
                 $l4_height = empty($ctnr['l4_height']) ? "null" : "'".$ctnr['l4_height']."'";
 
+                $serial_no_sync_key = common::uuid();
                 $sql .="INSERT INTO public.do_detail(
                     do_serial_no, pcs, pcs_unit, weight, weight_unit, volume, 
                     marks, description, create_user, create_time, 
                     ctnr, size, seal_no, is_lcl,
-                    length,width,height)
+                    length,width,height,serial_no_sync_key)
                 VALUES ('".$do_serial_no."',$qty, '".$ctnr['unit']."',$grs_kgs,'KGS',$cbm,
                     '".$ctnr['marks']."','".$ctnr['description']."','KLN_Online',now(),
                     '".$ctnr['ctnr']."','".$ctnr['size']."','".$ctnr['seal_no']."','".$ctnr['is_lcl']."',
-                    $l4_length,$l4_width,$l4_height);";
+                    $l4_length,$l4_width,$l4_height,'$serial_no_sync_key');";
             }
             $db->Execute($sql) or ( (!$db->ErrorMsg()) or error_log(common::dbLog($db, $sql), 0)); 
         }