Skip to content

Commit

Permalink
fix: Update get_amount to return currency precision grand total
Browse files Browse the repository at this point in the history
In case of multi-currency purchase invoice, we are getting the error "Total Payment Request amount cannot be greater than Purchase Invoice amount" because of rounding difference.
  • Loading branch information
mujeerhashmi authored Jul 24, 2024
1 parent 8141c65 commit 976abf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/accounts/doctype/payment_request/payment_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate
from erpnext.accounts.party import get_party_account, get_party_bank_account
from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.utils import get_account_currency, get_currency_precision
from erpnext.utilities import payment_app_import_guard


Expand Down Expand Up @@ -540,7 +540,7 @@ def get_amount(ref_doc, payment_account=None):
grand_total = ref_doc.outstanding_amount

if grand_total > 0:
return grand_total
return flt(grand_total, get_currency_precision())
else:
frappe.throw(_("Payment Entry is already created"))

Expand Down

0 comments on commit 976abf7

Please sign in to comment.