feat(Support): Service Level Agreements (#16828)
* init SLA
* Added more inputs to the forms
* set priority of issue
* Removed UOM in favor of hours for tracking
* updated js to autofill values
* Removed unwanted fields
* timer functionality
* code refactor
* parenthesis fix
* fixed typo
* added new fields
* Updated fields
* Updated fields for issue doctype
* Updated fields for issue doctype
* changed doctype structure
* added new fields to issue
* code refactor
* new function to set criticality level
* changed dropdown options
* set timer for sla
* calculation of resolution and response time
* stopwatch counter
* dashboard changes
* renamed sla to support contract
* countdown timer section
* issue doctype changes
* removed unwanted imports
* fixed wrong response time and resolution time
* update response and resolution time
* calculate time to respond and resolve
* feature enhancements
* probable scheduling bug fix
* fixed scheduling issue support sent out of support time
* removed issue criticality link from support
* Changed day order
* skip date validation when support contract is default
* removed mandatory field
* fix scheduling conditions for now
* code refactor
* removed duplicate doctypes
* fixed day inserted twice in service level
* check to not add another default contract
* default support contracts
* removed commented code
* removed unused imports
* fix sla for non-listed days
* reduced redundant code and optimized it and starting unit tests
* added condition check to compute days correctly
* renamed doc as per guidelines and added conditions for scheduling
* removed per day support timings
* added response and resolution time to support contract
* scheduling based on hours kinda fix
* set sla before_update and finally fixed time scheduling out of support time
* DocType Issue removed test_records and rewrote test cases
* test cases and codacy fixes
* Doctype SLA instead of Support Contract to avoid confusion with Contract
* fixed tests failing due to change in options for time period
* change naming to Prompt
* remove unknown doctype from help_desk
* revert unwanted changes to default
* refactor get_list for fetching service_level_agreement
* change datatypes
* fix tests
* refactored tests
* remove unused imports
* code and comments refactor for better understandability
* removed and renamed doctype to service days and minor fixes
* Refactor test cases for response and resolution time for issue
* add validation to check if response time < resolution time
* minor fix for checking if current day is start day
* calculate time in js rather than python
* fix: parenthesis fixing customer dashboard
* json changes to rename sections
* refactor: alignment
* refactor: beautify code
* fix: use frm api to get the element
* fix: replace '__' with '_'
* refactor: remove pointless test
diff --git a/erpnext/config/help_desk.py b/erpnext/config/help_desk.py
index adc84f2..c19dd42 100644
--- a/erpnext/config/help_desk.py
+++ b/erpnext/config/help_desk.py
@@ -2,61 +2,81 @@
from frappe import _
def get_data():
- return [
- {
- "label": _("Issues"),
- "items": [
- {
- "type": "doctype",
- "name": "Issue",
- "description": _("Support queries from customers."),
+ return [
+ {
+ "label": _("Issues"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Issue",
+ "description": _("Support queries from customers."),
"onboard": 1,
- },
- {
- "type": "doctype",
- "name": "Communication",
- "description": _("Communication log."),
+ },
+ {
+ "type": "doctype",
+ "name": "Communication",
+ "description": _("Communication log."),
"onboard": 1,
- },
- ]
- },
- {
- "label": _("Warranty"),
- "items": [
- {
- "type": "doctype",
- "name": "Warranty Claim",
- "description": _("Warranty Claim against Serial No."),
- },
- {
- "type": "doctype",
- "name": "Serial No",
- "description": _("Single unit of an Item."),
- },
- ]
- },
- {
- "label": _("Reports"),
- "icon": "fa fa-list",
- "items": [
- {
- "type": "page",
- "name": "support-analytics",
- "label": _("Support Analytics"),
- "icon": "fa fa-bar-chart"
- },
- {
- "type": "report",
- "name": "Minutes to First Response for Issues",
- "doctype": "Issue",
- "is_query_report": True
- },
- {
- "type": "report",
- "name": "Support Hours",
- "doctype": "Issue",
- "is_query_report": True
- },
- ]
- },
- ]
\ No newline at end of file
+ },
+ ]
+ },
+ {
+ "label": _("Warranty"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Warranty Claim",
+ "description": _("Warranty Claim against Serial No."),
+ },
+ {
+ "type": "doctype",
+ "name": "Serial No",
+ "description": _("Single unit of an Item."),
+ },
+ ]
+ },
+ {
+ "label": _("Service Level Agreement"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Employee Group",
+ "description": _("Support Team."),
+ },
+ {
+ "type": "doctype",
+ "name": "Service Level",
+ "description": _("Service Level."),
+ },
+ {
+ "type": "doctype",
+ "name": "Service Level Agreement",
+ "description": _("Service Level Agreement."),
+ }
+ ]
+ },
+ {
+ "label": _("Reports"),
+ "icon": "fa fa-list",
+ "items": [
+ {
+ "type": "page",
+ "name": "support-analytics",
+ "label": _("Support Analytics"),
+ "icon": "fa fa-bar-chart"
+ },
+ {
+ "type": "report",
+ "name": "Minutes to First Response for Issues",
+ "doctype": "Issue",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "Support Hours",
+ "doctype": "Issue",
+ "is_query_report": True
+ },
+ ]
+ },
+ ]
\ No newline at end of file
diff --git a/erpnext/config/support.py b/erpnext/config/support.py
new file mode 100644
index 0000000..3980b42
--- /dev/null
+++ b/erpnext/config/support.py
@@ -0,0 +1,80 @@
+from __future__ import unicode_literals
+from frappe import _
+
+def get_data():
+ return [
+ {
+ "label": _("Issues"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Issue",
+ "description": _("Support queries from customers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Communication",
+ "description": _("Communication log."),
+ },
+ ]
+ },
+ {
+ "label": _("Warranty"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Warranty Claim",
+ "description": _("Warranty Claim against Serial No."),
+ },
+ {
+ "type": "doctype",
+ "name": "Serial No",
+ "description": _("Single unit of an Item."),
+ },
+ ]
+ },
+ {
+ "label": _("Reports"),
+ "icon": "fa fa-list",
+ "items": [
+ {
+ "type": "page",
+ "name": "support-analytics",
+ "label": _("Support Analytics"),
+ "icon": "fa fa-bar-chart"
+ },
+ {
+ "type": "report",
+ "name": "Minutes to First Response for Issues",
+ "doctype": "Issue",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "Support Hours",
+ "doctype": "Issue",
+ "is_query_report": True
+ },
+ ]
+ },
+ {
+ "label": _("Service Level Agreement"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Employee Group",
+ "description": _("Support Team."),
+ },
+ {
+ "type": "doctype",
+ "name": "Service Level",
+ "description": _("Service Level."),
+ },
+ {
+ "type": "doctype",
+ "name": "Service Level Agreement",
+ "description": _("Service Level Agreement."),
+ }
+ ]
+ },
+ ]