This commit is contained in:
2026-08-12 20:02:09 +08:00
parent 30aa0fd945
commit 0380c0553b
2 changed files with 9 additions and 1 deletions
@@ -4,6 +4,7 @@ import test from 'node:test'
const moduleUrl = new URL('./finance-extended-settlement.mjs', import.meta.url)
const source = await readFile(moduleUrl, 'utf8')
const fixtureSource = await readFile(new URL('./finance-full-fixtures.mjs', import.meta.url), 'utf8')
test('扩展财务验收只接受指定独立 marker 且不借历史来源', () => {
assert.match(source, /FIN-EXT-SETTLE-20260812/)
@@ -44,3 +45,8 @@ test('扩展财务验收输出可回传资源与柜次部署阻断', () => {
assert.match(source, /statusMatrix/)
assert.match(source, /containerPayableDeploymentBlocker/)
})
test('按柜 PAYABLE 费用携带有效往来单位', () => {
assert.match(fixtureSource, /partnerId: id\(supplier\.id\)/)
assert.match(fixtureSource, /partnerName: supplier\.partnerName \|\| null/)
})
@@ -357,7 +357,9 @@ export async function run(context) {
if (containerOwned && feeItems.PAYABLE && supplier?.id) {
const basePath = `/api/platform/v1/loading-plans/${encodeURIComponent(container.loadingPlanId)}/fee-details`
const path = `${basePath}?accountId=${encodeURIComponent(container.tenantId)}`
const body = { feeItemId: Number(feeItems.PAYABLE.id), direction: 'PAYABLE', businessDate: dateOffset(-2), amount: 300, currency: 'CNY', settlementIncluded: true, remark: `${context.marker}-CONTAINER_SHARED` }
const body = { feeItemId: Number(feeItems.PAYABLE.id), direction: 'PAYABLE', businessDate: dateOffset(-2),
amount: 300, currency: 'CNY', settlementIncluded: true, partnerId: id(supplier.id),
partnerName: supplier.partnerName || null, remark: `${context.marker}-CONTAINER_SHARED` }
const response = await request(context, 'POST', path, body)
if (response?.http === 404) {
blocker(context, '按柜费用来源接口已部署并可路由',