diff --git a/models/financial_vouchers.json b/models/financial_vouchers.json index 90ea398..6b924fb 100644 --- a/models/financial_vouchers.json +++ b/models/financial_vouchers.json @@ -1,123 +1,137 @@ { - "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": [] + "summary": [ + { + "name": "financial_vouchers", + "title": "财务凭证", + "primary": "id", + "catelog": "entity" + } + ], + "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": [] } \ No newline at end of file diff --git a/models/payments.json b/models/payments.json index 9fe961f..efebbb9 100644 --- a/models/payments.json +++ b/models/payments.json @@ -1,141 +1,153 @@ { - "summary": { - "tablename": "payments", - "label": "支出记录", - "comment": "支出管理,关联已核销的合同收款" - }, - "fields": [ - { - "name": "id", - "title": "ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "主键" - }, - { - "name": "payment_number", - "title": "支出编号", - "type": "str", - "length": 64, - "nullable": false, - "comments": "支出编号" - }, - { - "name": "contract_id", - "title": "合同ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "关联合同ID(必须是已核销收款的合同)" - }, - { - "name": "vendor_id", - "title": "供应商ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "供应商ID" - }, - { - "name": "payment_amount", - "title": "支出金额", - "type": "decimal", - "length": "15,2", - "nullable": false, - "comments": "支出金额" - }, - { - "name": "payment_date", - "title": "支出日期", - "type": "date", - "nullable": false, - "comments": "实际支出日期" - }, - { - "name": "payment_method", - "title": "支出方式", - "type": "str", - "length": 32, - "nullable": false, - "comments": "支出方式: bank_transfer, cash, check, other" - }, - { - "name": "payment_status", - "title": "支出状态", - "type": "str", - "length": 32, - "nullable": false, - "comments": "状态: pending(待处理), processed(已处理), verified(已核销)" - }, - { - "name": "description", - "title": "备注", - "type": "str", - "length": 500, - "nullable": true, - "comments": "备注信息" - }, - { - "name": "approved_by", - "title": "审批人", - "type": "str", - "length": 64, - "nullable": true, - "comments": "审批人ID" - }, - { - "name": "created_by", - "title": "创建人", - "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": "创建时间" - }, - { - "name": "updated_at", - "title": "更新时间", - "type": "timestamp", - "nullable": false, - "comments": "更新时间" - } - ], - "indexes": [ - { - "name": "idx_payments_contract_id", - "idxtype": "index", - "columns": ["contract_id"] - }, - { - "name": "idx_payments_payment_number", - "idxtype": "unique", - "columns": ["payment_number", "org_id"] - }, - { - "name": "idx_payments_org_id", - "idxtype": "index", - "columns": ["org_id"] - }, - { - "name": "idx_payments_status", - "idxtype": "index", - "columns": ["payment_status"] - } - ], - "codes": [] + "summary": [ + { + "name": "payments", + "title": "支出记录", + "primary": "id", + "catelog": "entity" + } + ], + "fields": [ + { + "name": "id", + "title": "ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "主键" + }, + { + "name": "payment_number", + "title": "支出编号", + "type": "str", + "length": 64, + "nullable": false, + "comments": "支出编号" + }, + { + "name": "contract_id", + "title": "合同ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "关联合同ID(必须是已核销收款的合同)" + }, + { + "name": "vendor_id", + "title": "供应商ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "供应商ID" + }, + { + "name": "payment_amount", + "title": "支出金额", + "type": "decimal", + "length": "15,2", + "nullable": false, + "comments": "支出金额" + }, + { + "name": "payment_date", + "title": "支出日期", + "type": "date", + "nullable": false, + "comments": "实际支出日期" + }, + { + "name": "payment_method", + "title": "支出方式", + "type": "str", + "length": 32, + "nullable": false, + "comments": "支出方式: bank_transfer, cash, check, other" + }, + { + "name": "payment_status", + "title": "支出状态", + "type": "str", + "length": 32, + "nullable": false, + "comments": "状态: pending(待处理), processed(已处理), verified(已核销)" + }, + { + "name": "description", + "title": "备注", + "type": "str", + "length": 500, + "nullable": true, + "comments": "备注信息" + }, + { + "name": "approved_by", + "title": "审批人", + "type": "str", + "length": 64, + "nullable": true, + "comments": "审批人ID" + }, + { + "name": "created_by", + "title": "创建人", + "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": "创建时间" + }, + { + "name": "updated_at", + "title": "更新时间", + "type": "timestamp", + "nullable": false, + "comments": "更新时间" + } + ], + "indexes": [ + { + "name": "idx_payments_contract_id", + "idxtype": "index", + "columns": [ + "contract_id" + ] + }, + { + "name": "idx_payments_payment_number", + "idxtype": "unique", + "columns": [ + "payment_number", + "org_id" + ] + }, + { + "name": "idx_payments_org_id", + "idxtype": "index", + "columns": [ + "org_id" + ] + }, + { + "name": "idx_payments_status", + "idxtype": "index", + "columns": [ + "payment_status" + ] + } + ], + "codes": [] } \ No newline at end of file diff --git a/models/receipt_allocations.json b/models/receipt_allocations.json index 55133d7..3d69533 100644 --- a/models/receipt_allocations.json +++ b/models/receipt_allocations.json @@ -1,103 +1,114 @@ { - "summary": { - "tablename": "receipt_allocations", - "label": "收款分配", - "comment": "收款在多个订单间的分配记录" - }, - "fields": [ - { - "name": "id", - "title": "ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "主键" - }, - { - "name": "receipt_id", - "title": "收款ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "关联的收款记录ID" - }, - { - "name": "order_id", - "title": "订单ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "关联的订单ID" - }, - { - "name": "receivable_id", - "title": "应收ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "关联的应收记录ID" - }, - { - "name": "allocated_amount", - "title": "分配金额", - "type": "decimal", - "length": "15,2", - "nullable": false, - "comments": "分配给该订单的金额" - }, - { - "name": "allocation_percentage", - "title": "分配比例", - "type": "decimal", - "length": "5,4", - "nullable": true, - "comments": "分配比例(0-1之间)" - }, - { - "name": "contract_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_allocations_receipt_id", - "idxtype": "index", - "columns": ["receipt_id"] - }, - { - "name": "idx_allocations_order_id", - "idxtype": "index", - "columns": ["order_id"] - }, - { - "name": "idx_allocations_receivable_id", - "idxtype": "index", - "columns": ["receivable_id"] - }, - { - "name": "idx_allocations_org_id", - "idxtype": "index", - "columns": ["org_id"] - } - ], - "codes": [] + "summary": [ + { + "name": "receipt_allocations", + "title": "收款分配", + "primary": "id", + "catelog": "entity" + } + ], + "fields": [ + { + "name": "id", + "title": "ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "主键" + }, + { + "name": "receipt_id", + "title": "收款ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "关联的收款记录ID" + }, + { + "name": "order_id", + "title": "订单ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "关联的订单ID" + }, + { + "name": "receivable_id", + "title": "应收ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "关联的应收记录ID" + }, + { + "name": "allocated_amount", + "title": "分配金额", + "type": "decimal", + "length": "15,2", + "nullable": false, + "comments": "分配给该订单的金额" + }, + { + "name": "allocation_percentage", + "title": "分配比例", + "type": "decimal", + "length": "5,4", + "nullable": true, + "comments": "分配比例(0-1之间)" + }, + { + "name": "contract_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_allocations_receipt_id", + "idxtype": "index", + "columns": [ + "receipt_id" + ] + }, + { + "name": "idx_allocations_order_id", + "idxtype": "index", + "columns": [ + "order_id" + ] + }, + { + "name": "idx_allocations_receivable_id", + "idxtype": "index", + "columns": [ + "receivable_id" + ] + }, + { + "name": "idx_allocations_org_id", + "idxtype": "index", + "columns": [ + "org_id" + ] + } + ], + "codes": [] } \ No newline at end of file diff --git a/models/receipts.json b/models/receipts.json index 5b55d71..84b15d3 100644 --- a/models/receipts.json +++ b/models/receipts.json @@ -1,125 +1,137 @@ { - "summary": { - "tablename": "receipts", - "label": "收款记录", - "comment": "客户收款记录管理" - }, - "fields": [ - { - "name": "id", - "title": "ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "主键" - }, - { - "name": "receipt_number", - "title": "收款编号", - "type": "str", - "length": 64, - "nullable": false, - "comments": "收款编号" - }, - { - "name": "customer_id", - "title": "客户ID", - "type": "str", - "length": 64, - "nullable": false, - "comments": "客户ID" - }, - { - "name": "total_amount", - "title": "收款总额", - "type": "decimal", - "length": "15,2", - "nullable": false, - "comments": "本次收款总金额" - }, - { - "name": "receipt_date", - "title": "收款日期", - "type": "date", - "nullable": false, - "comments": "实际收款日期" - }, - { - "name": "receipt_method", - "title": "收款方式", - "type": "str", - "length": 32, - "nullable": false, - "comments": "收款方式: bank_transfer, cash, check, other" - }, - { - "name": "receipt_status", - "title": "收款状态", - "type": "str", - "length": 32, - "nullable": false, - "comments": "状态: pending(待处理), processed(已处理), verified(已核销)" - }, - { - "name": "description", - "title": "备注", - "type": "str", - "length": 500, - "nullable": true, - "comments": "备注信息" - }, - { - "name": "created_by", - "title": "创建人", - "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": "创建时间" - }, - { - "name": "updated_at", - "title": "更新时间", - "type": "timestamp", - "nullable": false, - "comments": "更新时间" - } - ], - "indexes": [ - { - "name": "idx_receipts_customer_id", - "idxtype": "index", - "columns": ["customer_id"] - }, - { - "name": "idx_receipts_receipt_number", - "idxtype": "unique", - "columns": ["receipt_number", "org_id"] - }, - { - "name": "idx_receipts_org_id", - "idxtype": "index", - "columns": ["org_id"] - }, - { - "name": "idx_receipts_status", - "idxtype": "index", - "columns": ["receipt_status"] - } - ], - "codes": [] + "summary": [ + { + "name": "receipts", + "title": "收款记录", + "primary": "id", + "catelog": "entity" + } + ], + "fields": [ + { + "name": "id", + "title": "ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "主键" + }, + { + "name": "receipt_number", + "title": "收款编号", + "type": "str", + "length": 64, + "nullable": false, + "comments": "收款编号" + }, + { + "name": "customer_id", + "title": "客户ID", + "type": "str", + "length": 64, + "nullable": false, + "comments": "客户ID" + }, + { + "name": "total_amount", + "title": "收款总额", + "type": "decimal", + "length": "15,2", + "nullable": false, + "comments": "本次收款总金额" + }, + { + "name": "receipt_date", + "title": "收款日期", + "type": "date", + "nullable": false, + "comments": "实际收款日期" + }, + { + "name": "receipt_method", + "title": "收款方式", + "type": "str", + "length": 32, + "nullable": false, + "comments": "收款方式: bank_transfer, cash, check, other" + }, + { + "name": "receipt_status", + "title": "收款状态", + "type": "str", + "length": 32, + "nullable": false, + "comments": "状态: pending(待处理), processed(已处理), verified(已核销)" + }, + { + "name": "description", + "title": "备注", + "type": "str", + "length": 500, + "nullable": true, + "comments": "备注信息" + }, + { + "name": "created_by", + "title": "创建人", + "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": "创建时间" + }, + { + "name": "updated_at", + "title": "更新时间", + "type": "timestamp", + "nullable": false, + "comments": "更新时间" + } + ], + "indexes": [ + { + "name": "idx_receipts_customer_id", + "idxtype": "index", + "columns": [ + "customer_id" + ] + }, + { + "name": "idx_receipts_receipt_number", + "idxtype": "unique", + "columns": [ + "receipt_number", + "org_id" + ] + }, + { + "name": "idx_receipts_org_id", + "idxtype": "index", + "columns": [ + "org_id" + ] + }, + { + "name": "idx_receipts_status", + "idxtype": "index", + "columns": [ + "receipt_status" + ] + } + ], + "codes": [] } \ No newline at end of file diff --git a/models/receivables.json b/models/receivables.json index e5bd81b..5535836 100644 --- a/models/receivables.json +++ b/models/receivables.json @@ -89,9 +89,12 @@ ] } ], - "summary": { - "tablename": "receivables", - "label": "应收款项", - "comment": "合同应收款项管理" - } + "summary": [ + { + "name": "receivables", + "title": "应收款项", + "primary": "id", + "catelog": "entity" + } + ] } \ No newline at end of file