wugg 1 year ago
parent
commit
1ebc878fab
3 changed files with 20 additions and 12 deletions
  1. 7 7
      app/admin/controller/InvCat.php
  2. 12 4
      app/admin/controller/OrderInv.php
  3. 1 1
      app/command/Report.php

+ 7 - 7
app/admin/controller/InvCat.php

@@ -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]);

+ 12 - 4
app/admin/controller/OrderInv.php

@@ -616,13 +616,18 @@ class OrderInv extends BaseController{
 	* @throws \think\db\exception\DbException
 	 */
     public function batchCheck(){
-    	$param =$this->request->only(["invNos"=>[],"status"=>''],"post");
-    	$valid=Validate::rule(["invNos|发票编号"=>"require|array","status|审核状态"=>"require|number|in:2,8"]);
+    	$param =$this->request->only(["invNos"=>[],"status"=>'',"open_type"=>0],"post");
+    	$valid=Validate::rule([
+    		"invNos|发票编号"=>"require|array",
+    	    "status|审核状态"=>"require|number|in:2,8",
+    	    "open_type|审核状态"=>"require|number|in:0,1,2,3",
+    	    ]);
     	if($valid->check($param)==false) return error_show(1004,$valid->getError());
     	$list =Db::name("invoice_pool")->where(["invNo"=>$param['invNos'],"status"=>1,"is_del"=>0])->column("id");
     	if(empty($list)) return error_show(1004,"未找到有效数据");
-		$up =Db::name("invoice_pool")->where(["id"=>$list,"status"=>1,"is_del"=>0])->update(["status"=>2,
-		"updatetime"=>date("Y-m-d H:i:s")]);
+		$up =Db::name("invoice_pool")
+		->where(["id"=>$list,"status"=>1,"is_del"=>0])
+		->update(["status"=>$param['status'],"open_type"=>$param['open_type'],"updatetime"=>date("Y-m-d H:i:s")]);
 		if($up==false) return error_show(1004,"数据审核失败");
 		 return app_show(0,"数据审核成功");
     }
@@ -1471,6 +1476,9 @@ class OrderInv extends BaseController{
         ->where($condition)->field("a.id,
 						a.invNo,
 						a.platform_type,
+						a.open_type,
+						a.is_ticket,
+						a.tag_id,
 						a.apply_id,
 						a.apply_name,
 						a.status,

+ 1 - 1
app/command/Report.php

@@ -944,7 +944,7 @@ class Report extends Command
 
 	//采购部门销售业绩
 	private function R($param=[]){
-		$where = [["a.is_del","=",0],["a.status","=",2],["b.is_stock","=",0]];
+		$where = [["a.is_del","=",0],["a.status","in",[2,3]],["b.is_stock","=",0]];
 		if (($param['start'] != '') && ($param['end'] != '')) $where[] = ['a.sendtime', 'between', [date("Y-m-d 00:00:00",
 		strtotime($param['start'])),date("Y-m-d 23:59:59",strtotime($param['end']))]];
 //		if ($param['companyNo'] != '') $where[] = ['supplierNo', '=', $param['companyNo']];