fix(backend): 往来单位下拉返回全部 + 入库售价写入产品

- partner List 分页上限 200→1000:避免下拉请求大页被 ValidatePageSize
  回退到默认 20(超上限返回默认值而非截断),供应商/客户下拉一次取全部
- 入库明细 sale_price 建独立产品时写入 product.SalePrice(建议售价);
  SalePrice 为 gorm:"-" 仅作建库入参,不落 stock_in_items 表
- 补 partner 大页返回全部、入库售价入产品两条回归测试

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-02 11:44:50 +08:00
parent 1bd8b8f877
commit d0c71a9252
6 changed files with 70 additions and 4 deletions
+2
View File
@@ -42,6 +42,8 @@ type StockInItem struct {
Spec string `gorm:"size:100" json:"spec"`
Quantity float64 `gorm:"type:decimal(12,3);not null" json:"quantity"`
UnitPrice float64 `gorm:"type:decimal(16,2);default:0" json:"unit_price"`
// 建议售价:仅用于入库建产品时写入 product.SalePrice,不落 stock_in_items 表(gorm:"-")。
SalePrice float64 `gorm:"-" json:"sale_price"`
TotalPrice float64 `gorm:"type:decimal(16,2);default:0" json:"total_price"`
// 已退数量:0=未退,=Quantity 表示整行已退单(整行退,不做部分数量)
ReturnedQuantity float64 `gorm:"type:decimal(12,3);default:0" json:"returned_quantity"`