removed filter for multi currency

This commit is contained in:
Ali 2026-03-13 20:12:36 +04:00
parent e54d13ae22
commit 42e5c42ab3
1 changed files with 7 additions and 6 deletions

View File

@ -1264,6 +1264,9 @@ def get_statement_transactions(from_date, to_date, account_iban, login_name=None
.get("statementList", [])
)
# Use the account's own currency for all transactions from this account
account_currency = frappe.db.get_value("Kapital Bank Account", account_iban, "currency") or "AZN"
transactions = []
skipped_duplicates = 0
@ -1280,9 +1283,9 @@ def get_statement_transactions(from_date, to_date, account_iban, login_name=None
if not parsed_date:
continue
# Amount and currency
# Amount and currency (use account currency, not the counterparty/operation currency from API)
amount = abs(flt(txn.get("fcyAmount") or txn.get("lcyAmount") or 0))
currency = (txn.get("acCcy") or "AZN").strip()
currency = account_currency
# Direction
dr_cr = (txn.get("drcrInd") or "").upper()
@ -2056,7 +2059,6 @@ def _build_bank_account_lookup(settings):
ccy = (row.currency or "").strip().upper()
if ccy:
ba_lookup_by_currency[(iban, ccy)] = row.bank_account
else:
ba_lookup_fallback[iban] = row.bank_account
for row in settings.card_mappings:
@ -2065,7 +2067,6 @@ def _build_bank_account_lookup(settings):
ccy = (getattr(row, "currency", "") or "").strip().upper()
if ccy:
ba_lookup_by_currency[(acc_no, ccy)] = row.bank_account
else:
ba_lookup_fallback[acc_no] = row.bank_account
return ba_lookup_by_currency, ba_lookup_fallback