wugg 2 سال پیش
والد
کامیت
0ccc70fa87
2فایلهای تغییر یافته به همراه14 افزوده شده و 12 حذف شده
  1. 6 5
      app/admin/controller/OrderInv.php
  2. 8 7
      app/command/Report.php

+ 6 - 5
app/admin/controller/OrderInv.php

@@ -135,8 +135,8 @@ class OrderInv extends BaseController{
                        "vice_total"=>$invfee,
                        "cancel_fee"=>$value['inv_fee'],
                        "status"=>1,
-                        "addtime"=>date("Y-m-d H:i:s"),
-                        "updatetime"=>date("Y-m-d H:i:s")
+                       "addtime"=>date("Y-m-d H:i:s"),
+                       "updatetime"=>date("Y-m-d H:i:s")
                     ];
                     $invoice_good=[
                        "invNo"=>$invNo,
@@ -150,6 +150,7 @@ class OrderInv extends BaseController{
                         "goodNum"=>$value['num'],
                         "specInfo"=>$value['sequenceNo'],
                         "totalPrice"=>$value['inv_fee'],
+                        "totalTax"=>$value['inv_fee'],
                         "tax"=>$good_info['inv_tax']??$qrd['tax'],
                         "is_discount"=>$good_info['is_discount']??0,
                         "addTax"=>$good_info['addTax']??'',
@@ -832,8 +833,8 @@ class OrderInv extends BaseController{
 	                    	if(in_array($ticket['inv_type'],['007','026'])) $result= $this->addRedOpen($ticket,$return_reason,$invinfo['company_type'], $returnCode);
 	                    	if(in_array($ticket['inv_type'],['004','028'])) $result= $this->addApplyRed($ticket,$returnCode);
 	                    }
-						if(isset($result['code'])&&$result['code']==0){
-							if($discard==1){
+						if(isset($result['code'])){
+							if($discard==1 ||$result['code']==0){
 								$status=2;
 							}
 							if(isset($result['data']) &&$result['data']['invRed']!='' ){
@@ -1205,7 +1206,7 @@ class OrderInv extends BaseController{
 			throw new \Exception($result['ZTXX'], 10006);
 		}
 		$up =Db::name("invoice_red")->insert($data);
-		if($up) return ["code"=>0,"message"=>"红冲发票申请新建成功","invRed"=>$invRed];
+		if($up) return ["code"=>1,"message"=>"红冲发票申请新建成功","invRed"=>$invRed];
 		else throw new \Exception($result['ZTXX'], 1006);
     }
     //获取发票详情

+ 8 - 7
app/command/Report.php

@@ -183,7 +183,7 @@ class Report extends Command
 		          d.goodNum 数量,
 		          d.goodPrice 单价,
 		          d.tax 税率,
-		          d.totalPrice 总价,
+		          d.totalTax 总价,
 		          a.inv_type 开票种类,
 		          a.open_type 开票方式,
 		          a.exam_remark 申请备注,
@@ -515,7 +515,7 @@ class Report extends Command
             e.department 业务部门,
             e.ownerName 业务人员,
             m.goodNum 本次开票数量,
-            m.totalPrice 本次开票金额,
+            m.totalTax 本次开票金额,
             e.goodPrice 销售单价,
             c.open_date 本次开票时间,
             c.inv_number 发票号,
@@ -634,10 +634,7 @@ class Report extends Command
 		$time = time();
 
 		foreach ($data as $value) {
-			$value['订单来源'] = $this->qrdSource[$value['订单来源']] ?? '';
-			$value['回款状态'] = $this->pay_status[$value['回款状态']] ?? '';
-			$value['开票状态'] = $this->inv_status[$value['开票状态']] ?? '';
-			$value['发货状态'] = $this->sendStatus[$value['发货状态']] ?? '';
+
 			$value['业务提票时间'] =Db::name("assoc")->where(["type"=>1,"status"=>[1,2],"is_del"=>0,'orderCode'=>$value['业务订单编号']])
 			                    ->order("id desc")->value('addtime','');
 			//计算账期
@@ -657,7 +654,11 @@ class Report extends Command
                 ->where(["a.code"=>$value['业务订单编号'],"a.status"=>1,"b.type"=>3])->value("b.tag_name",'');
              $value['销售开票'] = Db::name("tag_log")->alias("a")->leftJoin("order_tag b","a.tag_id=b.id")
                 ->where(["a.code"=>$value['业务订单编号'],"a.status"=>1,"b.type"=>4])->value("b.tag_name",'');
-
+             if($value['订单来源']==10)$value['最近一次发货时间']=$value['下单时间'];
+			$value['订单来源'] = $this->qrdSource[$value['订单来源']] ?? '';
+			$value['回款状态'] = $this->pay_status[$value['回款状态']] ?? '';
+			$value['开票状态'] = $this->inv_status[$value['开票状态']] ?? '';
+			$value['发货状态'] = $this->sendStatus[$value['发货状态']] ?? '';
 			yield $value;
 		}