fix(Bank Reconciliation): get credit amount for bank account of type liability (#28319)

This commit is contained in:
mergify[bot]
2021-11-10 12:57:57 +05:30
committed by GitHub
parent c04c2108f3
commit a40b21cd20

View File

@@ -344,7 +344,15 @@ def get_pe_matching_query(amount_condition, account_from_to, transaction):
def get_je_matching_query(amount_condition, transaction):
# get matching journal entry query
cr_or_dr = "credit" if transaction.withdrawal > 0 else "debit"
company_account = frappe.get_value("Bank Account", transaction.bank_account, "account")
root_type = frappe.get_value("Account", company_account, "root_type")
if root_type == "Liability":
cr_or_dr = "debit" if transaction.withdrawal > 0 else "credit"
else:
cr_or_dr = "credit" if transaction.withdrawal > 0 else "debit"
return f"""
SELECT