wuggemail@foxmail.com 4 ヶ月 前
コミット
ef4bfdfe65
1 ファイル変更33 行追加0 行削除
  1. 33 0
      app/admin/controller/Goodup.php

+ 33 - 0
app/admin/controller/Goodup.php

@@ -613,6 +613,13 @@ class Goodup extends Base
                     if($cgd_tax==='') return error_show(1004,'源头供应商开票税率不能为空');
                 }
 			}
+            $is_syscn_tax = isset($this->post['is_syscn_tax'])&&$this->post['is_syscn_tax']!==""? intval($this->post['is_syscn_tax']):"0";
+            $out_tax_id = isset($this->post['out_tax_id'])&&$this->post['out_tax_id']!==""? intval($this->post['out_tax_id']):"0";
+            $out_tax = isset($this->post['out_tax'])&&$this->post['out_tax']!==""? floatval($this->post['out_tax']):"";
+            if($is_syscn_tax==1){
+                $out_tax_id = $tax_id;
+                $out_tax = $tax;
+            }
         $createrid= $this->uid;
         $creater= $this->uname;
         $spucode=makeNo("SKU");
@@ -688,6 +695,7 @@ class Goodup extends Base
                 "other_config"=>$other_config,
                 "field_change"=>'',
                 "is_step" => count($good_ladder) > 1 ? 1 : 0,//如果阶梯价个数大于1,说明启用阶梯价
+                'is_syscn_tax'=>$is_syscn_tax,
                 "is_online"=>0,
                 "stock_moq"=>$stock_moq,
                 'open_type'=>$open_type,
@@ -790,7 +798,10 @@ class Goodup extends Base
 				        'tax_id'=>$tax_id,
 				        'inv_good_name'=>$inv_good_name,
 				        "cgd_tax_id"=>$cgd_tax_id,
+                        'out_tax_id'=>$out_tax_id,
+                        'out_tax'=>$out_tax,
 				        "cgd_tax"=>$cgd_tax,
+                        "status"=> $is_syscn_tax==1?2 :1,
 				        'tax'=>$tax,
 				        "creater"=>$creater,
 				        "createrid"=>$createrid,
@@ -999,6 +1010,13 @@ class Goodup extends Base
                 if($cgd_tax==='') return error_show(1004,'源头供应商开票税率不能为空');
             }
         }
+        $is_syscn_tax = isset($this->post['is_syscn_tax'])&&$this->post['is_syscn_tax']!==""? intval($this->post['is_syscn_tax']):"0";
+        $out_tax_id = isset($this->post['out_tax_id'])&&$this->post['out_tax_id']!==""? intval($this->post['out_tax_id']):"0";
+        $out_tax = isset($this->post['out_tax'])&&$this->post['out_tax']!==""? floatval($this->post['out_tax']):"";
+        if($is_syscn_tax==1){
+            $out_tax_id = $tax_id;
+            $out_tax = $tax;
+        }
         if($isCombind==1){
 			if(empty($combindList)) return error_show(1004,'组合商品子商品信息不能为空');
 			$dchild=[];
@@ -1029,6 +1047,7 @@ class Goodup extends Base
                 "moq"=>$moq,
                 "is_exclusive"=>$is_exclusive,
                 "customized"=>$customized,
+                'is_syscn_tax'=>$is_syscn_tax,
                 "tax"=>$tax,
                 "supplierNo"=>$supplierNo,
                 "is_auth"=>$is_auth,
@@ -1119,6 +1138,9 @@ class Goodup extends Base
 			    $taxInfo->companyNo = $company_id;
 			    $taxInfo->open_type = $open_type;
 			    $taxInfo->tax_id = $tax_id;
+                $taxInfo->out_tax_id = $out_tax_id;
+                $taxInfo->out_tax = $out_tax;
+                $taxInfo->status =$is_syscn_tax ?2 : 1;
 			    $taxInfo->inv_good_name = $inv_good_name;
 			    $taxInfo->tax = $tax;
 			    $taxInfo->cgd_tax_id = $cgd_tax_id;
@@ -2482,6 +2504,13 @@ class Goodup extends Base
                     if($cgd_tax_id==0) return error_show(1004,'源头供应商开票税目不能为空');
                     if($cgd_tax==='') return error_show(1004,'源头供应商开票税率不能为空');
                 }
+            }
+        $is_syscn_tax = isset($this->post['is_syscn_tax'])&&$this->post['is_syscn_tax']!==""? intval($this->post['is_syscn_tax']):"0";
+            $out_tax_id = isset($this->post['out_tax_id'])&&$this->post['out_tax_id']!==""? intval($this->post['out_tax_id']):"0";
+            $out_tax = isset($this->post['out_tax'])&&$this->post['out_tax']!==""? trim($this->post['out_tax']):"";
+            if($is_syscn_tax==1){
+               $out_tax_id=$tax_id;
+               $out_tax=$tax;
             }
 		 if($isCombind==1){
 			if(empty($combindList)) return error_show(1004,'组合商品子商品信息不能为空');
@@ -2528,6 +2557,7 @@ class Goodup extends Base
                 "packing_list"=>$packing_list,
                 "packing_weight"=>$packing_weight,
                 "good_bar"=>$good_bar,
+                'is_syscn_tax'=>$is_syscn_tax,
                 "supply_area"=>$supply_area,
                 "delivery_place"=>$delivery_place,
                 "origin_place"=>$origin_place,
@@ -2663,6 +2693,9 @@ class Goodup extends Base
                     $taxInfo->inv_good_name = $inv_good_name;
 				    $taxInfo->cgd_tax_id = $cgd_tax_id;
                     $taxInfo->cgd_tax = $cgd_tax;
+                    $taxInfo->out_tax_id = $out_tax_id;
+                    $taxInfo->out_tax = $out_tax;
+                    $taxInfo->status = $is_syscn_tax==1?2:1;
                     $taxInfo->tax = $tax;
                     $taxInfo->creater = $this->uname;
                     $taxInfo->createrid =$this->uid;