Don't double count Nordigen accounts
This commit is contained in:
parent
32af22cff4
commit
6ce722399c
|
@ -309,15 +309,11 @@ class Nordigen(util.Base):
|
||||||
self.log.error("Could not get requisitions.")
|
self.log.error("Could not get requisitions.")
|
||||||
return {}
|
return {}
|
||||||
for req in requisitions:
|
for req in requisitions:
|
||||||
print("REQ ITER", req)
|
|
||||||
if not req["accounts"]:
|
if not req["accounts"]:
|
||||||
print("NOT REQ ACCOUNTS")
|
|
||||||
continue
|
continue
|
||||||
accounts = self.get_accounts(req["id"])
|
accounts = self.get_accounts(req["id"])
|
||||||
for account_id in accounts:
|
for account_id in accounts:
|
||||||
print("ACCOUNT ID ITER", account_id)
|
|
||||||
account_info = self.get_account(account_id)
|
account_info = self.get_account(account_id)
|
||||||
print("INFO", account_info)
|
|
||||||
if not account_info:
|
if not account_info:
|
||||||
continue
|
continue
|
||||||
if req["institution_id"] in to_return:
|
if req["institution_id"] in to_return:
|
||||||
|
@ -395,6 +391,8 @@ class Nordigen(util.Base):
|
||||||
if not currency == entry["balanceAmount"]["currency"]:
|
if not currency == entry["balanceAmount"]["currency"]:
|
||||||
self.log.error("Different currencies in balance query.")
|
self.log.error("Different currencies in balance query.")
|
||||||
return
|
return
|
||||||
|
if not entry["balanceType"] == "interimBooked":
|
||||||
|
continue
|
||||||
total += float(entry["balanceAmount"]["amount"])
|
total += float(entry["balanceAmount"]["amount"])
|
||||||
currency = entry["balanceAmount"]["currency"]
|
currency = entry["balanceAmount"]["currency"]
|
||||||
return (currency, total)
|
return (currency, total)
|
||||||
|
|
Loading…
Reference in New Issue