fix: Include Stock Reco logic in update_qty_in_future_sle
#26158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
update_qty_in_future_sle
and a missing case for stock reconciliationsFix:
Cases
Consider:
Post a backdated reco 1 on the 1st for qty 8. The shift in qty is 8 since there is no transaction before this reco. The future SLE balances are shifted by 8.
10910Post a backdated reco 2 on the 4th for qty 6. The shift in qty = current balance after reco 2 - previous balance before reco 2 = 6 - 9 = -3. The future SLE balances are shifted by -3
10If a reco (Reco 1) is posted on 4th (as previously seen) and then another reco (Reco 2) on the 1st, the qty recalculation after submitting Reco 2 must happen only till the 3rd (any time before Reco 1)
109Posting a backdated reco that causes future negative stock should be stopped