Преглед на файлове

DHL官方-待设置墨西哥必须填写收件方税号才可发货

lvhao преди 2 месеца
родител
ревизия
8d018b901e

+ 8 - 0
core/CoreApp/controllers/Fullorderamz.php

@@ -41,6 +41,7 @@ class Fullorderamz extends Start_Controller {
 		$this->load->_model('Model_fullorderamzhb','fullorderamzhb');
 		$this->load->_model('Model_returngoods','returngoods');
 		$this->load->_model("Model_fullordererrors","fullordererrors");
+		$this->load->_model("Model_logic_order","logic_order");
 		
 	}
 	//定义方法的调用规则 获取URI第二段值
@@ -1194,6 +1195,13 @@ class Fullorderamz extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'此省/州不可使用 '.$expt['servicename'],'success'=>false));exit;
 			}
+
+
+			//减少代码复用吧
+			$lo_ret = $this->logic_order->checkEditExpress($post);
+			if($lo_ret['code'] != 1){
+				echo json_encode(array('msg'=>$lo_ret['msg'],'success'=>false));exit;
+			}
 			/**
 			if($warehouse['zd'] == '1' && $warehouse['ys'] != '1' && $thisdata['library'] == '2' && $post['fpdata'] != $thisdata['fpdata'])
 			{

+ 11 - 0
core/CoreApp/models/Model_dhl.php

@@ -285,6 +285,17 @@ function __construct(){
 			/** 发件人承担税费 e**/
 		}
 		
+		if(($data['country'] == 119) && !empty($data['r_tax_id'])){
+			$xml .= "<customerDetails>".$xmend;
+			$xml .= "<RegistrationNumbers>".$xmend;
+			$xml .= "<RegistrationNumber>".$xmend;
+			$xml .= '<Number>'.$data['r_tax_id'].'</Number>'.$xmend;
+			$xml .= '<NumberTypeCode>RFC</NumberTypeCode>'.$xmend;
+			$xml .= '<NumberIssuerCountryCode>MX</NumberIssuerCountryCode>'.$xmend;
+			$xml .= "</RegistrationNumber>".$xmend;
+			$xml .= "</RegistrationNumbers>".$xmend;
+			$xml .= "</customerDetails>".$xmend;
+		}
 		
 		if($data['bx'] > 0)
 		{

+ 15 - 0
core/CoreApp/models/Model_logic_order.php

@@ -171,6 +171,21 @@ class Model_logic_order extends Lin_Model {
                     "msg"=>"此快递方式必须选择Human Hair Wigs | Human Hair Goods | Human Hair Weave | Synthetic Hair | Synthetic Hair Wigs | Synthetic Hair Goods"
                 ];
             }
+            if($post['country'] == 119 ){
+                if(empty($post['r_tax_id'])){
+                    return [
+                        'code'=>-1,
+                        "msg"=>"DHL官方发往墨西哥必填收件人税号"
+                    ];
+                }
+                if($post['js'] == 6){
+                    return [
+                        'code'=>-1,
+                        "msg"=>"DHL官方发往墨西哥是收件人报税"
+                    ];
+                }
+
+            }
 
         }
 

+ 14 - 0
template/erp/fullorder_edit.html

@@ -664,6 +664,20 @@
 {/if}
 </li>
 
+<!-- DHL官方 如果是墨西哥或巴西 必须填写收件人的税号 -->
+{if ( in_array($fullorder['country'],[119 ]) && $fullorder['express'] == 1)}
+<li class = "r_tax_id " >
+	<em style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullorder['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{else}
+<li class = "r_tax_id none">
+	<em  style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullorder['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{/if}
+
+
 <!--
 <li class="lengththree">
 <em>延迟发货:</em>

+ 14 - 0
template/erp/fullorderamz_edit.html

@@ -589,6 +589,20 @@
 	{/if}
 {/if}
 </li>
+
+<!-- DHL官方 如果是墨西哥或巴西 必须填写收件人的税号 -->
+{if ( in_array($fullorderamz['country'],[119 ]) && $fullorderamz['express'] == 1)}
+<li class = "r_tax_id " >
+	<em style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullorderamz['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{else}
+<li class = "r_tax_id none">
+	<em  style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullorderamz['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{/if}
+
 <!--
 <li class="lengththree">
 <em>延迟发货:</em>

+ 12 - 1
template/erp/fullordersmt_edit.html

@@ -505,7 +505,18 @@
     {/if}
 {/if}
 </li>
-
+<!-- DHL官方 如果是墨西哥或巴西 必须填写收件人的税号 -->
+{if ( in_array($fullordersmt['country'],[119 ]) && $fullordersmt['express'] == 1)}
+<li class = "r_tax_id " >
+	<em style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullordersmt['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{else}
+<li class = "r_tax_id none">
+	<em  style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullordersmt['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{/if}
 
 </div>
 <!--

+ 12 - 0
template/erp/fullordertt_edit.html

@@ -579,6 +579,18 @@
 	{/if}
 {/if}
 </li>
+<!-- DHL官方 如果是墨西哥或巴西 必须填写收件人的税号 -->
+{if ( in_array($fullordertt['country'],[119 ]) && $fullordertt['express'] == 1)}
+<li class = "r_tax_id " >
+	<em style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullordertt['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{else}
+<li class = "r_tax_id none">
+	<em  style="width: 120px !important;">收件人税号填写:</em>
+	<input value="{$fullordertt['r_tax_id']}" name="r_tax_id" type="text">
+</li>
+{/if}
 <!--
 <li class="lengththree">
 <em>延迟发货:</em>

+ 20 - 1
template/erp/js/fullorder-addedit.js

@@ -597,6 +597,7 @@ $("#currency").change(function(){
 		$("select[name=productdescription]").html("");
 		$("input[name=customs]").val("0");
 		//express() 暂时固定运费为20USD 不在查找设置价格
+		dhl_r_tax_id();
 		printtype();
 		});
 	$("select[name='express']").change(function() {
@@ -627,6 +628,7 @@ $("#currency").change(function(){
 		$("select[name=productdescription]").html("");
 		$("input[name=customs]").val("0");
 		eqm($(this).find("option:selected").val());
+		dhl_r_tax_id()
 		//express() 暂时固定运费为20USD 不在查找设置价格
 		//printtype();暂时不用
 		var type = $(this).find("option:selected").data("type");
@@ -697,7 +699,24 @@ $("#currency").change(function(){
 					'<option  selected="selected" value="4">FICP</option><option value="3" hidden>IP</option>'
 				);
 			}	
-		
+
+			
+		}
+		//dhl 是 巴西或者墨西哥的时候需要怼收件人税号
+		function  dhl_r_tax_id(){
+			let express_id = $("select[name='express']").val();
+			let country = $("select[name='country']").val();
+			if((country == 119)){
+				if(express_id == 1){
+					$(".r_tax_id").removeClass('none')
+				}else{
+					$(".r_tax_id").addClass('none')
+				}
+				
+			}else{
+				$(".r_tax_id").addClass('none')
+				
+			}		
 		}
 	$("select[name='printtype']").change(function() {
 		$("select[name=productdescription]").html("");