-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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: batch negative qty validation #28782
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
batch's ledger is only maintained in form of `actual_qty` on batch's SLEs. To validate if batch has any negative qty in future, cumulative total of `actual_qty` is required to ensure it never goes negative.
This check was only checking total sum, which is problamatic when making backdated entries that can cause intermediate values to go negative while overall values stay positive.
ankush
force-pushed
the
batch_neg_check
branch
from
December 8, 2021 07:37
2caa9f7
to
42c1b44
Compare
ankush
force-pushed
the
batch_neg_check
branch
from
December 8, 2021 07:59
42c1b44
to
5977c4d
Compare
ankush
commented
Dec 8, 2021
Codecov Report
@@ Coverage Diff @@
## develop #28782 +/- ##
===========================================
+ Coverage 46.80% 55.27% +8.47%
===========================================
Files 1122 1122
Lines 66777 66782 +5
===========================================
+ Hits 31255 36915 +5660
+ Misses 35522 29867 -5655
|
@Mergifyio backport version-12-hotfix |
✅ Backports have been created
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
continuation from #27945
Change:
The simplest way to reproduce:
Observed: The Batch didn't exist at this time. The transaction gets submitted without any warning/error.
Expected: Transaction can't be submitted.
More use cases:
TODO: