{ "summary": { "tablename": "financial_vouchers", "label": "财务凭证", "comment": "财务凭证记录,关联合同和订单" }, "fields": [ { "name": "id", "title": "ID", "type": "str", "length": 64, "nullable": false, "comments": "主键" }, { "name": "voucher_number", "title": "凭证编号", "type": "str", "length": 64, "nullable": false, "comments": "凭证编号" }, { "name": "voucher_type", "title": "凭证类型", "type": "str", "length": 32, "nullable": false, "comments": "凭证类型: receipt(收款), payment(支出)" }, { "name": "contract_id", "title": "合同ID", "type": "str", "length": 64, "nullable": false, "comments": "关联合同ID" }, { "name": "order_id", "title": "订单ID", "type": "str", "length": 64, "nullable": true, "comments": "关联订单ID(可为空,用于合同级凭证)" }, { "name": "amount", "title": "金额", "type": "decimal", "length": "15,2", "nullable": false, "comments": "凭证金额" }, { "name": "voucher_date", "title": "凭证日期", "type": "date", "nullable": false, "comments": "凭证日期" }, { "name": "description", "title": "凭证描述", "type": "str", "length": 500, "nullable": false, "comments": "凭证描述,包含合同编号和订单编号" }, { "name": "reference_id", "title": "引用ID", "type": "str", "length": 64, "nullable": false, "comments": "引用的收款或支出记录ID" }, { "name": "org_id", "title": "组织ID", "type": "str", "length": 64, "nullable": false, "comments": "组织ID,用于多租户隔离" }, { "name": "created_at", "title": "创建时间", "type": "timestamp", "nullable": false, "comments": "创建时间" } ], "indexes": [ { "name": "idx_vouchers_contract_id", "idxtype": "index", "columns": ["contract_id"] }, { "name": "idx_vouchers_order_id", "idxtype": "index", "columns": ["order_id"] }, { "name": "idx_vouchers_voucher_number", "idxtype": "unique", "columns": ["voucher_number", "org_id"] }, { "name": "idx_vouchers_org_id", "idxtype": "index", "columns": ["org_id"] }, { "name": "idx_vouchers_type", "idxtype": "index", "columns": ["voucher_type"] } ], "codes": [] }