-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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: payment request rounding in multi-currency and on status update #37123
fix: payment request rounding in multi-currency and on status update #37123
Conversation
096caee
to
47feb5f
Compare
This comment was marked as resolved.
This comment was marked as resolved.
47feb5f
to
6e1ad4c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #37123 +/- ##
===========================================
+ Coverage 66.56% 66.62% +0.06%
===========================================
Files 793 793
Lines 62468 62501 +33
===========================================
+ Hits 41582 41644 +62
+ Misses 20886 20857 -29
|
@@ -249,7 +249,7 @@ def create_payment_entry(self, submit=True): | |||
if ( | |||
party_account_currency == ref_doc.company_currency and party_account_currency != self.currency | |||
): | |||
party_amount = ref_doc.base_grand_total | |||
party_amount = ref_doc.get("base_rounded_total") or ref_doc.get("base_grand_total") |
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 this apply to the other branch of the condition as well?
(party_amount = self.get("rounded_total") or self.get("grand_total")
)
Probably not the issue you're trying to solve, but good for consistency and in accordance with other parts of the code.
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.
@barredterra 'Payment Request' doctype doesn't have rounded_total
.
@blaggacao Tried some scenarios and change works fine. If you can add a test case for this, we can merge it. |
…-37123 fix: payment request rounding in multi-currency and on status update (backport #37123)
Follow up on #36844
Context
Proposed Solution
abandonded due to issue note in this comment
Rather rely on
set_grand_total_and_outstanding_amount
invoked byget_payment_entry
which fetchesthe right amounts when no
party_amount
is passed:Similarily, rely on
set_party_account
andset_party_account_currency
, respectively, instead of the removed portions of code.base_rounded_total
if exists according to other examples of fetching a refdoc total values throughout the code.