fix(finance): include billed sources in trip financial attribution

This commit is contained in:
2026-10-05 12:35:38 +08:00
parent f13d340620
commit adaac7aca4
3 changed files with 33 additions and 4 deletions
@@ -28,7 +28,7 @@ public class TripFinanceQueryService {
SELECT f.id,f.customer_id,f.business_no,f.source_no,f.fee_item_name,f.source_fee_version,f.currency_code,f.amount,f.status
FROM fin_fee_source f WHERE f.source_system='LASTLEG' AND f.business_type='DELIVERY_ORDER'
AND f.source_type='OVERSEAS_DELIVERY_FEE' AND f.direction='RECEIVABLE'
AND f.review_status='APPROVED' AND f.status IN ('AVAILABLE','SETTLED')
AND f.review_status='APPROVED' AND f.status IN ('AVAILABLE','BILLED','SETTLED')
AND NOT EXISTS (SELECT 1 FROM fin_fee_source newer WHERE newer.source_system=f.source_system
AND newer.source_type=f.source_type AND newer.source_fee_id=f.source_fee_id
AND newer.source_fee_version>f.source_fee_version)
@@ -3,7 +3,7 @@
"info": {
"title": "车次Finance权威应收与实收只读来源",
"version": "1.0.0",
"description": "Lastleg以不可变DEPART验证后的客户/派送业务号读取。仅本Finance库;最新已审核有效LASTLEG OVERSEAS_DELIVERY_FEE应收,按币种。实收只取fin_receipt_bill已确认分配;整张已出账账单(ISSUED、PARTIALLY_PAID、PAID)全部来源均明确归属请求车次时才计一次。混合账单、无分配、无有效来源为待分配,不按账单总额或比例估算。最多200业务、2000费用,批量查询。现行应收结算单收款沿关联账单,fin_settlement_payment仅用于应付,不重复叠加。"
"description": "Lastleg以不可变DEPART验证后的客户/派送业务号读取。仅本Finance库;最新已审核有效LASTLEG OVERSEAS_DELIVERY_FEE应收(AVAILABLE、正式出账后的BILLED、SETTLED;LOCKED、VOIDED、SUPERSEDED排除),按币种。实收只取fin_receipt_bill已确认分配;整张已出账账单(ISSUED、PARTIALLY_PAID、PAID)全部来源均明确归属请求车次时才计一次。混合账单、无分配、无有效来源为待分配,不按账单总额或比例估算。最多200业务、2000费用,批量查询。现行应收结算单收款沿关联账单,fin_settlement_payment仅用于应付,不重复叠加。"
},
"paths": {
"/internal/finance/v1/trip-receivables/query": {