Shift Management - Documentation and Tests (#13997)
* [fix] #13996 * codacy fix
This commit is contained in:
parent
56f0328bed
commit
c53e35368d
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
BIN
erpnext/docs/assets/img/human-resources/shift-assignment.png
Normal file
BIN
erpnext/docs/assets/img/human-resources/shift-assignment.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
BIN
erpnext/docs/assets/img/human-resources/shift-request.png
Normal file
BIN
erpnext/docs/assets/img/human-resources/shift-request.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
erpnext/docs/assets/img/human-resources/shift-type.png
Normal file
BIN
erpnext/docs/assets/img/human-resources/shift-type.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
@ -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">
|
@ -5,6 +5,24 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
import unittest
|
import unittest
|
||||||
|
from frappe.utils import nowdate
|
||||||
|
|
||||||
class TestShiftRequest(unittest.TestCase):
|
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)
|
@ -7,4 +7,11 @@ import frappe
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestShiftType(unittest.TestCase):
|
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()
|
||||||
|
Loading…
Reference in New Issue
Block a user