diff --git a/erpnext/docs/assets/img/human-resources/shift-assignment-calendar.png b/erpnext/docs/assets/img/human-resources/shift-assignment-calendar.png new file mode 100644 index 0000000000..7c8ec779c0 Binary files /dev/null and b/erpnext/docs/assets/img/human-resources/shift-assignment-calendar.png differ diff --git a/erpnext/docs/assets/img/human-resources/shift-assignment.png b/erpnext/docs/assets/img/human-resources/shift-assignment.png new file mode 100644 index 0000000000..39c2857efc Binary files /dev/null and b/erpnext/docs/assets/img/human-resources/shift-assignment.png differ diff --git a/erpnext/docs/assets/img/human-resources/shift-request.png b/erpnext/docs/assets/img/human-resources/shift-request.png new file mode 100644 index 0000000000..77a7ad59a7 Binary files /dev/null and b/erpnext/docs/assets/img/human-resources/shift-request.png differ diff --git a/erpnext/docs/assets/img/human-resources/shift-type.png b/erpnext/docs/assets/img/human-resources/shift-type.png new file mode 100644 index 0000000000..e03e45c64b Binary files /dev/null and b/erpnext/docs/assets/img/human-resources/shift-type.png differ diff --git a/erpnext/docs/user/manual/en/human-resources/shift-management.md b/erpnext/docs/user/manual/en/human-resources/shift-management.md new file mode 100644 index 0000000000..2279538cc2 --- /dev/null +++ b/erpnext/docs/user/manual/en/human-resources/shift-management.md @@ -0,0 +1,44 @@ +# Shift Management + +Shift Management section of Human Resources helps your Organization manage shifts of your employees. + +To use Shift Management in ERPNext, + + 1. Set Up a Shift Type. + 2. Enter Shift Request. + 3. View and Manage Shift Assignments. + +### Shift Type + +The Shift Type Set Up allows you to define the different types of Shifts in your Organization. + +To create a new Shift Type go to: + +Human Resources > Shift Management > Shift Type + +* Enter Shift Type, Start Time and End Time for quick entry. + + Shift Type + +### Shift Request + +Shift Request is used by an employee to request for a particular Shift Type. + +To create a new Shift Request Log go to: + +Human Resources > Shift Management > Shift Request + +* Enter Shift Type, Employee, Company, From Date and To Date. + + Shift Request + +### Shift Assignment + +* Once the Shift Request is submitted it automatically creates the Shift Assignments for an Employee. + + Shift Assignment + +* You can also view Calendar view of Shift Assignments. + + Shift Assignment Calendar \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_request/test_shift_request.py b/erpnext/hr/doctype/shift_request/test_shift_request.py index 0b8bcb811c..d32443a952 100644 --- a/erpnext/hr/doctype/shift_request/test_shift_request.py +++ b/erpnext/hr/doctype/shift_request/test_shift_request.py @@ -5,6 +5,24 @@ from __future__ import unicode_literals import frappe import unittest +from frappe.utils import nowdate class TestShiftRequest(unittest.TestCase): - pass + def test_make_shift_request(self): + shift_request = frappe.get_doc({ + "doctype": "Shift Request", + "shift_type": "Day Shift", + "company": "_Test Company", + "employee": "_T-Employee-00001", + "employee_name": "_Test Employee", + "start_date": nowdate(), + "end_date": nowdate() + }) + shift_request.insert() + shift_request.submit() + shift_assignment = frappe.db.sql("""select employee + from `tabShift Assignment` + where shift_request = %s""", shift_request.name) + if shift_assignment: + employee = shift_assignment[0][0] + self.assertEqual(shift_request.employee, employee) \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_type/test_shift_type.py b/erpnext/hr/doctype/shift_type/test_shift_type.py index bc4f0eafcd..d5afdf519b 100644 --- a/erpnext/hr/doctype/shift_type/test_shift_type.py +++ b/erpnext/hr/doctype/shift_type/test_shift_type.py @@ -7,4 +7,11 @@ import frappe import unittest class TestShiftType(unittest.TestCase): - pass + def test_make_shift_type(self): + shift_type = frappe.get_doc({ + "doctype": "Shift Type", + "name": "Day Shift", + "start_time": "9:00:00", + "end_time": "18:00:00" + }) + shift_type.insert()