wugg %!s(int64=2) %!d(string=hai) anos
pai
achega
cc917aa44e
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      app/command/Report.php

+ 9 - 2
app/command/Report.php

@@ -28,6 +28,7 @@ class Report extends Command
 	private $cgdType = [1 => '库存', 2 => '非库存', 3 => '咨询'];
 	private $invoice_return_status = [0 => '待财务审核', 1 => '退票中', 2 => '退票成功', 3 => '审核驳回', 4 => '退票失败'];
 	private $sendStatus = [1=>'未发货',2=>'部分发货',3=>'全部发货'];
+	private $TagName = [1=>'采购单付款',2=>'采购单回票',3=>'销售回款',4=>"销售开票"];
 
     protected function configure()
     {
@@ -643,13 +644,18 @@ class Report extends Command
 				2);
 			$value['比率'] = round(bcdiv($value['账期'], 30, 1));
 			$value['订单是否超期'] = $value['比率'] > 6 ? '是' : '否';
-
+			
 			$value['开票是否超期'] = round(bcdiv(bcsub($time, strtotime($value['最近开票时间']??$value['下单时间']), 1), 86400, 1)) > 15 ? '是' : '否';
-
+			
             $value['最近一次发货时间'] = Db::table('fh_source')
                 ->whereIn('qrdNo', [$value['业务订单编号'], $value['销售订单主编号']])
                 ->order(['id' => 'desc'])
                 ->value('send_date', '');
+            $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"=>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",'');
+
 			yield $value;
 		}
 
@@ -820,6 +826,7 @@ class Report extends Command
 			$value['回票状态'] = $this->inv_status[$value['回票状态']];
 			$value['付款时间'] = Db::name("pay_payment")->where(['payNo'=>$value['对账编号'],"is_del"=>0])->order("id desc")
 			                   ->value('return_time','');
+
 			yield $value;
 		}
 	}