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", [])
|
.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,7 +2059,6 @@ 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:
|
||||||
|
|
@ -2065,7 +2067,6 @@ 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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue