mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
[fix] accounts payable report
This commit is contained in:
@@ -170,14 +170,15 @@ class ReceivablePayableReport(object):
|
|||||||
if not hasattr(self, "gl_entries"):
|
if not hasattr(self, "gl_entries"):
|
||||||
conditions, values = self.prepare_conditions(party_type)
|
conditions, values = self.prepare_conditions(party_type)
|
||||||
self.gl_entries = frappe.db.sql("""select * from `tabGL Entry`
|
self.gl_entries = frappe.db.sql("""select * from `tabGL Entry`
|
||||||
where docstatus < 2 {0} order by posting_date, party"""
|
where docstatus < 2 and party_type=%s {0} order by posting_date, party"""
|
||||||
.format(conditions), values, as_dict=True)
|
.format(conditions), values, as_dict=True)
|
||||||
|
|
||||||
return self.gl_entries
|
return self.gl_entries
|
||||||
|
|
||||||
def prepare_conditions(self, party_type):
|
def prepare_conditions(self, party_type):
|
||||||
conditions = [""]
|
conditions = [""]
|
||||||
values = []
|
values = [party_type]
|
||||||
|
|
||||||
party_type_field = scrub(party_type)
|
party_type_field = scrub(party_type)
|
||||||
|
|
||||||
if self.filters.company:
|
if self.filters.company:
|
||||||
@@ -185,8 +186,8 @@ class ReceivablePayableReport(object):
|
|||||||
values.append(self.filters.company)
|
values.append(self.filters.company)
|
||||||
|
|
||||||
if self.filters.get(party_type_field):
|
if self.filters.get(party_type_field):
|
||||||
conditions.append("party_type=%s and party=%s")
|
conditions.append("party=%s")
|
||||||
values += [party_type, self.filters.get(party_type_field)]
|
values.append(self.filters.get(party_type_field))
|
||||||
|
|
||||||
return " and ".join(conditions), values
|
return " and ".join(conditions), values
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user