codex/fix: qty 0 after PO to farm-level warehouse

This commit is contained in:
Adnan Zahir
2026-04-01 16:14:07 +07:00
parent 5ffb72507b
commit 7b4bf94329
4 changed files with 119 additions and 0 deletions
@@ -47,6 +47,17 @@ func reflowPurchaseScope(
AsOf: asOf,
Tx: tx,
})
if err != nil {
return err
}
_, err = fifoStockV2Svc.Recalculate(ctx, commonSvc.FifoStockV2RecalculateRequest{
ProductWarehouseIDs: []uint{productWarehouseID},
FlagGroupCodes: []string{flagGroupCode},
AsOf: asOf,
FixDrift: true,
Tx: tx,
})
return err
}