[Fix] Sales payment summary report (#12151)

This commit is contained in:
rohitwaghchaure 2017-12-25 11:26:15 +05:30 committed by Nabin Hait
parent 443691aaf8
commit 75789b65c2
2 changed files with 5 additions and 3 deletions

View File

@ -7,12 +7,14 @@ frappe.query_reports["Sales Payment Summary"] = {
"label": __("From Date"),
"fieldtype": "Date",
"default": frappe.datetime.get_today(),
"reqd": 1,
"width": "80"
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
"reqd": 1,
"default": frappe.datetime.get_today()
},
{

View File

@ -37,11 +37,11 @@ def get_sales_payment_data(filters, columns):
def get_conditions(filters):
conditions = ""
if filters.get("company"): conditions += " a.company=%(company)s"
if filters.get("from_date"): conditions += "a.posting_date >= %(from_date)s"
if filters.get("to_date"): conditions += " and a.posting_date <= %(to_date)s"
if filters.get("company"): conditions += " and a.company=%(company)s"
if filters.get("customer"): conditions += " and a.customer = %(customer)s"
if filters.get("owner"): conditions += " and a.owner = %(owner)s"
if filters.get("from_date"): conditions += " and a.posting_date >= %(from_date)s"
if filters.get("to_date"): conditions += " and a.posting_date <= %(to_date)s"
if filters.get("is_pos"): conditions += " and a.is_pos = %(is_pos)s"
return conditions