fix(goods): lock voucher before posting (H34) #52
Loading…
Reference in a new issue
No description provided.
Delete branch "Seyyed/Seyyed_arc:codex/team-base-13-h34-goods-post-idempotency"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
H34
Lock the goods expense/income voucher and refresh its current state before the existing status check, in the transaction that posts the warehouse movement and GL. Repeated requests retain the existing INVALID_STATUS (400) response.
On team base
2354c27d50, an expired database snapshot held in a live ORM identity map allowed a second posting. Starting from 10 units with a 2-unit voucher at cost 200, the stale request produced stock of 6 for expense and 14 for income, with two warehouse vouchers and two balanced GL documents of 400 each. After the fix, stock is 8 or 12 and each voucher has a single warehouse movement and a single balanced GL document of 400.Verification