Pārlūkot izejas kodu

Merge branch 'dev' into dev_wf

wufeng 2 gadi atpakaļ
vecāks
revīzija
2c4cf3fab1

+ 3 - 1
app/admin/command/GetOrderInfoAndInvoiceInfo.php

@@ -39,7 +39,8 @@ class GetOrderInfoAndInvoiceInfo extends Command
 					}
 				}else{
 					$invNo=$value['invNo'];
-					if($value['FPLXDM']=='026'||$value['FPLXDM']=='028') $status=3; else $status=2;
+					$status=3;
+//					if($value['FPLXDM']=='026'||$value['FPLXDM']=='028') $status=8; else $status=2;
 					Db::name("invoice_pool")->where(["invNo"=>$value['invNo'],"is_del"=>0])->update(["status"=>$status,"updatetime"=>date("Y-m-d H:i:s")]);
 				}
 				$this->insertTicket($value['result'],$invNo);
@@ -129,6 +130,7 @@ class GetOrderInfoAndInvoiceInfo extends Command
 			$invinfo["reciver"]=$json['SKR'];
 			$invinfo["reviewer"]=$json['FHR'];
 			$invinfo["check_code"]=$json['JYM'];
+			$invinfo["pdfstream"]=$json['PDFZJL']??"";
 			$invinfo["item"]=json_encode($json['itemlist'],JSON_UNESCAPED_UNICODE);
 			Db::name("invoice_ticket")->save($invinfo);
 		}

+ 8 - 15
app/admin/controller/OrderInv.php

@@ -215,7 +215,7 @@ class OrderInv extends BaseController{
             return error_show(1004,$e->getMessage());
         }
    }
-    // 0 待财务开票/待金税开票   1待财务审核 2待填写物流 3开票完成  4开票失败/开票驳回   5财务驳回 6退票 7金税开票中
+    // 0 待财务开票/待金税开票   1待财务审核 2待填写物流 3开票完成  4开票失败/开票驳回   5财务驳回 6退票 7金税开票中  8 电子票待确认
    public  function  status(){
         $invNo = isset($this->post['invNo'])&&$this->post['invNo']!=''?trim($this->post['invNo']):"";
         if($invNo==""){
@@ -231,17 +231,12 @@ class OrderInv extends BaseController{
         }
         //open_type 1 金税开票 2 金税线下开票 3 线下开票
         $open_type = isset($this->post['open_type'])&&$this->post['open_type']!==''?intval($this->post['open_type']):"";
-
         $remark = isset($this->post['remark'])&&$this->post['remark']!=''?trim($this->post['remark']):"";
-
-//        $invArr=isset($this->post['invArr'])&&!empty($this->post['invArr'])?$this->post['invArr']:[];
         $invCode =isset($this->post['invCode'])&&$this->post['invCode']!=''?trim($this->post['invCode']):"";
         $invNum =isset($this->post['invNum'])&&$this->post['invNum']!=''?trim($this->post['invNum']):"";
         $open_date =isset($this->post['open_date'])&&$this->post['open_date']!=''?trim($this->post['open_date']):"";
-//        $total_fee =isset($this->post['total_fee'])&&$this->post['total_fee']!=''?floatval($this->post['total_fee']):"";
         $subtotal_fee =isset($this->post['subtotal_fee'])&&$this->post['subtotal_fee']!=''?floatval($this->post['subtotal_fee']):"";
         $checkCode =isset($this->post['checkCode'])&&$this->post['checkCode']!=''?trim($this->post['checkCode']):"";
-
         if($status==1){
            if($open_type==='')return error_show(1004,"参数 open_type 不能为空");
            if($open_type!=1){
@@ -251,13 +246,10 @@ class OrderInv extends BaseController{
                if($invinfo['inv_type']==2 || $invinfo['inv_type']==3){
                	    if($checkCode==='') return error_show(1004,"参数 checkCode 不能为空");
                }
-
-//               if($total_fee==='') return error_show(1004,"参数 tatal_fee 不能为空");
                if($subtotal_fee==='') return error_show(1004,"参数 subtotal_fee 不能为空");
-//               if($total_fee!=$invinfo['inv_value'])return error_show(1004,"发票金额不足");
 				$status=7;
            }else{
-           	$status=7;
+           	    $status=7;
            }
         }
         $update=[
@@ -281,6 +273,7 @@ class OrderInv extends BaseController{
                         "inv_total"=>0,
                         "inv_subtotal"=>$subtotal_fee,
                         "open_date"=>$open_date,
+                        'pdfstream'=>'',
                         "item"=>'',
                         "status"=>0,
                         "addtime"=>date("Y-m-d H:i:s"),
@@ -676,8 +669,6 @@ class OrderInv extends BaseController{
         if ($return_type==""){
               return error_show(1005,"参数 return_type 不能为空");
         }
-
-
         $remark =isset($this->post['remark'])&&$this->post['remark']!="" ? trim($this->post['remark']):"";
         if($remark==""){
              return error_show(1005,"参数 remark 不能为空");
@@ -755,6 +746,7 @@ class OrderInv extends BaseController{
                         "inv_subtotal"=>$subtotal_fee,
                         "open_date"=>$open_date,
                         "item"=>'',
+                        'pdfstream'=>'',
                         "status"=>0,
                         "addtime"=>date("Y-m-d H:i:s"),
                         "updatetime"=>date("Y-m-d H:i:s")
@@ -1040,7 +1032,8 @@ class OrderInv extends BaseController{
         $poolinfo['ownerPlace'] = $pool['ownerPlace']??'';
         $orderList =Db::name("invoice_good")->where(["invNo"=>$invNo,"is_del"=>0])->select()->toArray();
         $poolinfop['goodList']=$orderList;
-        $poolinfop['invinfo']=Db::name("invoice_ticket")->where(["invNo"=>$invNo,"type"=>0,"is_del"=>0])->findOrEmpty();
+        $poolinfop['invinfo']=Db::name("invoice_ticket")->withoutField("pdfstream")->where(["invNo"=>$invNo,"type"=>0,"is_del"=>0])
+        ->findOrEmpty();
        return app_show(0,"获取成功",$poolinfo);
     }
     //退票列表
@@ -1537,7 +1530,7 @@ class OrderInv extends BaseController{
 		$condition[]=["inv_number","=",$num];
 		$invNo = isset($this->post['invNo'])&&$this->post['invNo']!=''?trim($this->post['invNo']):"";
 		if($invNo!=='')$condition[]=["invNo","=",$invNo];
-		$info =Db::name("invoice_ticket")->json(['item'])->where($condition)->findOrEmpty();
+		$info =Db::name("invoice_ticket")->json(['item'])->withoutField("pdfstream")->where($condition)->findOrEmpty();
 		if(!empty($info)&& isset($info['item'])){
 			array_walk($info['item'],function (&$value){
 					$value['SL'] = ($value['SL']*100)."%";
@@ -1865,7 +1858,7 @@ class OrderInv extends BaseController{
         $page= $page>$total ? intval($total):$page;
         $list=Db::name("invoice_return")->alias("a")
          ->leftJoin("invoice_ticket b","a.invNo=b.invNo and b.type=1")
-          ->field("b.*,a.*")->json(["item"])->page($page,$size)->where($condition)->select()
+          ->field("b.*,a.*")->withoutField("pdfstream")->json(["item"])->page($page,$size)->where($condition)->select()
         ->toArray();
         return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
     }

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

@@ -1076,6 +1076,9 @@ class Payment extends BaseController
         try {
             if($payment['invType']==1&&$status==1){
                 $status=2;
+            }
+             if(in_array($payment['invoiceType'],['normal','electronic','toll','roll']) && $status==4){
+                $status=6; //普票无需认证
             }
             $invup =["status"=>$status,"remark"=>$remark,"updatetime"=>date("Y-m-d H:i:s")];
             $inv =Db::name("pay_invoice")->where($payment)->update($invup);
@@ -1155,7 +1158,7 @@ class Payment extends BaseController
             $condition[]=["invoiceNumber","=",$invNumber];
         }
         $checkApi = isset($post['checkApi'])&&$post['checkApi']!="" ? intval($post['checkApi']):"";
-        if($checkApi!=''){
+        if($checkApi!==''){
             $condition[]=["checkApi","=",$checkApi];
         }