diff --git a/erpnext/crm/crm_dashboard/crm/crm.json b/erpnext/crm/crm_dashboard/crm/crm.json new file mode 100644 index 0000000000..69c2c8a351 --- /dev/null +++ b/erpnext/crm/crm_dashboard/crm/crm.json @@ -0,0 +1,58 @@ +{ + "cards": [ + { + "card": "New Lead (Last 1 Month)" + }, + { + "card": "New Opportunity (Last 1 Month)" + }, + { + "card": "Won Opportunity (Last 1 Month)" + }, + { + "card": "Open Opportunity" + } + ], + "charts": [ + { + "chart": "Incoming Leads", + "width": "Full" + }, + { + "chart": "Opportunity Trends", + "width": "Full" + }, + { + "chart": "Won Opportunities", + "width": "Full" + }, + { + "chart": "Territory Wise Opportunity Count", + "width": "Half" + }, + { + "chart": "Opportunities via Campaigns", + "width": "Half" + }, + { + "chart": "Territory Wise Sales", + "width": "Full" + }, + { + "chart": "Lead Source", + "width": "Half" + } + ], + "creation": "2020-07-20 20:17:15.985657", + "dashboard_name": "CRM", + "docstatus": 0, + "doctype": "Dashboard", + "idx": 0, + "is_default": 0, + "is_standard": 1, + "modified": "2020-07-21 18:56:47.230053", + "modified_by": "Administrator", + "module": "CRM", + "name": "CRM", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_chart/incoming_leads/incoming_leads.json b/erpnext/crm/dashboard_chart/incoming_leads/incoming_leads.json new file mode 100644 index 0000000000..82398ebd99 --- /dev/null +++ b/erpnext/crm/dashboard_chart/incoming_leads/incoming_leads.json @@ -0,0 +1,28 @@ +{ + "based_on": "creation", + "chart_name": "Incoming Leads", + "chart_type": "Count", + "creation": "2020-07-20 20:17:15.639164", + "custom_options": "{\"type\": \"line\", \"axisOptions\": {\"shortenYAxisNumbers\": 1}, \"tooltipOptions\": {}, \"lineOptions\": {\"regionFill\": 1}}", + "docstatus": 0, + "doctype": "Dashboard Chart", + "document_type": "Lead", + "dynamic_filters_json": "[[\"Lead\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[]", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "last_synced_on": "2020-07-22 15:49:19.896501", + "modified": "2020-07-22 16:06:34.941729", + "modified_by": "Administrator", + "module": "CRM", + "name": "Incoming Leads", + "number_of_groups": 0, + "owner": "Administrator", + "time_interval": "Weekly", + "timeseries": 1, + "timespan": "Last Quarter", + "type": "Bar", + "use_report_chart": 0, + "y_axis": [] +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_chart/lead_source/lead_source.json b/erpnext/crm/dashboard_chart/lead_source/lead_source.json new file mode 100644 index 0000000000..f25fea5751 --- /dev/null +++ b/erpnext/crm/dashboard_chart/lead_source/lead_source.json @@ -0,0 +1,27 @@ +{ + "chart_name": "Lead Source", + "chart_type": "Group By", + "creation": "2020-07-20 20:17:15.842106", + "custom_options": "{\"truncateLegends\": 1, \"maxSlices\": 8}", + "docstatus": 0, + "doctype": "Dashboard Chart", + "document_type": "Lead", + "dynamic_filters_json": "[[\"Lead\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[]", + "group_by_based_on": "source", + "group_by_type": "Count", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "last_synced_on": "2020-07-22 16:11:14.170636", + "modified": "2020-07-22 16:13:38.696710", + "modified_by": "Administrator", + "module": "CRM", + "name": "Lead Source", + "number_of_groups": 0, + "owner": "Administrator", + "timeseries": 0, + "type": "Donut", + "use_report_chart": 0, + "y_axis": [] +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_chart/opportunities_via_campaigns/opportunities_via_campaigns.json b/erpnext/crm/dashboard_chart/opportunities_via_campaigns/opportunities_via_campaigns.json new file mode 100644 index 0000000000..4adda9a1c5 --- /dev/null +++ b/erpnext/crm/dashboard_chart/opportunities_via_campaigns/opportunities_via_campaigns.json @@ -0,0 +1,27 @@ +{ + "chart_name": "Opportunities via Campaigns", + "chart_type": "Group By", + "creation": "2020-07-20 20:17:15.705402", + "custom_options": "{\"truncateLegends\": 1, \"maxSlices\": 8}", + "docstatus": 0, + "doctype": "Dashboard Chart", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[]", + "group_by_based_on": "campaign", + "group_by_type": "Count", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "last_synced_on": "2020-07-22 15:45:32.572011", + "modified": "2020-07-22 16:10:02.497726", + "modified_by": "Administrator", + "module": "CRM", + "name": "Opportunities via Campaigns", + "number_of_groups": 0, + "owner": "Administrator", + "timeseries": 0, + "type": "Pie", + "use_report_chart": 0, + "y_axis": [] +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_chart/opportunity_trends/opportunity_trends.json b/erpnext/crm/dashboard_chart/opportunity_trends/opportunity_trends.json new file mode 100644 index 0000000000..08e26cd3e3 --- /dev/null +++ b/erpnext/crm/dashboard_chart/opportunity_trends/opportunity_trends.json @@ -0,0 +1,28 @@ +{ + "based_on": "creation", + "chart_name": "Opportunity Trends", + "chart_type": "Count", + "creation": "2020-07-20 20:17:15.672124", + "custom_options": "", + "docstatus": 0, + "doctype": "Dashboard Chart", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[]", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "last_synced_on": "2020-07-22 15:45:32.590967", + "modified": "2020-07-22 16:08:33.100532", + "modified_by": "Administrator", + "module": "CRM", + "name": "Opportunity Trends", + "number_of_groups": 0, + "owner": "Administrator", + "time_interval": "Weekly", + "timeseries": 1, + "timespan": "Last Quarter", + "type": "Bar", + "use_report_chart": 0, + "y_axis": [] +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_chart/territory_wise_opportunity_count/territory_wise_opportunity_count.json b/erpnext/crm/dashboard_chart/territory_wise_opportunity_count/territory_wise_opportunity_count.json new file mode 100644 index 0000000000..8b15ec93e2 --- /dev/null +++ b/erpnext/crm/dashboard_chart/territory_wise_opportunity_count/territory_wise_opportunity_count.json @@ -0,0 +1,27 @@ +{ + "chart_name": "Territory Wise Opportunity Count", + "chart_type": "Group By", + "creation": "2020-07-20 20:17:15.774176", + "custom_options": "{\"truncateLegends\": 1, \"maxSlices\": 8}", + "docstatus": 0, + "doctype": "Dashboard Chart", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[]", + "group_by_based_on": "territory", + "group_by_type": "Count", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "last_synced_on": "2020-07-22 15:45:32.134026", + "modified": "2020-07-22 16:09:42.921547", + "modified_by": "Administrator", + "module": "CRM", + "name": "Territory Wise Opportunity Count", + "number_of_groups": 0, + "owner": "Administrator", + "timeseries": 0, + "type": "Donut", + "use_report_chart": 0, + "y_axis": [] +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_chart/territory_wise_sales/territory_wise_sales.json b/erpnext/crm/dashboard_chart/territory_wise_sales/territory_wise_sales.json new file mode 100644 index 0000000000..fe142b4344 --- /dev/null +++ b/erpnext/crm/dashboard_chart/territory_wise_sales/territory_wise_sales.json @@ -0,0 +1,28 @@ +{ + "aggregate_function_based_on": "opportunity_amount", + "chart_name": "Territory Wise Sales", + "chart_type": "Group By", + "creation": "2020-07-20 20:17:15.809008", + "custom_options": "", + "docstatus": 0, + "doctype": "Dashboard Chart", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[[\"Opportunity\",\"status\",\"=\",\"Converted\",false]]", + "group_by_based_on": "territory", + "group_by_type": "Sum", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "last_synced_on": "2020-07-22 15:45:32.501313", + "modified": "2020-07-22 16:10:28.308110", + "modified_by": "Administrator", + "module": "CRM", + "name": "Territory Wise Sales", + "number_of_groups": 0, + "owner": "Administrator", + "timeseries": 0, + "type": "Bar", + "use_report_chart": 0, + "y_axis": [] +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_chart/won_opportunities/won_opportunities.json b/erpnext/crm/dashboard_chart/won_opportunities/won_opportunities.json new file mode 100644 index 0000000000..2b5576b3a4 --- /dev/null +++ b/erpnext/crm/dashboard_chart/won_opportunities/won_opportunities.json @@ -0,0 +1,27 @@ +{ + "based_on": "modified", + "chart_name": "Won Opportunities", + "chart_type": "Count", + "creation": "2020-07-20 20:17:15.738889", + "docstatus": 0, + "doctype": "Dashboard Chart", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[[\"Opportunity\",\"status\",\"=\",\"Converted\",false]]", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "last_synced_on": "2020-07-22 15:45:32.575964", + "modified": "2020-07-22 16:09:14.265231", + "modified_by": "Administrator", + "module": "CRM", + "name": "Won Opportunities", + "number_of_groups": 0, + "owner": "Administrator", + "time_interval": "Monthly", + "timeseries": 1, + "timespan": "Last Year", + "type": "Bar", + "use_report_chart": 0, + "y_axis": [] +} \ No newline at end of file diff --git a/erpnext/crm/dashboard_fixtures.py b/erpnext/crm/dashboard_fixtures.py deleted file mode 100644 index 901c0581f4..0000000000 --- a/erpnext/crm/dashboard_fixtures.py +++ /dev/null @@ -1,221 +0,0 @@ -# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt - -import frappe, erpnext, json -from frappe import _ - -def get_data(): - return frappe._dict({ - "dashboards": get_dashboards(), - "charts": get_charts(), - "number_cards": get_number_cards() - }) - -def get_dashboards(): - return [{ - "doctype": "Dashboard", - "name": "CRM", - "dashboard_name": "CRM", - "charts": [ - { "chart": "Incoming Leads", "width": "Full" }, - { "chart": "Opportunity Trends", "width": "Full"}, - { "chart": "Won Opportunities", "width": "Full" }, - { "chart": "Territory Wise Opportunity Count", "width": "Half"}, - { "chart": "Opportunities via Campaigns", "width": "Half" }, - { "chart": "Territory Wise Sales", "width": "Full"}, - { "chart": "Lead Source", "width": "Half"} - ], - "cards": [ - { "card": "New Lead (Last 1 Month)" }, - { "card": "New Opportunity (Last 1 Month)" }, - { "card": "Won Opportunity (Last 1 Month)" }, - { "card": "Open Opportunity"}, - ] - }] - -def get_company_for_dashboards(): - company = frappe.defaults.get_defaults().company - if company: - return company - else: - company_list = frappe.get_list("Company") - if company_list: - return company_list[0].name - return None - -def get_charts(): - company = get_company_for_dashboards() - - return [{ - "name": "Incoming Leads", - "doctype": "Dashboard Chart", - "time_interval": "Yearly", - "chart_type": "Count", - "chart_name": _("Incoming Leads"), - "timespan": "Last Quarter", - "time_interval": "Weekly", - "document_type": "Lead", - "based_on": "creation", - 'is_public': 1, - 'timeseries': 1, - "owner": "Administrator", - "filters_json": json.dumps([]), - "type": "Bar" - }, - { - "name": "Opportunity Trends", - "doctype": "Dashboard Chart", - "time_interval": "Yearly", - "chart_type": "Count", - "chart_name": _("Opportunity Trends"), - "timespan": "Last Quarter", - "time_interval": "Weekly", - "document_type": "Opportunity", - "based_on": "creation", - 'is_public': 1, - 'timeseries': 1, - "owner": "Administrator", - "filters_json": json.dumps([["Opportunity", "company", "=", company, False]]), - "type": "Bar" - }, - { - "name": "Opportunities via Campaigns", - "chart_name": _("Opportunities via Campaigns"), - "doctype": "Dashboard Chart", - "chart_type": "Group By", - "group_by_type": "Count", - "group_by_based_on": "campaign", - "document_type": "Opportunity", - 'is_public': 1, - 'timeseries': 1, - "owner": "Administrator", - "filters_json": json.dumps([["Opportunity", "company", "=", company, False]]), - "type": "Pie", - "custom_options": json.dumps({ - "truncateLegends": 1, - "maxSlices": 8 - }) - }, - { - "name": "Won Opportunities", - "doctype": "Dashboard Chart", - "time_interval": "Yearly", - "chart_type": "Count", - "chart_name": _("Won Opportunities"), - "timespan": "Last Year", - "time_interval": "Monthly", - "document_type": "Opportunity", - "based_on": "modified", - 'is_public': 1, - 'timeseries': 1, - "owner": "Administrator", - "filters_json": json.dumps([ - ["Opportunity", "company", "=", company, False], - ["Opportunity", "status", "=", "Converted", False]]), - "type": "Bar" - }, - { - "name": "Territory Wise Opportunity Count", - "doctype": "Dashboard Chart", - "chart_type": "Group By", - "group_by_type": "Count", - "group_by_based_on": "territory", - "chart_name": _("Territory Wise Opportunity Count"), - "document_type": "Opportunity", - 'is_public': 1, - "filters_json": json.dumps([ - ["Opportunity", "company", "=", company, False] - ]), - "owner": "Administrator", - "type": "Donut", - "custom_options": json.dumps({ - "truncateLegends": 1, - "maxSlices": 8 - }) - }, - { - "name": "Territory Wise Sales", - "doctype": "Dashboard Chart", - "chart_type": "Group By", - "group_by_type": "Sum", - "group_by_based_on": "territory", - "chart_name": _("Territory Wise Sales"), - "aggregate_function_based_on": "opportunity_amount", - "document_type": "Opportunity", - 'is_public': 1, - "owner": "Administrator", - "filters_json": json.dumps([ - ["Opportunity", "company", "=", company, False], - ["Opportunity", "status", "=", "Converted", False] - ]), - "type": "Bar" - }, - { - "name": "Lead Source", - "doctype": "Dashboard Chart", - "chart_type": "Group By", - "group_by_type": "Count", - "group_by_based_on": "source", - "chart_name": _("Lead Source"), - "document_type": "Lead", - 'is_public': 1, - "owner": "Administrator", - "type": "Pie", - "custom_options": json.dumps({ - "truncateLegends": 1, - "maxSlices": 8 - }) - }] - -def get_number_cards(): - return [{ - "doctype": "Number Card", - "document_type": "Lead", - "name": "New Lead (Last 1 Month)", - "filters_json": json.dumps([ - ["Lead", "creation", "Timespan", "last month"] - ]), - "function": "Count", - "is_public": 1, - "label": _("New Lead (Last 1 Month)"), - "show_percentage_stats": 1, - "stats_time_interval": "Daily" - }, - { - "doctype": "Number Card", - "document_type": "Opportunity", - "name": "New Opportunity (Last 1 Month)", - "filters_json": json.dumps([ - ["Opportunity", "creation", "Timespan", "last month"] - ]), - "function": "Count", - "is_public": 1, - "label": _("New Opportunity (Last 1 Month)"), - "show_percentage_stats": 1, - "stats_time_interval": "Daily" - }, - { - "doctype": "Number Card", - "document_type": "Opportunity", - "name": "Won Opportunity (Last 1 Month)", - "filters_json": json.dumps([ - ["Opportunity", "status", "=", "Converted",False], - ["Opportunity", "creation", "Timespan", "last month"] - ]), - "function": "Count", - "is_public": 1, - "label": _("Won Opportunity (Last 1 Month)"), - "show_percentage_stats": 1, - "stats_time_interval": "Daily" - }, - { - "doctype": "Number Card", - "document_type": "Opportunity", - "name": "Open Opportunity", - "filters_json": json.dumps([["Opportunity","status","=","Open",False]]), - "function": "Count", - "is_public": 1, - "label": _("Open Opportunity"), - "show_percentage_stats": 1, - "stats_time_interval": "Daily" - }] \ No newline at end of file diff --git a/erpnext/crm/number_card/new_lead_(last_1_month)/new_lead_(last_1_month).json b/erpnext/crm/number_card/new_lead_(last_1_month)/new_lead_(last_1_month).json new file mode 100644 index 0000000000..4511f54007 --- /dev/null +++ b/erpnext/crm/number_card/new_lead_(last_1_month)/new_lead_(last_1_month).json @@ -0,0 +1,21 @@ +{ + "creation": "2020-07-20 20:17:15.870736", + "docstatus": 0, + "doctype": "Number Card", + "document_type": "Lead", + "dynamic_filters_json": "[[\"Lead\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[[\"Lead\",\"creation\",\"Timespan\",\"last month\",false]]", + "function": "Count", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "label": "New Lead (Last 1 Month)", + "modified": "2020-07-22 16:15:17.274972", + "modified_by": "Administrator", + "module": "CRM", + "name": "New Lead (Last 1 Month)", + "owner": "Administrator", + "show_percentage_stats": 1, + "stats_time_interval": "Daily", + "type": "Document Type" +} \ No newline at end of file diff --git a/erpnext/crm/number_card/new_opportunity_(last_1_month)/new_opportunity_(last_1_month).json b/erpnext/crm/number_card/new_opportunity_(last_1_month)/new_opportunity_(last_1_month).json new file mode 100644 index 0000000000..90997b7033 --- /dev/null +++ b/erpnext/crm/number_card/new_opportunity_(last_1_month)/new_opportunity_(last_1_month).json @@ -0,0 +1,21 @@ +{ + "creation": "2020-07-20 20:17:15.897112", + "docstatus": 0, + "doctype": "Number Card", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[[\"Opportunity\",\"creation\",\"Timespan\",\"last month\",false]]", + "function": "Count", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "label": "New Opportunity (Last 1 Month)", + "modified": "2020-07-22 16:07:27.910432", + "modified_by": "Administrator", + "module": "CRM", + "name": "New Opportunity (Last 1 Month)", + "owner": "Administrator", + "show_percentage_stats": 1, + "stats_time_interval": "Daily", + "type": "Document Type" +} \ No newline at end of file diff --git a/erpnext/crm/number_card/open_opportunity/open_opportunity.json b/erpnext/crm/number_card/open_opportunity/open_opportunity.json new file mode 100644 index 0000000000..6e06ed64da --- /dev/null +++ b/erpnext/crm/number_card/open_opportunity/open_opportunity.json @@ -0,0 +1,21 @@ +{ + "creation": "2020-07-20 20:17:15.948113", + "docstatus": 0, + "doctype": "Number Card", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"status\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[[\"Opportunity\",\"company\",\"=\",null,false]]", + "function": "Count", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "label": "Open Opportunity", + "modified": "2020-07-22 16:16:16.420446", + "modified_by": "Administrator", + "module": "CRM", + "name": "Open Opportunity", + "owner": "Administrator", + "show_percentage_stats": 1, + "stats_time_interval": "Daily", + "type": "Document Type" +} \ No newline at end of file diff --git a/erpnext/crm/number_card/won_opportunity_(last_1_month)/won_opportunity_(last_1_month).json b/erpnext/crm/number_card/won_opportunity_(last_1_month)/won_opportunity_(last_1_month).json new file mode 100644 index 0000000000..ba0c07e4b0 --- /dev/null +++ b/erpnext/crm/number_card/won_opportunity_(last_1_month)/won_opportunity_(last_1_month).json @@ -0,0 +1,21 @@ +{ + "creation": "2020-07-20 20:17:15.922486", + "docstatus": 0, + "doctype": "Number Card", + "document_type": "Opportunity", + "dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]", + "filters_json": "[[\"Opportunity\",\"creation\",\"Timespan\",\"last month\",false]]", + "function": "Count", + "idx": 0, + "is_public": 1, + "is_standard": 1, + "label": "Won Opportunity (Last 1 Month)", + "modified": "2020-07-22 16:15:53.088837", + "modified_by": "Administrator", + "module": "CRM", + "name": "Won Opportunity (Last 1 Month)", + "owner": "Administrator", + "show_percentage_stats": 1, + "stats_time_interval": "Daily", + "type": "Document Type" +} \ No newline at end of file