name: bill-sales-retail description: 零售销售单据表 - 记录零售销售业务数据 license: MIT compatibility: opencode metadata: category: database domain: retail-erp table_type: transaction
| 字段名 | 数据类型 | 查询用途 |
|---|---|---|
| id | varchar(50) | 主键ID |
| tenant_id | varchar(50) | 租户ID,必须包含在查询条件中 |
| bill_id | varchar(50) | 单据编号 |
| bill_type | varchar(20) | 单据类型:SALE销售/RETURN退货/ADJUST调整 |
| bill_status | varchar(20) | 单据状态:DRAFT/SUBMITTED/APPROVED/COMPLETED/CANCELLED |
| store_id | varchar(50) | 店铺ID,关联master_store |
| company_id | varchar(50) | 公司ID,关联master_company |
| product_id | varchar(50) | 商品ID,关联master_product |
| settlement_qty | decimal(12,4) | 结算数量,用于销售数量统计 |
| settlement_price | decimal(12,2) | 结算单价 |
| discount_rate | decimal(5,4) | 折扣率 |
| settlement_amount | decimal(12,2) | 结算金额 = qty × price × (1 - discount_rate) |
| sure_status | int | 登账标识:0草稿/1已登账,查询必须为1 |
| sure_date | date | 登账日期,默认查询日期字段 |
| created_at | datetime | 创建时间 |