mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
fix: only save end date when transactions are returned (#22023)
This commit is contained in:
@@ -141,12 +141,12 @@ def sync_transactions(bank, bank_account):
|
|||||||
result += new_bank_transaction(transaction)
|
result += new_bank_transaction(transaction)
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
end_date = frappe.db.get_value('Bank Transaction', result.pop(), 'date')
|
last_transaction_date = frappe.db.get_value('Bank Transaction', result.pop(), 'date')
|
||||||
|
|
||||||
frappe.logger().info("Plaid added {} new Bank Transactions from '{}' between {} and {}".format(
|
frappe.logger().info("Plaid added {} new Bank Transactions from '{}' between {} and {}".format(
|
||||||
len(result), bank_account, start_date, end_date))
|
len(result), bank_account, start_date, end_date))
|
||||||
|
|
||||||
frappe.db.set_value("Bank Account", bank_account, "last_integration_date", end_date)
|
frappe.db.set_value("Bank Account", bank_account, "last_integration_date", last_transaction_date)
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
frappe.log_error(frappe.get_traceback(), _("Plaid transactions sync error"))
|
frappe.log_error(frappe.get_traceback(), _("Plaid transactions sync error"))
|
||||||
|
|||||||
Reference in New Issue
Block a user