Bladeren bron

Merge branch 'master-new-wgg' of wugg/phpstock into master-new

wugg 8 maanden geleden
bovenliggende
commit
e681b611ef
2 gewijzigde bestanden met toevoegingen van 10 en 0 verwijderingen
  1. 8 0
      app/admin/controller/Goodup.php
  2. 2 0
      app/command/ImportOrderFromCHandleData.php

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

@@ -1026,10 +1026,16 @@ class Goodup extends Base
         $tax_id = isset($this->post['tax_id'])&&$this->post['tax_id']!==''? intval($this->post['tax_id']):'';
         $open_type= isset($this->post['open_type'])&&$this->post['open_type']!==''? intval($this->post['open_type']):'';
         $inv_good_name = isset($this->post['inv_good_name'])&&$this->post['inv_good_name']!==''? trim($this->post['inv_good_name']):'';
+        $cgd_tax_id = isset($this->post['cgd_tax_id'])&&$this->post['cgd_tax_id']!==''? intval($this->post['cgd_tax_id']):'0';
+        $cgd_tax = isset($this->post['cgd_tax'])&&$this->post['cgd_tax']!==''? trim($this->post['cgd_tax']):'';
         if($open_type=='') return error_show(1004,'开票商品类型不能为空');
         if($open_type==1){
             if($tax_id=='') return error_show(1004,'商品税目id不能为空');
             if($inv_good_name=='') return error_show(1004,'开票商品名称不能为空');
+            if($cgd_supplier_code!=''){
+                if($cgd_tax_id==0) return error_show(1004,'源头供应商开票税目不能为空');
+                if($cgd_tax==='') return error_show(1004,'源头供应商开票税率不能为空');
+            }
         }
         if($isCombind==1){
 			if(empty($combindList)) return error_show(1004,'组合商品子商品信息不能为空');
@@ -1153,6 +1159,8 @@ class Goodup extends Base
 			    $taxInfo->tax_id = $tax_id;
 			    $taxInfo->inv_good_name = $inv_good_name;
 			    $taxInfo->tax = $tax;
+			    $taxInfo->cgd_tax_id = $cgd_tax_id;
+                $taxInfo->cgd_tax = $cgd_tax;
 			    $taxInfo->creater = $this->uname;
 			    $taxInfo->createrid =$this->uid;
 			    $taxInfo->save();

+ 2 - 0
app/command/ImportOrderFromCHandleData.php

@@ -205,6 +205,7 @@ class ImportOrderFromCHandleData extends Command
                     "good_num" => $good_num,
                     "good_type" => $goodtype,
                     "order_type" => $order_type,
+                    'open_type' => $ct['open_type'],
                     "order_source" => $order_source,
                     "createrid" => $supplier_temp_info['personid'],
                     "creater" => $supplier_temp_info['person'],
@@ -264,6 +265,7 @@ class ImportOrderFromCHandleData extends Command
                     'cost_price' => $ct['cost_fee'],
                     'diff_weight' => 0,
                     'diff_fee' => 0,
+                    'open_type' => $ct['open_type'],
                     "workNo" => $workNo,
                     "addtime" => date("Y-m-d H:i:s"),
                     "updatetime" => date("Y-m-d H:i:s"),