removed filter for multi currency
This commit is contained in:
parent
e54d13ae22
commit
42e5c42ab3
|
|
@ -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,8 +2059,7 @@ 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
|
||||
ba_lookup_fallback[iban] = row.bank_account
|
||||
|
||||
for row in settings.card_mappings:
|
||||
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()
|
||||
if ccy:
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue