issue fixed in accounts receivable report

This commit is contained in:
Nabin Hait 2015-04-17 15:55:19 +05:30
parent 2ba88c4a5f
commit 4743cbe002

View File

@ -135,23 +135,23 @@ class AccountsReceivableReport(object):
def prepare_conditions(self): def prepare_conditions(self):
conditions = [""] conditions = [""]
values = {} values = []
if self.filters.company: if self.filters.company:
conditions.append("company=%(company)s") conditions.append("company=%s")
values["company"] = self.filters.company values.append(self.filters.company)
if self.filters.account: if self.filters.account:
conditions.append("account=%(account)s") conditions.append("account=%s")
values["account"] = self.filters.account values.apppend(self.filters.account)
else: else:
account_map = self.get_account_map() account_map = self.get_account_map()
if not account_map: if not account_map:
frappe.throw(_("No Customer Accounts found.")) frappe.throw(_("No Customer Accounts found."))
else: else:
accounts_list = ["'{0}'".format(frappe.db.escape(ac)) for ac in account_map] conditions.append("account in ({0})".format(", ".join(["%s"] * len(account_map))))
conditions.append("account in ({0})".format(", ".join(accounts_list))) values += account_map.keys()
return " and ".join(conditions), values return " and ".join(conditions), values
def get_gl_entries_for(self, account, against_voucher_type, against_voucher): def get_gl_entries_for(self, account, against_voucher_type, against_voucher):