优化
This commit is contained in:
@@ -206,8 +206,8 @@ async function normalizeFixture(context) {
|
||||
raw, feeSourceId: financePoolId(financeSource), sourceFeeId: sourceId(raw), customerId: id(raw.customerId),
|
||||
direction: String(raw.direction ?? ''), currency: String(raw.currency ?? raw.currencyCode ?? '').toUpperCase(),
|
||||
businessDate: sourceDate(raw), waybillId: sourceWaybill(raw), marker: raw.marker,
|
||||
supplierId: id(raw.supplierId ?? raw.partnerId ?? root.supplierId ?? root.partnerId),
|
||||
supplierName: raw.supplierName ?? raw.partnerName ?? root.supplierName ?? root.partnerName ?? null,
|
||||
supplierId: id(raw.supplierId ?? root.supplierId),
|
||||
supplierName: raw.supplierName ?? root.supplierName ?? null,
|
||||
}
|
||||
})
|
||||
const hasContainerAllocations = list(root.allocations).length > 0
|
||||
@@ -526,7 +526,7 @@ export async function run(context) {
|
||||
const body = { customerId: fixture.customerId, supplierId,
|
||||
feeSourceIds: payables.map((source) => source.feeSourceId), dueDate, currency: 'CNY' }
|
||||
const response = await write(context, 'POST', `${BASE}/payable-settlements`, body, 'payable-settlement')
|
||||
payableSettlement = context.apiSuccess(MODULE, '按 Fixture PAYABLE 与 partnerId/supplierId 生成应付结算单',
|
||||
payableSettlement = context.apiSuccess(MODULE, '按 Fixture PAYABLE 与 supplierId 生成应付结算单',
|
||||
response, `sources=${payables.length}, supplierId=${supplierId}, supplierName=${supplierName ?? 'null'}`, OPTIONS)
|
||||
if (payableSettlement) {
|
||||
const listed = await findSettlementInOfficialList(context, 'PAYABLE', fixture.customerId,
|
||||
@@ -543,7 +543,7 @@ export async function run(context) {
|
||||
}
|
||||
} else {
|
||||
blocker(context, 'PAYABLE 结算 Fixture 门禁',
|
||||
`需要至少一条同客户 CNY PAYABLE,且全部提供相同 partnerId/supplierId;sources=${payables.length}, suppliers=${payableSupplierIds.size}`,
|
||||
`需要至少一条同客户 CNY PAYABLE,且全部提供相同 supplierId;sources=${payables.length}, suppliers=${payableSupplierIds.size}`,
|
||||
'insufficient-payable-supplier-fixture')
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ export async function run(context) {
|
||||
fixture.root.receivableSettlementMap = { byStatementId: Object.fromEntries(arRows.map((row) => [row.statementId, row])) }
|
||||
fixture.root.payableSettlements = payableSettlement ? [{
|
||||
settlementId: settlementId(payableSettlement), direction: payableSettlement.direction,
|
||||
supplierId: id(payableSettlement.supplierId), partnerId: id(payableSettlement.partnerId ?? payableSettlement.supplierId),
|
||||
supplierId: id(payableSettlement.supplierId),
|
||||
supplierName: payableSettlement.supplierName ?? payables[0]?.supplierName ?? null,
|
||||
status: payableSettlement.status,
|
||||
paymentStatus: payableSettlement.paymentStatus, version: payableSettlement.version,
|
||||
|
||||
Reference in New Issue
Block a user