fix: accounts payable shows advance amount of other company (#21548)

This commit is contained in:
Saqib
2020-05-01 18:15:13 +05:30
committed by GitHub
parent 2e082affc7
commit 39805918d4
2 changed files with 4 additions and 2 deletions

View File

@@ -600,10 +600,12 @@ def get_party_shipping_address(doctype, name):
else:
return ''
def get_partywise_advanced_payment_amount(party_type, posting_date = None):
def get_partywise_advanced_payment_amount(party_type, posting_date = None, company=None):
cond = "1=1"
if posting_date:
cond = "posting_date <= '{0}'".format(posting_date)
if company:
cond += "and company = '{0}'".format(company)
data = frappe.db.sql(""" SELECT party, sum({0}) as amount
FROM `tabGL Entry`