fix: 立账凭证发票号取oma75; 优化前端懒加载
This commit is contained in:
1 parent
0e4e581f9a
commit
d7d1ad522a
22 files changed
+245
-54
No files matched your search
@@ -24,12 +24,13 @@ from app.services.voucher_check.profiles.sales import SALES_PROFILE, required_fi
|
||||
|
||||
|
||||
def test_invoice_sql_reads_confirmed_oma_file():
|
||||
"""销售 invoice 清单来自 oma_file:已确认、未作废、状况码 1、帐款类别 11/12/13;oma10 至少 6 位字母或数字。"""
|
||||
"""销售 invoice 清单来自 oma_file:已确认、未作废、状况码 1、帐款类别 11/12/13;oma75 至少 6 位字母或数字。"""
|
||||
sql = " ".join(_INVOICE_SQL.split())
|
||||
assert "FROM oma_file" in sql
|
||||
assert "TRIM(oma10)" in sql
|
||||
assert "TRIM(oma75)" in sql
|
||||
assert "TRUNC(oma02)" in sql
|
||||
assert "REGEXP_LIKE(TRIM(oma10), '^[A-Za-z0-9]{6,}$')" in sql
|
||||
assert "REGEXP_LIKE(TRIM(oma75), '^[A-Za-z0-9]{6,}$')" in sql
|
||||
assert "oma10" not in sql
|
||||
assert "TRIM(omaconf) = 'Y'" in sql
|
||||
assert "TRIM(omavoid) = 'N'" in sql
|
||||
assert "TRIM(oma64) = '1'" in sql
|
||||
|
||||
@@ -18,6 +18,7 @@ from app.services.voucher_check.adapters.erp_po_print import ErpPoPrintAdapter
|
||||
from app.services.voucher_check.erp_po_repository import (
|
||||
INVOICE_SCHEMA,
|
||||
PO_SCHEMA,
|
||||
_invoice_key_sql,
|
||||
_po_detail_sql,
|
||||
fetch_po_documents_for_invoices,
|
||||
map_po_document,
|
||||
@@ -58,6 +59,15 @@ _OMA_COLS = ["invoice_no", "oma00", "oma16", "oma99"]
|
||||
_FLOW_COLS = ["doc_no", "flow_no"]
|
||||
|
||||
|
||||
def test_invoice_key_sql_matches_subject_invoice_on_oma75():
|
||||
"""PO 回查发票必须按 oma75,与主体清单同源,不能再用 oma10。"""
|
||||
sql = " ".join(_invoice_key_sql(":inv0").split())
|
||||
assert f"FROM {INVOICE_SCHEMA}.oma_file" in sql
|
||||
assert "TRIM(oma75) AS invoice_no" in sql
|
||||
assert "TRIM(oma75) IN" in sql
|
||||
assert "oma10" not in sql
|
||||
|
||||
|
||||
def test_po_sql_targets_tghx_and_trims_flow_no():
|
||||
"""采购单必须查 TGHX,并用 TRIM(pmm99) 对多角序号。"""
|
||||
sql = " ".join(_po_detail_sql(":flow0").split())
|
||||
|
||||
Reference in new issue
Block a user