{ "summary": [ { "name": "sales_ledger", "title": "销售记账表", "primary": ["id"], "catelog": "relation" } ], "fields": [ { "name": "id", "title": "主键ID", "type": "str", "length": 32, "nullable": "no" }, { "name": "resellerid", "title": "所属分销商机构ID", "type": "str", "length": 32, "nullable": "no" }, { "name": "sub_reseller_id", "title": "二级分销商ID", "type": "str", "length": 32 }, { "name": "supplier_id", "title": "供应商ID", "type": "str", "length": 32 }, { "name": "agreement_id", "title": "分销协议ID", "type": "str", "length": 32 }, { "name": "contract_id", "title": "供销合同ID", "type": "str", "length": 32 }, { "name": "prodtypeid", "title": "产品分类ID", "type": "str", "length": 32 }, { "name": "productid", "title": "产品ID", "type": "str", "length": 32 }, { "name": "sale_date", "title": "销售日期", "type": "date", "nullable": "no" }, { "name": "quantity", "title": "销售数量", "type": "double", "length": 15, "dec": 2, "nullable": "no" }, { "name": "unit_price", "title": "销售单价", "type": "double", "length": 15, "dec": 4, "nullable": "no" }, { "name": "supply_discount", "title": "进货折扣", "type": "double", "length": 5, "dec": 4 }, { "name": "supply_amount", "title": "进货金额", "type": "double", "length": 15, "dec": 2 }, { "name": "distribution_discount", "title": "分销折扣", "type": "double", "length": 5, "dec": 4 }, { "name": "distribution_amount", "title": "分销金额", "type": "double", "length": 15, "dec": 2 }, { "name": "profit_amount", "title": "利润金额", "type": "double", "length": 15, "dec": 2 }, { "name": "settlement_status", "title": "结算状态", "type": "char", "length": 1, "nullable": "no", "default": "0" }, { "name": "remark", "title": "备注", "type": "text" }, { "name": "created_by", "title": "创建人", "type": "str", "length": 32 }, { "name": "created_at", "title": "创建时间", "type": "datetime", "nullable": "no" }, { "name": "updated_at", "title": "更新时间", "type": "datetime" } ], "indexes": [ { "name": "idx_sl_reseller", "idxtype": "index", "idxfields": ["resellerid"] }, { "name": "idx_sl_sale_date", "idxtype": "index", "idxfields": ["sale_date"] }, { "name": "idx_sl_product", "idxtype": "index", "idxfields": ["prodtypeid", "productid"] }, { "name": "idx_sl_sub_reseller", "idxtype": "index", "idxfields": ["sub_reseller_id"] }, { "name": "idx_sl_supplier", "idxtype": "index", "idxfields": ["supplier_id"] } ], "codes": [ { "field": "sub_reseller_id", "table": "sub_resellers", "valuefield": "id", "textfield": "sub_reseller_name" }, { "field": "supplier_id", "table": "suppliers", "valuefield": "id", "textfield": "supplier_name" }, { "field": "agreement_id", "table": "distribution_agreements", "valuefield": "id", "textfield": "agreement_name" }, { "field": "contract_id", "table": "supply_contracts", "valuefield": "id", "textfield": "contract_name" }, { "field": "resellerid", "table": "organization", "valuefield": "id", "textfield": "orgname" } ] }