diff --git a/kapital_bank/mapping.py b/kapital_bank/mapping.py index cc4bd9f..553621d 100644 --- a/kapital_bank/mapping.py +++ b/kapital_bank/mapping.py @@ -459,8 +459,13 @@ def _create_journal_entry_for_brt(txn, paid_from, paid_to, bank_txn, multi_curre is_multi = from_currency != company_currency or to_currency != company_currency currency_precision = cint(frappe.db.get_single_value("System Settings", "currency_precision") or 2) - # Use currency from the selected mapping; fall back to company currency - txn_currency = (mapping_currency or txn.get("currency") or company_currency).strip() + # Use currency from: mapping row → bank transaction kb_currency → company currency + txn_currency = ( + mapping_currency + or txn.get("currency") + or (getattr(bank_txn, "kb_currency", None) or "") + or company_currency + ).strip() # Exchange rates: account_currency → company_currency from_rate = 1 if from_currency == company_currency else get_exchange_rate(from_currency, company_currency, posting_date)