feat(in-transit-transfer): 调拨类型配置化与库存异动档原子切换
调拨类型从四处硬编码升级为管理页可配置:范围规则(受控字段白名单,规则间且/值间或)、 仓库定义(映射档/固定仓双模式角色解析)、字段转换(批号前缀替换,匹配时快照固化到 scope_json)。 新建 transfer_movement_ledger 库存异动档(参照 ERP inaj_t):自然键幂等增量落档 (插入/换证更新/跳过/缺席不删/执行封存永不触碰),圈档互斥保证一条档记录一生只绑一次明细; 收料证据落地改写档、停写 items。transfer_invoice_items 出生翻转为匹配时从档圈定创建 (一次匹配永久写入 matching_id+ledger_record_id),回查对账/取消释放/执行门禁/待匹配桶全链路适配。 迁移 tt10→tt13 单 head:类型配置表、异动档、items 档外键、transfer_runs.transfer_type 放宽 String(64)。 随行披露:设计文档与实施计划、ADR 0001/0002、in-transit-transfer 术语表、 demand/funclist/technical 文档更新同批入库。
This commit is contained in:
1 parent
28d6085d07
commit
52c71ee46a
78 files changed
+7423
-1702
No files matched your search
@@ -18,7 +18,8 @@ def _headers() -> dict[str, str]:
|
||||
|
||||
|
||||
def test_movement_fields_returns_fixed_catalog(app, client):
|
||||
"""标准异动字段目录:10 个定死字段、顺序稳定、必填/身份标记与契约一致。"""
|
||||
"""标准异动字段目录:18 个定死字段(11 核心 + 2026-10-14 扩展 7 可选维度)、
|
||||
顺序稳定、必填/身份标记与契约一致。"""
|
||||
app.config['AUTH_JWT_REQUIRED'] = False
|
||||
with app.app_context():
|
||||
from app.models import User
|
||||
@@ -33,6 +34,8 @@ def test_movement_fields_returns_fixed_catalog(app, client):
|
||||
assert [field['code'] for field in data] == [
|
||||
'doc_no', 'line_no', 'in_out_flag', 'material_code', 'material_name',
|
||||
'warehouse_code', 'storage_code', 'lot_no', 'quantity', 'movement_date',
|
||||
'unit',
|
||||
'line_seq', 'specification', 'order_type', 'odm_id', 'odm_name', 'carton_id', 'pallet_id',
|
||||
]
|
||||
required = {field['code'] for field in data if field['required']}
|
||||
assert required == {'doc_no', 'material_code', 'quantity', 'movement_date'}
|
||||
|
||||
Reference in new issue
Block a user