-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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: honour currency precision while fetching balance #38218
fix: honour currency precision while fetching balance #38218
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #38218 +/- ##
========================================
Coverage 60.14% 60.15%
========================================
Files 757 757
Lines 70696 70697 +1
========================================
+ Hits 42523 42527 +4
+ Misses 28173 28170 -3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we round the output of the calculation instead of the input?
return flt(bal, precision)
This is also a bit more robust than formatting query strings.
Tried that, but mismatch still occurred in GL and Bank Reco Statemaent. We shouldn't ideally be storing more decimals in GL Entries than required tbh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, makes sense. In this case, let's at least use SQL parameters instead of f-strings?
What you did is still python string formatting, not SQL params. ;) What I meant was passsing the |
61f27bb
to
383a4b1
Compare
Sorry my bad, rest of the code was in that structure which is why I got confused. |
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
Co-authored-by: Raffael Meyer <[email protected]>
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
…-38218 fix: honour currency precision while fetching balance (backport #38218)
GL Balance:
GL Balance as per Bank Reco Statement:
When multi-currency is involved, entries are made with decimals containing more than
currency_precision
. Which in turn causes difference as shown above. We should have a validation in GL Entry to trim off extra decimals. Thoughts?