fix: wrong outstanding invoices fetched against employee (#20373)

This commit is contained in:
Saqib 2020-01-24 16:22:49 +05:30 committed by Nabin Hait
parent ce00f6cf70
commit 9291df4d4c

View File

@ -640,8 +640,9 @@ def get_outstanding_invoices(party_type, party, account, condition=None, filters
precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2 precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2
if account: if account:
root_type = frappe.get_cached_value("Account", account, "root_type") root_type, account_type = frappe.get_cached_value("Account", account, ["root_type", "account_type"])
party_account_type = "Receivable" if root_type == "Asset" else "Payable" party_account_type = "Receivable" if root_type == "Asset" else "Payable"
party_account_type = account_type or party_account_type
else: else:
party_account_type = erpnext.get_party_account_type(party_type) party_account_type = erpnext.get_party_account_type(party_type)