mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 02:14:48 +00:00
moved modules inside erpnext folder
This commit is contained in:
1
erpnext/support/page/__init__.py
Normal file
1
erpnext/support/page/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
1
erpnext/support/page/support_analytics/README.md
Normal file
1
erpnext/support/page/support_analytics/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Support Ticket volume, performance over time.
|
||||
0
erpnext/support/page/support_analytics/__init__.py
Normal file
0
erpnext/support/page/support_analytics/__init__.py
Normal file
113
erpnext/support/page/support_analytics/support_analytics.js
Normal file
113
erpnext/support/page/support_analytics/support_analytics.js
Normal file
@@ -0,0 +1,113 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
wn.pages['support-analytics'].onload = function(wrapper) {
|
||||
wn.ui.make_app_page({
|
||||
parent: wrapper,
|
||||
title: wn._('Support Analytics'),
|
||||
single_column: true
|
||||
});
|
||||
|
||||
new erpnext.SupportAnalytics(wrapper);
|
||||
|
||||
|
||||
wrapper.appframe.add_module_icon("Support")
|
||||
|
||||
}
|
||||
|
||||
erpnext.SupportAnalytics = wn.views.GridReportWithPlot.extend({
|
||||
init: function(wrapper) {
|
||||
this._super({
|
||||
title: wn._("Support Analtyics"),
|
||||
page: wrapper,
|
||||
parent: $(wrapper).find('.layout-main'),
|
||||
appframe: wrapper.appframe,
|
||||
doctypes: ["Support Ticket", "Fiscal Year"],
|
||||
});
|
||||
},
|
||||
|
||||
filters: [
|
||||
{fieldtype:"Select", label: wn._("Fiscal Year"), link:"Fiscal Year",
|
||||
default_value: "Select Fiscal Year..."},
|
||||
{fieldtype:"Date", label: wn._("From Date")},
|
||||
{fieldtype:"Label", label: wn._("To")},
|
||||
{fieldtype:"Date", label: wn._("To Date")},
|
||||
{fieldtype:"Select", label: wn._("Range"),
|
||||
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
|
||||
{fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white"},
|
||||
{fieldtype:"Button", label: wn._("Reset Filters")}
|
||||
],
|
||||
|
||||
setup_columns: function() {
|
||||
var std_columns = [
|
||||
{id: "check", name: wn._("Plot"), field: "check", width: 30,
|
||||
formatter: this.check_formatter},
|
||||
{id: "status", name: wn._("Status"), field: "status", width: 100},
|
||||
];
|
||||
this.make_date_range_columns();
|
||||
this.columns = std_columns.concat(this.columns);
|
||||
},
|
||||
|
||||
prepare_data: function() {
|
||||
// add Opening, Closing, Totals rows
|
||||
// if filtered by account and / or voucher
|
||||
var me = this;
|
||||
var total_tickets = {status:"All Tickets", "id": "all-tickets",
|
||||
checked:true};
|
||||
var days_to_close = {status:"Days to Close", "id":"days-to-close",
|
||||
checked:false};
|
||||
var total_closed = {};
|
||||
var hours_to_close = {status:"Hours to Close", "id":"hours-to-close",
|
||||
checked:false};
|
||||
var hours_to_respond = {status:"Hours to Respond", "id":"hours-to-respond",
|
||||
checked:false};
|
||||
var total_responded = {};
|
||||
|
||||
|
||||
$.each(wn.report_dump.data["Support Ticket"], function(i, d) {
|
||||
var dateobj = dateutil.str_to_obj(d.creation);
|
||||
var date = d.creation.split(" ")[0];
|
||||
var col = me.column_map[date];
|
||||
if(col) {
|
||||
total_tickets[col.field] = flt(total_tickets[col.field]) + 1;
|
||||
if(d.status=="Closed") {
|
||||
// just count
|
||||
total_closed[col.field] = flt(total_closed[col.field]) + 1;
|
||||
|
||||
days_to_close[col.field] = flt(days_to_close[col.field])
|
||||
+ dateutil.get_diff(d.resolution_date, d.creation);
|
||||
|
||||
hours_to_close[col.field] = flt(hours_to_close[col.field])
|
||||
+ dateutil.get_hour_diff(d.resolution_date, d.creation);
|
||||
|
||||
}
|
||||
if (d.first_responded_on) {
|
||||
total_responded[col.field] = flt(total_responded[col.field]) + 1;
|
||||
|
||||
hours_to_respond[col.field] = flt(hours_to_respond[col.field])
|
||||
+ dateutil.get_hour_diff(d.first_responded_on, d.creation);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// make averages
|
||||
$.each(this.columns, function(i, col) {
|
||||
if(col.formatter==me.currency_formatter && total_tickets[col.field]) {
|
||||
days_to_close[col.field] = flt(days_to_close[col.field]) /
|
||||
flt(total_closed[col.field]);
|
||||
hours_to_close[col.field] = flt(hours_to_close[col.field]) /
|
||||
flt(total_closed[col.field]);
|
||||
hours_to_respond[col.field] = flt(hours_to_respond[col.field]) /
|
||||
flt(total_responded[col.field]);
|
||||
}
|
||||
})
|
||||
|
||||
this.data = [total_tickets, days_to_close, hours_to_close, hours_to_respond];
|
||||
},
|
||||
|
||||
get_plot_points: function(item, col, idx) {
|
||||
return [[dateutil.str_to_obj(col.id).getTime(), item[col.field]],
|
||||
[dateutil.user_to_obj(col.name).getTime(), item[col.field]]];
|
||||
}
|
||||
|
||||
});
|
||||
33
erpnext/support/page/support_analytics/support_analytics.txt
Normal file
33
erpnext/support/page/support_analytics/support_analytics.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-04 15:31:45",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-11 14:44:24",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Page",
|
||||
"icon": "icon-bar-chart",
|
||||
"module": "Support",
|
||||
"name": "__common__",
|
||||
"page_name": "support-analytics",
|
||||
"standard": "Yes",
|
||||
"title": "Support Analytics"
|
||||
},
|
||||
{
|
||||
"doctype": "Page Role",
|
||||
"name": "__common__",
|
||||
"parent": "support-analytics",
|
||||
"parentfield": "roles",
|
||||
"parenttype": "Page",
|
||||
"role": "Support Team"
|
||||
},
|
||||
{
|
||||
"doctype": "Page",
|
||||
"name": "support-analytics"
|
||||
},
|
||||
{
|
||||
"doctype": "Page Role"
|
||||
}
|
||||
]
|
||||
1
erpnext/support/page/support_home/__init__.py
Normal file
1
erpnext/support/page/support_home/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
99
erpnext/support/page/support_home/support_home.js
Normal file
99
erpnext/support/page/support_home/support_home.js
Normal file
@@ -0,0 +1,99 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt"
|
||||
|
||||
wn.module_page["Support"] = [
|
||||
{
|
||||
title: wn._("Top"),
|
||||
top: true,
|
||||
icon: "icon-copy",
|
||||
items: [
|
||||
{
|
||||
label: wn._("Support Ticket"),
|
||||
description: wn._("Support queries from customers."),
|
||||
doctype:"Support Ticket"
|
||||
},
|
||||
{
|
||||
label: wn._("Customer Issue"),
|
||||
description: wn._("Customer Issue against Serial No."),
|
||||
doctype:"Customer Issue"
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
title: wn._("Documents"),
|
||||
icon: "icon-copy",
|
||||
items: [
|
||||
{
|
||||
label: wn._("Maintenance Schedule"),
|
||||
description: wn._("Plan for maintenance visits."),
|
||||
doctype:"Maintenance Schedule"
|
||||
},
|
||||
{
|
||||
label: wn._("Maintenance Visit"),
|
||||
description: wn._("Visit report for maintenance call."),
|
||||
doctype:"Maintenance Visit"
|
||||
},
|
||||
{
|
||||
label: wn._("Newsletter"),
|
||||
description: wn._("Newsletters to contacts, leads."),
|
||||
doctype:"Newsletter"
|
||||
},
|
||||
{
|
||||
label: wn._("Communication"),
|
||||
description: wn._("Communication log."),
|
||||
doctype:"Communication"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: wn._("Masters"),
|
||||
icon: "icon-book",
|
||||
items: [
|
||||
{
|
||||
label: wn._("Serial No"),
|
||||
description: wn._("Single unit of an Item."),
|
||||
doctype:"Serial No"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: wn._("Setup"),
|
||||
icon: "icon-cog",
|
||||
items: [
|
||||
{
|
||||
"route":"Form/Email Settings/Email Settings",
|
||||
"label":wn._("Email Settings"),
|
||||
"description":wn._("Setup to pull emails from support email account"),
|
||||
doctype: "Email Settings"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: wn._("Analytics"),
|
||||
right: true,
|
||||
icon: "icon-bar-chart",
|
||||
items: [
|
||||
{
|
||||
"label":wn._("Support Analytics"),
|
||||
page: "support-analytics"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: wn._("Reports"),
|
||||
right: true,
|
||||
icon: "icon-list",
|
||||
items: [
|
||||
{
|
||||
"label":wn._("Maintenance Schedules"),
|
||||
route: "query-report/Maintenance Schedules",
|
||||
doctype: "Maintenance Schedule"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
pscript['onload_support-home'] = function(wrapper) {
|
||||
wn.views.moduleview.make(wrapper, "Support");
|
||||
}
|
||||
22
erpnext/support/page/support_home/support_home.txt
Normal file
22
erpnext/support/page/support_home/support_home.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"creation": "2012-02-21 13:23:35",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-11 14:44:26",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Page",
|
||||
"icon": "icon-th",
|
||||
"module": "Support",
|
||||
"name": "__common__",
|
||||
"page_name": "support-home",
|
||||
"standard": "Yes",
|
||||
"title": "Support Home"
|
||||
},
|
||||
{
|
||||
"doctype": "Page",
|
||||
"name": "support-home"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user