|
@@ -1712,6 +1712,7 @@ class Payment extends Base
|
|
|
->toArray();
|
|
|
//校验是否开通了供应商账号
|
|
|
$supp_account = check_has_account_by_supplierNos(array_unique(array_column($list,'supplierNo')));
|
|
|
+ $inv_fee=$inv_subtotal_amount = $total = 0;
|
|
|
foreach ($list as &$value){
|
|
|
$invoinfo =InvoiceInfo::where(["hpNo"=>$value['hpNo'],"status"=>1])->find();
|
|
|
$value['buyer_name'] = $invoinfo['buyer_name']??"";
|
|
@@ -1733,20 +1734,27 @@ class Payment extends Base
|
|
|
$value['invStatus_cn'] = $this->invStatus[$value['invStatus']]??'';
|
|
|
$value['item_list'] = $invoinfo['item_list']??[];
|
|
|
$value['has_account'] = (int)isset($supp_account['data'][$value['supplierNo']]);
|
|
|
+ if($value['status']==4){
|
|
|
+ $inv_fee += $value['inv_fee'];
|
|
|
+ $inv_subtotal_amount += $value['inv_subtotal_amount'];
|
|
|
+ $total += $value['total'];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//结算invlist这个接口当用payNo筛选的时候,返回列表里需要加一项统计筛选后列表的inv_subtotal_amount、total字段的和
|
|
|
- $inv_subtotal_amount = $total = 0;
|
|
|
- if ($payNo != '') {
|
|
|
- $inv_subtotal_amount = round(array_sum(array_column($list, 'inv_subtotal_amount')), 2);
|
|
|
- $total = round(array_sum(array_column($list, 'total')), 2);
|
|
|
- }
|
|
|
+// $inv_fee=$inv_subtotal_amount = $total = 0;
|
|
|
+// if ($payNo != '') {
|
|
|
+// $inv_subtotal_amount = round(array_sum(array_column($list, 'inv_subtotal_amount')), 2);
|
|
|
+// $total = round(array_sum(array_column($list, 'total')), 2);
|
|
|
+// }
|
|
|
|
|
|
return app_show(0, "获取成功", [
|
|
|
"count" => $count,
|
|
|
"list" => $list,
|
|
|
'inv_subtotal_amount' => $inv_subtotal_amount,
|
|
|
- 'total' => $total
|
|
|
+ 'total' => $total,
|
|
|
+ "inv_fee"=>$inv_fee
|
|
|
]);
|
|
|
|
|
|
}
|
|
@@ -1783,7 +1791,7 @@ class Payment extends Base
|
|
|
if(empty($cgdNo)) return error_show(1004,"未找到对账数据信息");
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
- $update=["is_del"=>1,"updatetime"=>date("Y-m-d H:i:s")];
|
|
|
+ $update=["status"=>8,"updatetime"=>date("Y-m-d H:i:s")]; //删除状态 流程终止
|
|
|
$invup =Db::name("pay_invoice")->where($payinv)->update($update);
|
|
|
if($invup){
|
|
|
if($payinv['status']==4){
|
|
@@ -1815,6 +1823,7 @@ class Payment extends Base
|
|
|
$payupdate =[
|
|
|
"inv_fee"=>$payinfo['inv_fee']-$payinv['inv_fee'],
|
|
|
"winv_fee"=>$payinfo['winv_fee']+$payinv['inv_fee'],
|
|
|
+ 'inv_status' => ($payinfo['ainv_fee']-$payinv['inv_fee'])==0?1:2,
|
|
|
"updatetime" => date("Y-m-d H:i:s")
|
|
|
];
|
|
|
$pay =Db::name("pay")->where($payinfo)->update($payupdate);
|
|
@@ -2317,6 +2326,11 @@ class Payment extends Base
|
|
|
->select()
|
|
|
->toArray();
|
|
|
if(empty($cgdlist))$cgdlist=["暂无数据"=>''];
|
|
|
+ else{
|
|
|
+ $cgdlist->each(function (&$item){
|
|
|
+ $item['采购单可关联金额']= bcsub($item['总货款'],InvoiceOrder::getInvoiceOrderTotalFee($item['采购单编号']),2);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
excelExport("{$param['payNo']}对账采购单详情",array_keys($cgdlist[0]),$cgdlist);
|
|
|
}
|