Merge pull request #43095 from aerele/common_party_on_foreign_currency

fix: check multi-currency on jv for common party accounting with foreign currency
This commit is contained in:
ruthra kumar
2024-09-09 10:34:47 +05:30
committed by GitHub
2 changed files with 88 additions and 0 deletions

View File

@@ -2455,6 +2455,8 @@ class AccountsController(TransactionBase):
primary_account = get_party_account(primary_party_type, primary_party, self.company)
secondary_account = get_party_account(secondary_party_type, secondary_party, self.company)
primary_account_currency = get_account_currency(primary_account)
secondary_account_currency = get_account_currency(secondary_account)
jv = frappe.new_doc("Journal Entry")
jv.voucher_type = "Journal Entry"
@@ -2495,6 +2497,10 @@ class AccountsController(TransactionBase):
advance_entry.credit_in_account_currency = self.outstanding_amount
reconcilation_entry.debit_in_account_currency = self.outstanding_amount
default_currency = erpnext.get_company_currency(self.company)
if primary_account_currency != default_currency or secondary_account_currency != default_currency:
jv.multi_currency = 1
jv.append("accounts", reconcilation_entry)
jv.append("accounts", advance_entry)