refactor: assume any of the foreign currency as transaction currency

On a foreign currency payment entry, assume any one of the foreign
currency as the transaction currency
This commit is contained in:
ruthra kumar
2024-11-18 16:25:44 +05:30
parent 4a1cd5a8d6
commit 6681882bd8

View File

@@ -1243,6 +1243,12 @@ class PaymentEntry(AccountsController):
if self.payment_type in ("Receive", "Pay") and not self.get("party_account_field"):
self.setup_party_account_field()
company_currency = erpnext.get_company_currency(self.company)
if self.paid_from_account_currency != company_currency:
self.currency = self.paid_from_account_currency
elif self.paid_to_account_currency != company_currency:
self.currency = self.paid_to_account_currency
gl_entries = []
self.add_party_gl_entries(gl_entries)
self.add_bank_gl_entries(gl_entries)