frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.82k stars 7.33k forks source link

Account Balances in Bank Reconciliation Tool #36998

Open marination opened 1 year ago

marination commented 1 year ago

Summary: What balance is get_account_balance really supposed to return ?

Assume:

In https://github.com/frappe/erpnext/blob/develop/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py#L59-L83 :

So here if all my GL Entries resulted from Payment + Journal Entries, the result would be 0.

_I would expect get_account_balance to give me the balance of 'HDFC - R' (bank account that has final impact after making payment) which would be 12460_

Module

accounts

Version

ERPNext - v14 (latest)

nissekalle0 commented 1 year ago

The same we have discovered.

ZhangLianK commented 1 year ago

I also face the same issue. get_balance_on function has get the balance from general ledger, so I think there is no need to get payment entry

this-gavagai commented 1 year ago

I am also struggling with very erroneous values in the Bank Reconciliation Tool. I am confused as to why all the complexity is needed. Shouldn't the bank balance match the general ledger balance for any given date? The problem with selecting just payments and journal entries is that other transaction types can also affect bank balance, such as Sales Invoice, Purchase Invoice, Loan Repayment, etc.

OpenSourceJedi commented 9 months ago

I agree. The reconciliation tool should just pull from the ledger balances for dates selected on the reconciliation tool. Also, it is possible the discrepancy with reconciliation balances may be related to this other issue: https://github.com/frappe/erpnext/issues/33932