fix: difference amount calculation for company currency accounts
This commit is contained in:
parent
1d767d58f2
commit
48fae0c1ce
@ -221,12 +221,15 @@ class PaymentReconciliation(Document):
|
|||||||
|
|
||||||
def get_difference_amount(self, payment_entry, invoice, allocated_amount):
|
def get_difference_amount(self, payment_entry, invoice, allocated_amount):
|
||||||
difference_amount = 0
|
difference_amount = 0
|
||||||
if invoice.get("exchange_rate") and payment_entry.get("exchange_rate", 1) != invoice.get(
|
if frappe.get_cached_value(
|
||||||
"exchange_rate", 1
|
"Account", self.receivable_payable_account, "account_currency"
|
||||||
):
|
) != frappe.get_cached_value("Company", self.company, "default_currency"):
|
||||||
allocated_amount_in_ref_rate = payment_entry.get("exchange_rate", 1) * allocated_amount
|
if invoice.get("exchange_rate") and payment_entry.get("exchange_rate", 1) != invoice.get(
|
||||||
allocated_amount_in_inv_rate = invoice.get("exchange_rate", 1) * allocated_amount
|
"exchange_rate", 1
|
||||||
difference_amount = allocated_amount_in_ref_rate - allocated_amount_in_inv_rate
|
):
|
||||||
|
allocated_amount_in_ref_rate = payment_entry.get("exchange_rate", 1) * allocated_amount
|
||||||
|
allocated_amount_in_inv_rate = invoice.get("exchange_rate", 1) * allocated_amount
|
||||||
|
difference_amount = allocated_amount_in_ref_rate - allocated_amount_in_inv_rate
|
||||||
|
|
||||||
return difference_amount
|
return difference_amount
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user