|
@@ -9,7 +9,7 @@ use think\facade\Db;
|
|
|
use think\facade\Validate;
|
|
|
|
|
|
class InvCat extends BaseController{
|
|
|
- private $Tax=[1=>"免税",2=>"不征税",3=>"零税率"];
|
|
|
+ private $Tax=[0=>'',1=>"免税",2=>"不征税",3=>"零税率"];
|
|
|
public function __construct(App $app) {parent::__construct($app);}
|
|
|
//商品关联开票类目
|
|
|
public function AddGood(){
|
|
@@ -36,7 +36,7 @@ class InvCat extends BaseController{
|
|
|
$tax=str_replace("%","",$tax)/100;
|
|
|
$invTag=isset($this->post['inv_tag'])&& $this->post['inv_tag']!==''?intval($this->post['inv_tag']):0;
|
|
|
$is_discount=isset($this->post['is_discount'])&& $this->post['is_discount']!==''?intval($this->post['is_discount']):0;
|
|
|
- $addTax=isset($this->post['addTax'])&& $this->post['addTax']!==''?trim($this->post['addTax']):'';
|
|
|
+ $addTax=isset($this->post['addTax'])&& $this->post['addTax']!==''?intval($this->post['addTax']):0;
|
|
|
if($is_discount==1){
|
|
|
// 1.如果YHZCBS为1, 则ZZSTSGL必须填; 如果YHZCBS为0,ZZSTSGL不填。
|
|
|
// 2.如果YHZCBS为1, 且税率为0, 则LSLBS只能根据实际情况选择"1或2"中的一种, 不能选择3, 且ZZSTSGL内容也只能写与1/2对应的"免税/不征税";
|
|
@@ -51,7 +51,7 @@ class InvCat extends BaseController{
|
|
|
if($addTax==''){
|
|
|
return error_show(1004,"参数 addTax 不能为空");
|
|
|
}
|
|
|
- if($addTax!=$this->Tax[$invTag]){
|
|
|
+ if($addTax!=$invTag){
|
|
|
return error_show(1004,"税率标识与增值税管理内容不符");
|
|
|
}
|
|
|
}
|
|
@@ -74,7 +74,7 @@ class InvCat extends BaseController{
|
|
|
"inv_good_name"=>$inv_good_name,
|
|
|
"inv_tag"=>$invTag,
|
|
|
"is_discount"=>$is_discount,
|
|
|
- "addTax"=>$addTax,
|
|
|
+ "addTax"=>$this->Tax[$addTax],
|
|
|
"status"=>1,
|
|
|
"updatetime"=>date("Y-m-d H:i:s")
|
|
|
];
|
|
@@ -110,9 +110,9 @@ class InvCat extends BaseController{
|
|
|
$page = $page>=$total? intval($total):$page;
|
|
|
$list =Db::name("good")->where($condition)->order("id desc")->page($page,$size)->select()->toArray();
|
|
|
foreach ($list as &$value){
|
|
|
- $company =Db::name("supplier_info")->where(["code"=>$value['companyNo']])->find();
|
|
|
- $value['companyName']=$company['name']??"";
|
|
|
- $supplier =Db::name("supplier_info")->where(["code"=>$value["supplierNo"]])->find();
|
|
|
+ $company =Db::name("company_info")->where(["companyNo"=>$value['companyNo']])->findOrEmpty();
|
|
|
+ $value['companyName']=$company['company_name']??"";
|
|
|
+ $supplier =Db::name("supplier_info")->where(["code"=>$value["supplierNo"]])->findOrEmpty();
|
|
|
$value["supplierName"]=$supplier["name"]??"";
|
|
|
}
|
|
|
return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
|