wugg 2 年 前
コミット
2120c49dfd
2 ファイル変更7 行追加9 行削除
  1. 3 6
      app/admin/controller/InterOrder.php
  2. 4 3
      app/command/Report.php

+ 3 - 6
app/admin/controller/InterOrder.php

@@ -355,6 +355,9 @@ class InterOrder extends \app\admin\BaseController{
 		$companyName =Db::name("supplier_info")->where('code', "=", $param['companyNo'])->value("name","");
 		$taxinfo = Db::name("order_rate")->where(["id"=>$param["tax"],"status"=>1])->value("rate",0);
 		$cat = [];
+		if($qrd_order['status']!=0) return error_show(1004,"销售单已对账,无法修改");
+		if($cgd_order['status']!=0) return error_show(1004,"采购单已对账,无法修改");
+
 		$this->cat($param['cat'],$cat);
 		if(empty($cat)) return error_show(1004,'分类信息为找到');
 		$inter=[
@@ -412,14 +415,8 @@ class InterOrder extends \app\admin\BaseController{
                                 'catInfo' => json_encode($cat,JSON_UNESCAPED_UNICODE),//分类明细',
                                 'fundCode' => $cat[2]['fund_code']??"",//NOT NULL,
                                 'tax' => $taxinfo,//税点',
-//                                'goodPrice' => round( $param['goodPrice']*(1-$param['cgd_tax']),2),//成本合计/单价',
-//                                'goodNum' => $param['goodNum'],//下单数量',
-//                                'totalPrice' => round(  $param['goodNum']*$param['goodPrice']*(1-$param['cgd_tax']),2),//采购总货款',
                                 'supplierNo' => $param['supplierNo'],//供应商编号',
                                 'supplierName' => $supplierName,//供应商名称',
-//                                'wpay_fee' =>round(  $param['goodNum']*$param['goodPrice']*(1-$param['cgd_tax']),2),//采购总货款',
-//                                'winv_fee' =>round(  $param['goodNum']*$param['goodPrice']*(1-$param['cgd_tax']),2),//采购总货款',
-//                                'sendNum' => $param['goodNum'],//已发货数量',
                                 'updatetime' => date("Y-m-d H:i:s"),
                             ];
 

+ 4 - 3
app/command/Report.php

@@ -641,12 +641,13 @@ class Report extends Command
 			$value['业务提票时间'] =Db::name("assoc")->where(["type"=>1,"status"=>[1,2],"is_del"=>0,'orderCode'=>$value['业务订单编号']])
 			                    ->order("id desc")->value('addtime','');
 			//计算账期
-			$value['账期'] = round(bcdiv(bcsub($time,strtotime($value['最近回款时间']??$value['下单时间']), 3), 86400, 3),
-				2);
+			$value['账期'] = bcdiv(bcsub($time,strtotime($value['最近回款时间']==''?$value['下单时间']:$value['最近回款时间']), 3), 86400, 0);
 			$value['比率'] = round(bcdiv($value['账期'], 30, 1));
 			$value['订单是否超期'] = $value['比率'] > 6 ? '是' : '否';
 			
-			$value['开票是否超期'] = round(bcdiv(bcsub($time, strtotime($value['最近开票时间']??$value['下单时间']), 1), 86400, 1)) > 15 ? '是' : '否';
+			$value['开票是否超期'] = round(bcdiv(bcsub($time, strtotime($value['最近开票时间']==''?$value['下单时间']:$value['最近开票时间']), 1), 86400, 1)
+			) >
+			15 ? '是' : '否';
 			
             $value['最近一次发货时间'] = Db::table('fh_source')
                 ->whereIn('qrdNo', [$value['业务订单编号'], $value['销售订单主编号']])