Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Employee Checkin): geofencing (backport #1948) #2272

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions hrms/hr/doctype/shift_assignment/shift_assignment.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"employee_details_section",
"employee",
"employee_name",
"shift_type",
"status",
"schedule",
"column_break_3",
"company",
"department",
"shift_details_section",
"shift_type",
"shift_location",
"status",
"column_break_brkq",
"start_date",
"end_date",
"shift_request",
"department",
"schedule",
"amended_from"
],
"fields": [
Expand Down Expand Up @@ -60,6 +64,7 @@
"fieldtype": "Column Break"
},
{
"fetch_from": "employee.company",
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
Expand Down Expand Up @@ -103,6 +108,26 @@
"label": "Status",
"options": "Active\nInactive"
},
{
"fieldname": "employee_details_section",
"fieldtype": "Section Break",
"label": "Employee Details"
},
{
"fieldname": "shift_details_section",
"fieldtype": "Section Break",
"label": "Shift Details"
},
{
"fieldname": "shift_location",
"fieldtype": "Link",
"label": "Shift Location",
"options": "Shift Location"
},
{
"fieldname": "column_break_brkq",
"fieldtype": "Column Break"
},
{
"fieldname": "schedule",
"fieldtype": "Link",
Expand All @@ -113,7 +138,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2024-05-31 16:41:32.869130",
"modified": "2024-07-04 14:30:40.840689",
"modified_by": "Administrator",
"module": "HR",
"name": "Shift Assignment",
Expand Down Expand Up @@ -162,4 +187,4 @@
"states": [],
"title_field": "employee_name",
"track_changes": 1
}
}
Empty file.
8 changes: 8 additions & 0 deletions hrms/hr/doctype/shift_location/shift_location.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

// frappe.ui.form.on("Shift Location", {
// refresh(frm) {

// },
// });
114 changes: 114 additions & 0 deletions hrms/hr/doctype/shift_location/shift_location.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "field:location_name",
"creation": "2024-07-04 12:12:26.894513",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"location_name",
"checkin_radius",
"column_break_dlgd",
"latitude",
"longitude",
"section_break_xxli",
"geolocation"
],
"fields": [
{
"fieldname": "location_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Location Name",
"reqd": 1,
"unique": 1
},
{
"description": "Radius within which check-in is allowed (in meters)",
"fieldname": "checkin_radius",
"fieldtype": "Int",
"label": "Checkin Radius"
},
{
"fieldname": "column_break_dlgd",
"fieldtype": "Column Break"
},
{
"fieldname": "longitude",
"fieldtype": "Float",
"label": "Longitude"
},
{
"fieldname": "section_break_xxli",
"fieldtype": "Section Break"
},
{
"fieldname": "geolocation",
"fieldtype": "Geolocation",
"label": "Geolocation"
},
{
"fieldname": "latitude",
"fieldtype": "Float",
"label": "Latitude"
}
],
"links": [],
"modified": "2024-07-04 12:31:00.609940",
"modified_by": "Administrator",
"module": "HR",
"name": "Shift Location",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "HR Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "HR User",
"share": 1,
"write": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Employee",
"share": 1
}
],
"quick_entry": 1,
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
9 changes: 9 additions & 0 deletions hrms/hr/doctype/shift_location/shift_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class ShiftLocation(Document):
pass
9 changes: 9 additions & 0 deletions hrms/hr/doctype/shift_location/test_shift_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestShiftLocation(FrappeTestCase):
pass
Loading