feat(backend): 入库「确认进价」前向补偿(暂估价→真实价)
调货 0 价入库并已审核/出库后,价格确定时补填真实进价:一事务内 回填入库明细/库存批次/已出库成本快照,重算入库单总额,按差额补 应付流水,同步参考进价。按 product_id 精确命中(序列号 1:1), 不动售价/应收。仅 approved 单、管理员/超管,差额幂等可重复确认。 新增 POST /stock-in/orders/:id/confirm-cost 及 4 个测试用例。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -66,6 +66,7 @@ func setupProtectedRouter(db *gorm.DB) *gin.Engine {
|
||||
stockIn.PUT("/orders/:id/reject", stockInH.Reject)
|
||||
stockIn.PUT("/orders/:id/withdraw", stockInH.Withdraw)
|
||||
stockIn.POST("/orders/:id/return", stockInH.Return)
|
||||
stockIn.POST("/orders/:id/confirm-cost", stockInH.ConfirmCost)
|
||||
|
||||
// 出库路由
|
||||
stockOut := api.Group("/stock-out")
|
||||
|
||||
Reference in New Issue
Block a user