From 64a962ce97f436dddc30d88dbcbae9c907e1589a Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Tue, 13 Aug 2019 12:08:49 +0530 Subject: [PATCH] fix: Re-organise code --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 2f1efa5d5c..57c10d2f31 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,