fix: 制单备注仅保留报销编号(09-04-reimbursement-state-gap-finance-view)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-09-11 23:54:53 +08:00
父节点 98eabdde7f
当前提交 1eeda7cd92
共修改 6 个文件,包含 35 行新增和 11 行删除
+1 -1
查看文件
@@ -156,7 +156,7 @@ function buildPaymentOrderRows(config, batch) {
serial,
Number(amount.toFixed(2)),
"报销款",
`${payeeName}报销款 ${entityCode}`,
entityCode,
"0",
"",
"",
@@ -43,18 +43,22 @@ function buildBatch(overrides = {}) {
}
describe("payment order BIFF8 generator", () => {
it("uses frozen payee names and keeps separate rows for the same payee", () => {
it("keeps document-only remarks and separate transfers for the same frozen payee account", () => {
const batch = buildBatch();
for (const item of batch.items) {
item.snapshot_json.payee.name = " 合成收款人 ";
item.snapshot_json.payee.bankAccountEncrypted = batch.items[0].snapshot_json.payee.bankAccountEncrypted;
item.snapshot_json.submitter = { name: "合成提交人" };
item.owner = { name: "已改名归属人" };
}
const result = buildPaymentOrderRows(config, batch);
expect(result.rows.map((row) => row.slice(10, 12))).toEqual([
["报销款", "合成收款人报销款 BX-20260802-0001"],
["报销款", "合成收款人报销款 BX-20260802-0002"],
["报销款", "BX-20260802-0001"],
["报销款", "BX-20260802-0002"],
]);
expect(result.rows.map((row) => row[5])).toEqual(["合成收款人", "合成收款人"]);
expect(result.rows[0][4]).toBe(result.rows[1][4]);
expect(result.rows.map((row) => row[9])).toEqual([1.2, 2]);
expect(result.serials).toEqual(["PB-20260802-002-R001", "PB-20260802-002-R002"]);
expect(result.totalAmount).toBe("3.20");
});
@@ -66,7 +70,9 @@ describe("payment order BIFF8 generator", () => {
batch.items = [batch.items[0]];
batch.items[0].snapshot_json.payee.name = ` ${name} `;
batch.items[0].entity_code = ` ${code} `;
expect(buildPaymentOrderRows(config, batch).rows[0][11]).toBe(`${name}报销款 ${code}`);
const row = buildPaymentOrderRows(config, batch).rows[0];
expect(row[5]).toBe(name);
expect(row[11]).toBe(code);
});
it.each([
@@ -120,10 +126,10 @@ describe("payment order BIFF8 generator", () => {
expect(parsed.rows).toHaveLength(2);
expect(parsed.rows[0]).toEqual([
"1", payerAccount, "合成测试公司", "01", payeeAccount, "甲", "中国建设银行", "",
"PB-20260802-002-R001", 1.2, "报销款", "甲报销款 BX-20260802-0001", "0", "", "",
"PB-20260802-002-R001", 1.2, "报销款", "BX-20260802-0001", "0", "", "",
]);
expect(parsed.rows[1][9]).toBe(2);
expect(parsed.rows[1].slice(10, 12)).toEqual(["报销款", "乙报销款 BX-20260802-0002"]);
expect(parsed.rows[1].slice(10, 12)).toEqual(["报销款", "BX-20260802-0002"]);
});
it("fails the whole export and reports every blocking payee issue", () => {