1
0
forked from erp-dev/erp

feat: add discount_amount to payment_order and receipt_order, and change total_amount logic

This commit is contained in:
2025-12-04 09:36:59 +08:00
parent 0b8146d972
commit d8eb66821e
19 changed files with 1144 additions and 398 deletions

View File

@@ -22,8 +22,18 @@
|-----|------|------|
| `/customers/<id>/statements/` | GET | 指定客户的销售、销退、收款对账单 |
| `/suppliers/<id>/statements/` | GET | 指定供应商的采购、采退、付款对账单 |
| `/statements/record/` | GET | 通过主体 + 单据信息查询单条对账记录 |
请求无需额外参数;分页暂不开放(按时间倒序返回全部记录)。
请求无需额外参数;分页暂不开放(按时间倒序返回全部记录)。单条记录查询则必须提供如下 Query 参数:
| 参数 | 说明 |
|------|------|
| `counterparty_type` | 业务主体类型,`customer``supplier` |
| `counterparty_id` | 对应客户或供应商 ID |
| `order_type` | 单据类型,取值与 `source_type` 一致,例如 `sales_order``purchase_order` 等 |
| `order_id` | 单据 ID |
> ⚠️ 由于底层仍需构建完整对账单后再筛选匹配记录,在大体量数据下应谨慎调用此接口。
---
@@ -74,6 +84,12 @@
}
```
### 3.1 单条记录查询示例
`GET /api/v1/statements/record/?counterparty_type=customer&counterparty_id=6&order_type=sales_order&order_id=1024`
返回结构与对账单列表保持一致,仅 `records` 数组只包含匹配的那一条记录,`summary` 会基于该数组重新计算。
### 字段说明
| 字段 | 说明 |