|
|
@@ -184,7 +184,7 @@ class U8ServerService extends Service
|
|
|
}
|
|
|
|
|
|
public function paymentOrderDetail($data, $user){
|
|
|
- if(empty($data['order_number'])) return [false, '付款单号不能为空'];
|
|
|
+ if(empty($data['order_number'])) return [false, '付款申请单号不能为空'];
|
|
|
|
|
|
$order = $this->databaseService->table('AP_ApplyPayVouch as a')
|
|
|
->leftJoin('Vendor as c', 'c.cVenCode', 'a.cDwCode')
|
|
|
@@ -207,6 +207,8 @@ class U8ServerService extends Service
|
|
|
$detail = array_map(function ($item) {
|
|
|
return (array) $item;
|
|
|
}, $detail->toArray());
|
|
|
+ // 使用 array_column 提取所有 amount 并求和
|
|
|
+ $order['total_amount'] = number_format(array_sum(array_column($detail, 'amount')), 2, '.', '');
|
|
|
$order['detail'] = $detail;
|
|
|
|
|
|
return [true, $order];
|
|
|
@@ -221,7 +223,7 @@ class U8ServerService extends Service
|
|
|
// 请购单
|
|
|
[$success, $order] = $this->purchaseRequisitionDetail($data,$user);
|
|
|
}else{
|
|
|
- // 付款单
|
|
|
+ // 付款申请单
|
|
|
[$success, $order] = $this->paymentOrderDetail($data,$user);
|
|
|
}
|
|
|
|