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", []) .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 = [] transactions = []
skipped_duplicates = 0 skipped_duplicates = 0
@ -1280,9 +1283,9 @@ def get_statement_transactions(from_date, to_date, account_iban, login_name=None
if not parsed_date: if not parsed_date:
continue 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)) amount = abs(flt(txn.get("fcyAmount") or txn.get("lcyAmount") or 0))
currency = (txn.get("acCcy") or "AZN").strip() currency = account_currency
# Direction # Direction
dr_cr = (txn.get("drcrInd") or "").upper() dr_cr = (txn.get("drcrInd") or "").upper()
@ -2056,8 +2059,7 @@ def _build_bank_account_lookup(settings):
ccy = (row.currency or "").strip().upper() ccy = (row.currency or "").strip().upper()
if ccy: if ccy:
ba_lookup_by_currency[(iban, ccy)] = row.bank_account ba_lookup_by_currency[(iban, ccy)] = row.bank_account
else: ba_lookup_fallback[iban] = row.bank_account
ba_lookup_fallback[iban] = row.bank_account
for row in settings.card_mappings: for row in settings.card_mappings:
if row.account_number and row.bank_account: if row.account_number and row.bank_account:
@ -2065,8 +2067,7 @@ def _build_bank_account_lookup(settings):
ccy = (getattr(row, "currency", "") or "").strip().upper() ccy = (getattr(row, "currency", "") or "").strip().upper()
if ccy: if ccy:
ba_lookup_by_currency[(acc_no, ccy)] = row.bank_account ba_lookup_by_currency[(acc_no, ccy)] = row.bank_account
else: ba_lookup_fallback[acc_no] = row.bank_account
ba_lookup_fallback[acc_no] = row.bank_account
return ba_lookup_by_currency, ba_lookup_fallback return ba_lookup_by_currency, ba_lookup_fallback