fix: adjusment module depletion, chickin, recording refactor

This commit is contained in:
Hafizh A. Y
2026-02-28 21:35:07 +07:00
parent 944604adad
commit dd61b66af0
11 changed files with 1906 additions and 1343 deletions
@@ -487,16 +487,12 @@ func (s *fifoStockV2Service) Reflow(ctx context.Context, req ReflowRequest) (*Re
continue
}
asOf := usableRow.SortAt
if req.AsOf != nil && asOf.Before(*req.AsOf) {
asOf = *req.AsOf
}
allocateRes, allocateErr := s.allocateInternal(ctx, tx, AllocateRequest{
FlagGroupCode: req.FlagGroupCode,
ProductWarehouseID: req.ProductWarehouseID,
Usable: usableRow.Ref,
NeedQty: desiredQty,
AsOf: &asOf,
AsOf: nil,
})
if allocateErr != nil {
err = allocateErr