Shift Management - Documentation and Tests (#13997)

* [fix] #13996

* codacy fix
This commit is contained in:
Pawan Mehta 2018-05-11 21:03:50 +05:30 committed by Nabin Hait
parent 56f0328bed
commit c53e35368d
7 changed files with 71 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -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.
<img class="screenshot" alt="Shift Type" src="{{docs_base_url}}/assets/img/human-resources/shift-type.png">
### 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.
<img class="screenshot" alt="Shift Request" src="{{docs_base_url}}/assets/img/human-resources/shift-request.png">
### Shift Assignment
* Once the Shift Request is submitted it automatically creates the Shift Assignments for an Employee.
<img class="screenshot" alt="Shift Assignment" src="{{docs_base_url}}/assets/img/human-resources/shift-assignment.png">
* You can also view Calendar view of Shift Assignments.
<img class="screenshot" alt="Shift Assignment Calendar"
src="{{docs_base_url}}/assets/img/human-resources/shift-assignment-calendar.png">

View File

@ -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)

View File

@ -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()