diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 2f1efa5d5c1..57c10d2f316 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -763,13 +763,14 @@ def get_account_details(account, date, cost_center=None): 'name': account }, reference_doctype='Payment Entry', limit=1) - account_balance = get_balance_on(account, date, cost_center=cost_center, ignore_account_permission=True) - # There might be some user permissions which will allow account under certain doctypes # except for Payment Entry, only in such case we should throw permission error if not account_list: frappe.throw(_('Account: {0} is not permitted under Payment Entry').format(account)) + account_balance = get_balance_on(account, date, cost_center=cost_center, + ignore_account_permission=True) + return frappe._dict({ "account_currency": get_account_currency(account), "account_balance": account_balance,