General report?

I am writing because I am looking to know what general reports are avaiable in ERPNext?

I know that there ar ebuilt in reports, but not sure whatkind there are or where to find them,.

This relared to:
product inventory and movement
sales per client
purchases per supplier
cashflow
other?

I know that there is a report builder. Where is it? What kind of parameters can be used when building reports?

Thanks for any guidance:)

Joseph

First Create New Script Report in Your Custom App And Fill Module (Your Custom App Name)


You Will See This Folder Created Under Reports
image

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

frappe.query_reports["Sales Per Client"] = {
	"filters": [
			{
					"fieldname":"customer",
					"label": __("Customer"),
					"fieldtype": "Link",
					"options": "Customer",
					"default": ""
			}
	]
}

Then Come To The Report and Click The “Go To The Report” Button


Then U Will See This Report That Can be Filtered With Customer

I Hope It Helps.

1 Like