mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
Minor fix in sales funnel report
This commit is contained in:
@@ -9,25 +9,25 @@ def get_funnel_data(from_date, to_date):
|
|||||||
active_leads = frappe.db.sql("""select count(*) from `tabLead`
|
active_leads = frappe.db.sql("""select count(*) from `tabLead`
|
||||||
where (date(`modified`) between %s and %s)
|
where (date(`modified`) between %s and %s)
|
||||||
and status != "Do Not Contact" """, (from_date, to_date))[0][0]
|
and status != "Do Not Contact" """, (from_date, to_date))[0][0]
|
||||||
|
|
||||||
active_leads += frappe.db.sql("""select count(distinct customer) from `tabContact`
|
active_leads += frappe.db.sql("""select count(distinct customer) from `tabContact`
|
||||||
where (date(`modified`) between %s and %s)
|
where (date(`modified`) between %s and %s)
|
||||||
and status != "Passive" """, (from_date, to_date))[0][0]
|
and status != "Passive" """, (from_date, to_date))[0][0]
|
||||||
|
|
||||||
opportunities = frappe.db.sql("""select count(*) from `tabOpportunity`
|
opportunities = frappe.db.sql("""select count(*) from `tabOpportunity`
|
||||||
where docstatus = 1 and (date(`creation`) between %s and %s)
|
where docstatus = 1 and (date(`creation`) between %s and %s)
|
||||||
and status != "Lost" """, (from_date, to_date))[0][0]
|
and status != "Lost" """, (from_date, to_date))[0][0]
|
||||||
|
|
||||||
quotations = frappe.db.sql("""select count(*) from `tabQuotation`
|
quotations = frappe.db.sql("""select count(*) from `tabQuotation`
|
||||||
where docstatus = 1 and (date(`creation`) between %s and %s)
|
where docstatus = 1 and (date(`creation`) between %s and %s)
|
||||||
and status != "Lost" """, (from_date, to_date))[0][0]
|
and status != "Lost" """, (from_date, to_date))[0][0]
|
||||||
|
|
||||||
sales_orders = frappe.db.sql("""select count(*) from `tabQuotation`
|
sales_orders = frappe.db.sql("""select count(*) from `tabSales Order`
|
||||||
where docstatus = 1 and (date(`creation`) between %s and %s)""", (from_date, to_date))[0][0]
|
where docstatus = 1 and (date(`creation`) between %s and %s)""", (from_date, to_date))[0][0]
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{ "title": "Active Leads / Customers", "value": active_leads, "color": "#B03B46" },
|
{ "title": "Active Leads / Customers", "value": active_leads, "color": "#B03B46" },
|
||||||
{ "title": "Opportunities", "value": opportunities, "color": "#F09C00" },
|
{ "title": "Opportunities", "value": opportunities, "color": "#F09C00" },
|
||||||
{ "title": "Quotations", "value": quotations, "color": "#006685" },
|
{ "title": "Quotations", "value": quotations, "color": "#006685" },
|
||||||
{ "title": "Sales Orders", "value": sales_orders, "color": "#00AD65" }
|
{ "title": "Sales Orders", "value": sales_orders, "color": "#00AD65" }
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user