|
@@ -780,7 +780,15 @@ class OrderInv extends BaseController{
|
|
|
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
- $update=["status"=>$status, "return_reason"=>$return_reason,"return_type"=>$return_type,"remark"=>$remark,"updatetime"=>date("Y-m-d H:i:s")];
|
|
|
+ $isoutmonth =date("Y-m",strtotime($ticket["open_date"]))==date("Y-m")?0:1;
|
|
|
+ $update=[
|
|
|
+ "status"=>$status,
|
|
|
+ "return_reason"=>$return_reason,
|
|
|
+ "return_type"=>$return_type,
|
|
|
+ "remark"=>$remark,
|
|
|
+ "updatetime"=>date("Y-m-d H:i:s")
|
|
|
+ ];
|
|
|
+ if($status==1) $update['is_out_month']=$isoutmonth;
|
|
|
$up =Db::name("invoice_return")->where($return)->update($update);
|
|
|
if($up){
|
|
|
if($status==1){
|
|
@@ -989,9 +997,17 @@ class OrderInv extends BaseController{
|
|
|
$return['ownerPlace'] = $poolinfo['ownerPlace']??'';
|
|
|
$orderList =Db::name("invoice_good")->where(["invNo"=>$return['invNo'],"is_del"=>0])->select()->toArray();
|
|
|
$return['goodList']=$orderList;
|
|
|
- $info =Db::name("invoice_ticket")->where(["invNo"=>$return['invNo'],"type"=>0]) ->field("inv_number,inv_code")->find();
|
|
|
+ $info =Db::name("invoice_ticket")->where(["invNo"=>$return['invNo'],"is_del"=>0,"type"=>0]) ->field("inv_number,inv_code,open_date")->find();
|
|
|
$return['inv_number']=$info['inv_number']??"";
|
|
|
$return['inv_code']=$info['inv_code']??"";
|
|
|
+ if(!in_array($return['status'],[2,3,4,5])){
|
|
|
+ $opendate =$info['open_date']??"";;
|
|
|
+ if($opendate!=''){
|
|
|
+ $open_month =date("Y-m",strtotime($opendate));
|
|
|
+ $return['is_out_month']= $open_month==date("Y-m")?0:1;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
return app_show(0,"获取成功",$return);
|
|
|
}
|
|
|
/**
|
|
@@ -1173,6 +1189,14 @@ class OrderInv extends BaseController{
|
|
|
foreach ($list as &$value){
|
|
|
$company =Db::name("company_info")->where(["companyNo"=>$value['inv_out']])->find();
|
|
|
$value['companyName'] = $company['company_name']??"";
|
|
|
+ if(!in_array($value['status'],[2,3,4,5])){
|
|
|
+ $opendate =Db::name("invoice_ticket")->where(["invNo"=>$value['invNo'],"is_del"=>0,"type"=>0])->value("open_date","");
|
|
|
+ if($opendate!=''){
|
|
|
+ $open_month =date("Y-m",strtotime($opendate));
|
|
|
+ $value['is_out_month']= $open_month==date("Y-m")?0:1;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
|
|
|
}
|