Open The Python file named sales_per_client and write this code
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
columns = get_columns()
data = get_data(filters)
return columns, data
def get_columns():
"""Return the columns for the report"""
return [
_("Sales Invoice") + ":Link/Sales Invoice:120",
_("Date") + ":Date:100",
_("Customer") + ":Link/Customer:120",
_("Total") + ":Currency:120"
]
def get_data(filters):
"""Return the data for the report"""
conditions = ''
if filters.get("customer"):
conditions += " and customer = '{}'".format(filters["customer"])
data = frappe.db.sql("""
SELECT
name, posting_date, customer, grand_total
FROM
`tabSales Invoice`
WHERE
docstatus = 1 {}
ORDER BY
posting_date DESC, name DESC
""".format(conditions), as_list=1)
return data
then open the JS File named sales_per_client.js and write this code