test(finance): align full acceptance with current workflows

This commit is contained in:
2026-09-01 10:17:03 +08:00
parent 505188c3fd
commit 3d6216910f
6 changed files with 80 additions and 38 deletions
@@ -233,7 +233,10 @@ export async function run(context) {
const ar = await official(context, `/api/platform/finance/v1/settlements/${encodeURIComponent(arId)}`, '读取应收结算导出事实')
const ap = await official(context, `/api/platform/finance/v1/settlements/${encodeURIComponent(apId)}`, '读取应付结算导出事实')
const fee = await official(context, `/api/platform/finance/v1/fee-pool?customerId=${encodeURIComponent(customerId)}&direction=ALL`, '读取费用来源导出事实')
const feeRow = values(fee.data)[0]
// PAYABLE rows are removed from the payable pool once an AP settlement owns
// them. Use a receivable row so the export filter still has an authoritative
// post-settlement match instead of asserting against an intentionally consumed row.
const feeRow = values(fee.data).find((item) => item?.direction === 'RECEIVABLE') || values(fee.data)[0]
const statementNo = statement.data?.statementNo
const arSummary = ar.data?.summary || ar.data
const apSummary = ap.data?.summary || ap.data