wugg 1 年之前
父節點
當前提交
cc1346e542

+ 5 - 6
app/admin/command/downredinvres.php

@@ -83,7 +83,9 @@ class downredinvres extends Command
 			}
 		}else{
 			$data['remark']=$result['ZTXX'];
+			$data['status']=5;
 			Db::name("invoice_red")->where(["id"=>$row['id']])->update($data);
+			$this->updateReturn($row['returnCode'],$result['ZTXX']);
 		}
 
 		Db::commit();
@@ -164,11 +166,8 @@ class downredinvres extends Command
 	 * @param string $remark
 	 * @throws \think\db\exception\DbException
 	 */
-	public function updateReturn($fpdm,$fphm,$remark=''){
-		$where=["YFPDM"=>$fpdm,"YFPHM"=>$fphm,"status"=>5];
-		$fp = Db::name("invoice_red")->where($where)->findOrEmpty();
-		if(empty($fp)) throw new \Exception("未找到红票申请信息表");
-		Db::name("invoice_return")->where(["returnCode"=>$fp['returnCode'],"status"=>1])->update(["status"=>4,"updatetime"=>date("Y-m-d H:i:s"),"remark"=>$remark]);
+	public function updateReturn($returnCode,$remark=''){
+		Db::name("invoice_return")->where(["returnCode"=>$returnCode,"status"=>1])->update(["status"=>4,"updatetime"=>date("Y-m-d H:i:s"),"remark"=>$remark]);
 	}
 	
 	
@@ -178,7 +177,7 @@ class downredinvres extends Command
 			$row=Db::name('invoice_red')->where($where)->update($resultChild);
 			if ($row) {
 				if ($resultChild['status'] == 2) $this->AddRed($resultChild['YFPDM'] , $resultChild['YFPHM']);
-				if ($resultChild['status'] == 5) $this->updateReturn($resultChild['YFPDM'] , $resultChild['YFPHM'] ,$resultChild['remark']);
+				if ($resultChild['status'] == 5) $this->updateReturn($row['returnCode'] ,$resultChild['remark']);
 			}
 		}
 	

+ 1 - 22
app/admin/controller/InvCat.php

@@ -128,7 +128,7 @@ class InvCat extends BaseController{
             $supplier =Db::name("supplier_info")->where(["code"=>$goodinfo["supplierNo"]])->find();
             $goodinfo["supplierName"]=$supplier["name"]??"";
 
-            return app_show(0,"获取成功",$goodinfo);
+        return app_show(0,"获取成功",$goodinfo);
     }
     //发票类目列表
     public function catlist(){
@@ -194,7 +194,6 @@ class InvCat extends BaseController{
         ]);
 
         Db::startTrans();
-
         try {
 
             $all_spuCode = Db::name('good')
@@ -214,26 +213,6 @@ class InvCat extends BaseController{
                 if (!in_array($value['tax'], $all_cat_code[$value['cat_code']]['tax'] != '' ? explode('、', $all_cat_code[$value['cat_code']]['tax']) : [])) throw new Exception($value['tax'].'未找到对应的开票类目税率');
                 $value['tax'] = str_replace('%', '', $value['tax']);
                 $value['tax'] = round(bcdiv($value['tax'], 100, 3), 2);
-
-//
-//                if ($value['is_discount'] == 1) {
-//                    // 优惠政策下 税率标识只能选择 0非零说率 1免税 2不征税 增值税管理为空"出口零税/免税/不征税"
-//                    if($value['tax'] == 0){
-//                    	if ( $value['inv_tag'] == 3) throw new Exception($value['spuCode'].'税率标识不能选择零税率');
-//                        if ($value['addTax'] == '') throw new Exception($value['spuCode'].'参数 addTax 不能为空');
-//                        if($value['addTax']!=$this->Tax[$value['inv_tag']]){
-//                        	throw new Exception($value['spuCode'].'税率标识与增值税管理内容不符');
-//						}
-//                    }
-//
-//
-//                } else {
-//                    // 非优惠政策下 零税率 税率标识只能选择 3 普通零税率  增值税管理为空
-//                    // 非优惠政策下 非零税率 税率标识只能选择 0 非零税率  增值税管理为空
-//                    if ($value['tax'] == 0 && $value['inv_tag'] != 3) throw new Exception($value['spuCode'].'税率标识只能选择零税率');
-//					$value['addTax'] = '';
-//                }
-
                 if($value['is_discount'] ==1){
 //				1.如果YHZCBS为1, 则ZZSTSGL必须填; 如果YHZCBS为0,ZZSTSGL不填。
 //				2.如果YHZCBS为1, 且税率为0, 则LSLBS只能根据实际情况选择"1或2"中的一种, 不能选择3, 且ZZSTSGL内容也只能写与1/2对应的"免税/不征税";

+ 1 - 0
app/admin/controller/OrderInv.php

@@ -251,6 +251,7 @@ class OrderInv extends BaseController{
    }
     //   1财务审核通过 2 金税开票中/验票中 3 开票成功 4 财务驳回 5 开票失败 6 发票退票/废弃 7取消申请
     //   1财务审核通过 2 待财务上传发票 3 金税开票中/验票中 4 开票成功  5 开票失败 6发票退票/废弃 7取消申请 8 财务驳回 9验票失败
+
    public  function  status(){
         $invNo = isset($this->post['invNo'])&&$this->post['invNo']!=''?trim($this->post['invNo']):"";
         if($invNo==""){

+ 1 - 1
app/admin/controller/Payment.php

@@ -1297,7 +1297,7 @@ class Payment extends BaseController
     }
 
     /**
-	 * 发票审核状态
+	 * 发票审核状态     //发票验证通过 才会扣减待开票金额 失败的开票申请不用处理
 	 * 0 发票图片识别中 1待系统验证 2 买方公司审核3带买方公司认证 4 认证成功 5验证失败 6买方审核驳回 7 认证失败 8 回票流程终止 9 验证超次数 10 回票已退
      * @return \think\response\Json|void
      * @throws \think\db\exception\DataNotFoundException