mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix(payment entry): get amount in transaction currency
This commit is contained in:
@@ -1682,6 +1682,14 @@ class PaymentEntry(AccountsController):
|
|||||||
elif self.payment_type in ("Pay", "Internal Transfer"):
|
elif self.payment_type in ("Pay", "Internal Transfer"):
|
||||||
return self.paid_from
|
return self.paid_from
|
||||||
|
|
||||||
|
def get_value_in_transaction_currency(self, account_currency, gl_dict, field):
|
||||||
|
company_currency = erpnext.get_company_currency(self.company)
|
||||||
|
conversion_rate = self.target_exchange_rate
|
||||||
|
if self.paid_from_account_currency != company_currency:
|
||||||
|
conversion_rate = self.source_exchange_rate
|
||||||
|
|
||||||
|
return flt(gl_dict.get(field, 0) / (conversion_rate or 1))
|
||||||
|
|
||||||
def update_advance_paid(self):
|
def update_advance_paid(self):
|
||||||
if self.payment_type in ("Receive", "Pay") and self.party:
|
if self.payment_type in ("Receive", "Pay") and self.party:
|
||||||
advance_payment_doctypes = frappe.get_hooks(
|
advance_payment_doctypes = frappe.get_hooks(
|
||||||
|
|||||||
Reference in New Issue
Block a user