fix: Re-organise code
This commit is contained in:
parent
1a2600c9ea
commit
64a962ce97
@ -763,13 +763,14 @@ def get_account_details(account, date, cost_center=None):
|
|||||||
'name': account
|
'name': account
|
||||||
}, reference_doctype='Payment Entry', limit=1)
|
}, 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
|
# 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
|
# except for Payment Entry, only in such case we should throw permission error
|
||||||
if not account_list:
|
if not account_list:
|
||||||
frappe.throw(_('Account: {0} is not permitted under Payment Entry').format(account))
|
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({
|
return frappe._dict({
|
||||||
"account_currency": get_account_currency(account),
|
"account_currency": get_account_currency(account),
|
||||||
"account_balance": account_balance,
|
"account_balance": account_balance,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user