mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
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:
@@ -237,14 +237,15 @@ def new_bank_transaction(transaction):
|
|||||||
deposit = abs(amount)
|
deposit = abs(amount)
|
||||||
withdrawal = 0.0
|
withdrawal = 0.0
|
||||||
|
|
||||||
status = "Pending" if transaction["pending"] == "True" else "Settled"
|
status = "Pending" if transaction["pending"] == True else "Settled"
|
||||||
|
|
||||||
tags = []
|
tags = []
|
||||||
try:
|
if transaction["category"]:
|
||||||
tags += transaction["category"]
|
try:
|
||||||
tags += [f'Plaid Cat. {transaction["category_id"]}']
|
tags += transaction["category"]
|
||||||
except KeyError:
|
tags += [f'Plaid Cat. {transaction["category_id"]}']
|
||||||
pass
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
if not frappe.db.exists("Bank Transaction", dict(transaction_id=transaction["transaction_id"])):
|
if not frappe.db.exists("Bank Transaction", dict(transaction_id=transaction["transaction_id"])):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user