fix(plaid): withdrawals and deposits are recorded incorrectly (#25784)

This commit is contained in:
Laurynas Sakalauskas 2021-05-25 16:39:44 +03:00 committed by GitHub
parent 507a211c81
commit 6a62ad325f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,11 +183,11 @@ def new_bank_transaction(transaction):
bank_account = frappe.db.get_value("Bank Account", dict(integration_id=transaction["account_id"]))
if float(transaction["amount"]) >= 0:
debit = float(transaction["amount"])
credit = 0
else:
debit = 0
credit = abs(float(transaction["amount"]))
credit = float(transaction["amount"])
else:
debit = abs(float(transaction["amount"]))
credit = 0
status = "Pending" if transaction["pending"] == "True" else "Settled"