完善借款、编号、付款与预算并发及验收(09-06-release-gate-integrity)

汇总已落盘的借款本金与还款、兼容历史编号的周期化编号、付款责任与回单核验、报销进度和排序、PWA/采购事务、错误原因与日期校验及ERP退役。
统一共享预算池锁序和锁后判断,恢复差旅原预算选择,补原因码固定夹具及反向完整性检查。
纳入配套迁移、测试、受管QA、分层验收合同、规约及任务记录;原始证据留在ignored artifacts。

关联任务:09-17-company-loan-principal-repayment、09-17-erp-exclusive-retirement、09-18-reimbursement-periodic-numbering、09-08-reimbursement-payment-closeout、09-18-local-concurrency-product-fixes、09-19-budget-pool-concurrency、09-05-error-explainability-payment-readiness。
预算补审由Claude定向验证2文件928项通过,原4446/28及r6结果仍仅对应各自历史输入;本轮未重跑测试。
完整新候选门禁、R1真实入口接入与12项公网义务仍开放。生产编号未启用、差旅仍冻结;不推送、不部署,不宣称发布资格。
这个提交包含在:
2026-09-19 13:11:04 +08:00
父节点 729d90576f
当前提交 1f8d5b658a
共修改 367 个文件,包含 21079 行新增和 12287 行删除
+26 -21
查看文件
@@ -1,6 +1,5 @@
import { test, expect } from "./helpers/fixtures";
import { EMPLOYEE, login, logout } from "./helpers/auth";
import { TEST_IDS } from "./helpers/testIds";
import { EMPLOYEE, FINANCE, login, logout } from "./helpers/auth";
import { openNavLink } from "./helpers/navigation";
async function createBlankReimbursement(page: import("@playwright/test").Page) {
@@ -29,23 +28,14 @@ test("E2E 轻交互 OCR:报销详情上传后自动添加并提交", async ({
const reimbursementId = await createBlankReimbursement(page);
await expect(page).toHaveURL(new RegExp(`/reimbursements/${reimbursementId}$`));
await reimbursementDetail.assertLoaded();
await reimbursementDetail.addItem();
await page.getByTestId(TEST_IDS.reimbursement.invoiceAdd).click();
await expect(page.getByRole("dialog", { name: "添加发票" })).toBeVisible();
// Historical title retained for result mapping; current UX explicitly confirms binding.
const marker = `MOCK_R73_SUCCESS_${Date.now()}`;
const invoiceFileName = `r73-success-${Date.now()}.pdf`;
await page.getByTestId(TEST_IDS.reimbursement.invoiceUploadFile).setInputFiles({
name: invoiceFileName,
mimeType: "application/pdf",
buffer: Buffer.from(`%PDF-1.4\n${marker}\n%%EOF\n`, "utf8"),
});
await page.getByTestId(TEST_IDS.reimbursement.invoiceUploadSubmit).scrollIntoViewIfNeeded();
await page.getByTestId(TEST_IDS.reimbursement.invoiceUploadSubmit).click();
await expect(page.getByTestId(TEST_IDS.reimbursement.invoices)).toContainText(invoiceFileName, { timeout: 90_000 });
await page.keyboard.press("Escape");
await expect(page.getByTestId(TEST_IDS.reimbursement.invoiceDialog)).toHaveCount(0);
await reimbursementDetail.uploadInvoicePdf(
`r73-success-${Date.now()}.pdf`,
Buffer.from(`%PDF-1.4\n${marker}\n%%EOF\n`, "utf8"),
);
await reimbursementDetail.submitReimbursement();
await expect(page.getByText(/reviewing|审批中/).first()).toBeVisible({ timeout: 30_000 });
@@ -54,20 +44,26 @@ test("E2E 轻交互 OCR:报销详情上传后自动添加并提交", async ({
});
test("E2E 轻交互 OCR:票据缺关键字段后可在当前页修正并标记可用", async ({ page }) => {
test.skip(process.env.PLAYWRIGHT_OCR_MOCK !== "1", "需要 mock OCR 环境和 OCR 作业开启");
test.skip(process.env.E2E_MODE === "live" || process.env.PLAYWRIGHT_OCR_MOCK !== "1", "需要本地受管 mock OCR 环境和 OCR 作业开启");
await login(page, EMPLOYEE);
await login(page, FINANCE);
await (await openNavLink(page, "票据")).click();
await expect(page.getByTestId("invoice-pool-table")).toBeVisible();
const filename = `r73-missing-${Date.now()}.pdf`;
await page.getByRole("button", { name: "上传票据" }).click();
await page.getByTestId("invoice-upload-file").setInputFiles({
name: `r73-missing-${Date.now()}.pdf`,
name: filename,
mimeType: "application/pdf",
buffer: Buffer.from("%PDF-1.4\nMOCK_OCR_MISSING:invoiceCode,sellerName\n%%EOF\n", "utf8"),
});
const uploaded = page.waitForResponse(response => new URL(response.url()).pathname === "/api/invoice-pool/upload" && response.request().method() === "POST");
await page.getByTestId("invoice-upload-submit").click();
const upload = await uploaded;
expect(upload.ok()).toBe(true);
const invoiceId = (await upload.json()).data.invoicePoolId as string;
await expect(page).toHaveURL(url => url.pathname === "/invoice-pool" && url.searchParams.get("id") === invoiceId);
await expect(page.getByTestId("invoice-detail-panel")).toContainText("状态:识别失败", { timeout: 90_000 });
await expect(page.getByTestId("invoice-ocr-status-banner")).toContainText("票据识别缺少关键字段:发票代码、销售方。");
@@ -84,5 +80,14 @@ test("E2E 轻交互 OCR:票据缺关键字段后可在当前页修正并标记
await expect(page.getByTestId("invoice-detail-panel")).toContainText("状态:可用", { timeout: 30_000 });
await expect(page.getByTestId("invoice-detail-panel")).toContainText("北京悦海堂餐饮管理有限公司");
await logout(page, EMPLOYEE.name);
await expect(page).toHaveURL(url => url.searchParams.get("id") === invoiceId);
await page.getByRole("button", { name: "返回列表", exact: true }).click();
await expect(page).toHaveURL(url => url.pathname === "/invoice-pool" && !url.searchParams.has("id"));
const row = page.getByRole("row").filter({ hasText: filename });
await row.getByRole("button", { name: "more_horiz", exact: true }).click();
await page.getByTestId("invoice-detail-button").click();
await expect(page).toHaveURL(url => url.searchParams.get("id") === invoiceId);
await expect(page.getByTestId("invoice-detail-panel")).toContainText("状态:可用");
await expect(page.getByTestId("invoice-detail-panel")).toContainText("北京悦海堂餐饮管理有限公司");
await logout(page, FINANCE.name);
});