fix: Plaid Integration status and categories
"pending" is a boolean not a string, and "category" doesn't exist in some edge cases
This commit is contained in:
parent
924911e743
commit
43f530b077
@ -237,14 +237,15 @@ def new_bank_transaction(transaction):
|
||||
deposit = abs(amount)
|
||||
withdrawal = 0.0
|
||||
|
||||
status = "Pending" if transaction["pending"] == "True" else "Settled"
|
||||
status = "Pending" if transaction["pending"] == True else "Settled"
|
||||
|
||||
tags = []
|
||||
try:
|
||||
tags += transaction["category"]
|
||||
tags += [f'Plaid Cat. {transaction["category_id"]}']
|
||||
except KeyError:
|
||||
pass
|
||||
if transaction["category"]:
|
||||
try:
|
||||
tags += transaction["category"]
|
||||
tags += [f'Plaid Cat. {transaction["category_id"]}']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
if not frappe.db.exists("Bank Transaction", dict(transaction_id=transaction["transaction_id"])):
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user