-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: incorrect bin qty on backdated reconciliation #28588
Conversation
6b68188
to
7f305fe
Compare
Codecov Report
@@ Coverage Diff @@
## develop #28588 +/- ##
===========================================
+ Coverage 55.59% 55.64% +0.04%
===========================================
Files 1128 1128
Lines 67285 67286 +1
===========================================
+ Hits 37404 37438 +34
+ Misses 29881 29848 -33
|
this (and all other cases of bin update) are broken in the case of intermediate stock reconciliation. refer: #26158 |
7f305fe
to
b1248fb
Compare
1edab32
to
58cc6d3
Compare
When making a backdated transactions current balance qty depends on evaluation of whole ledger inbetween, instead of doing that just fetch the last sle's qty_after_transaction when future transactions are detected against SLE fix: don't update bin's actual_qty 1. it's already updated by repost_current_voucher 2. update if future sle exists
58cc6d3
to
f58728a
Compare
uncovered lines intentionally don't run in the tests. coverage is 100% actually 😄 |
…-28588 fix: incorrect bin qty on backdated reconciliation (backport #28588)
Bin quantities are updated by adding actual_qty from current SLE to
Bin's qty. In stock reconciliation qty is "reset" hence
qty_after_transaction is used to set qty in bin.
However, in the case of backdated stock reconciliation, there are future
transactions that will affect the final sum of quantity available in bin.
Note: This gets auto-corrected after reposting finishes for backdated
transactions, but Bin shows wrong quantity till then. Bin is used in item
dashboard hence it's confusing. Also, reposting is only supposed to be
for valuation, qty should be correct in real-time.
Solution: Instead of overriding Bin's quantity, replace it with last sle qty in case of backdated transactions.
To test:
balance. (earlier this used to get reset to whatever stock reco
quantity was)
again.
Example transactions ordered by creation; more test cases on #26158