Merge branch 'develop' into fix-incorrect-translations
This commit is contained in:
commit
f01c3f11c8
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"creation": "2013-01-10 16:34:13",
|
"creation": "2013-01-10 16:34:13",
|
||||||
@ -63,6 +64,14 @@
|
|||||||
"oldfieldname": "employee_name",
|
"oldfieldname": "employee_name",
|
||||||
"oldfieldtype": "Data"
|
"oldfieldtype": "Data"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "working_hours",
|
||||||
|
"fieldname": "working_hours",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"label": "Working Hours",
|
||||||
|
"precision": "1",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "Present",
|
"default": "Present",
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
@ -72,7 +81,7 @@
|
|||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldname": "status",
|
"oldfieldname": "status",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "\nPresent\nAbsent\nOn Leave\nHalf Day",
|
"options": "\nPresent\nAbsent\nOn Leave\nHalf Day\nWork From Home",
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
},
|
},
|
||||||
@ -126,6 +135,12 @@
|
|||||||
"options": "Department",
|
"options": "Department",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "shift",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Shift",
|
||||||
|
"options": "Shift Type"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "attendance_request",
|
"fieldname": "attendance_request",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@ -143,20 +158,6 @@
|
|||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"depends_on": "working_hours",
|
|
||||||
"fieldname": "working_hours",
|
|
||||||
"fieldtype": "Float",
|
|
||||||
"label": "Working Hours",
|
|
||||||
"precision": "1",
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "shift",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Shift",
|
|
||||||
"options": "Shift Type"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "late_entry",
|
"fieldname": "late_entry",
|
||||||
@ -173,7 +174,8 @@
|
|||||||
"icon": "fa fa-ok",
|
"icon": "fa fa-ok",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2019-07-29 20:35:40.845422",
|
"links": [],
|
||||||
|
"modified": "2020-01-27 20:25:29.572281",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Attendance",
|
"name": "Attendance",
|
||||||
|
@ -52,7 +52,7 @@ class Attendance(Document):
|
|||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
from erpnext.controllers.status_updater import validate_status
|
from erpnext.controllers.status_updater import validate_status
|
||||||
validate_status(self.status, ["Present", "Absent", "On Leave", "Half Day"])
|
validate_status(self.status, ["Present", "Absent", "On Leave", "Half Day", "Work From Home"])
|
||||||
self.validate_attendance_date()
|
self.validate_attendance_date()
|
||||||
self.validate_duplicate_record()
|
self.validate_duplicate_record()
|
||||||
self.check_leave_record()
|
self.check_leave_record()
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
frappe.listview_settings['Attendance'] = {
|
frappe.listview_settings['Attendance'] = {
|
||||||
add_fields: ["status", "attendance_date"],
|
add_fields: ["status", "attendance_date"],
|
||||||
get_indicator: function(doc) {
|
get_indicator: function (doc) {
|
||||||
return [__(doc.status), doc.status=="Present" ? "green" : "darkgrey", "status,=," + doc.status];
|
if (["Present", "Work From Home"].includes(doc.status)) {
|
||||||
|
return [__(doc.status), "green", "status,=," + doc.status];
|
||||||
|
} else if (["Absent", "On Leave"].includes(doc.status)) {
|
||||||
|
return [__(doc.status), "red", "status,=," + doc.status];
|
||||||
|
} else if (doc.status == "Half Day") {
|
||||||
|
return [__(doc.status), "orange", "status,=," + doc.status];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onload: function(list_view) {
|
onload: function(list_view) {
|
||||||
let me = this;
|
let me = this;
|
||||||
@ -44,7 +50,7 @@ frappe.listview_settings['Attendance'] = {
|
|||||||
label: __("Status"),
|
label: __("Status"),
|
||||||
fieldtype: "Select",
|
fieldtype: "Select",
|
||||||
fieldname: "status",
|
fieldname: "status",
|
||||||
options: ["Present", "Absent", "Half Day"],
|
options: ["Present", "Absent", "Half Day", "Work From Home"],
|
||||||
hidden:1,
|
hidden:1,
|
||||||
reqd: 1,
|
reqd: 1,
|
||||||
|
|
||||||
@ -102,5 +108,4 @@ frappe.listview_settings['Attendance'] = {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -124,8 +124,10 @@ erpnext.EmployeeSelector = Class.extend({
|
|||||||
|
|
||||||
var mark_employee_toolbar = $('<div class="col-sm-12 bottom-toolbar">\
|
var mark_employee_toolbar = $('<div class="col-sm-12 bottom-toolbar">\
|
||||||
<button class="btn btn-primary btn-mark-present btn-xs"></button>\
|
<button class="btn btn-primary btn-mark-present btn-xs"></button>\
|
||||||
<button class="btn btn-default btn-mark-absent btn-xs"></button>\
|
<button class="btn btn-primary btn-mark-work-from-home btn-xs"></button>\
|
||||||
<button class="btn btn-default btn-mark-half-day btn-xs"></button></div>')
|
<button class="btn btn-warning btn-mark-half-day btn-xs"></button>\
|
||||||
|
<button class="btn btn-danger btn-mark-absent btn-xs"></button>\
|
||||||
|
</div>');
|
||||||
|
|
||||||
employee_toolbar.find(".btn-add")
|
employee_toolbar.find(".btn-add")
|
||||||
.html(__('Check all'))
|
.html(__('Check all'))
|
||||||
@ -224,6 +226,31 @@ erpnext.EmployeeSelector = Class.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
mark_employee_toolbar.find(".btn-mark-work-from-home")
|
||||||
|
.html(__('Mark Work From Home'))
|
||||||
|
.on("click", function() {
|
||||||
|
var employee_work_from_home = [];
|
||||||
|
$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
|
||||||
|
if($(check).is(":checked")) {
|
||||||
|
employee_work_from_home.push(employee[i]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.hr.doctype.employee_attendance_tool.employee_attendance_tool.mark_employee_attendance",
|
||||||
|
args:{
|
||||||
|
"employee_list":employee_work_from_home,
|
||||||
|
"status":"Work From Home",
|
||||||
|
"date":frm.doc.date,
|
||||||
|
"company":frm.doc.company
|
||||||
|
},
|
||||||
|
|
||||||
|
callback: function(r) {
|
||||||
|
erpnext.employee_attendance_tool.load_employees(frm);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var row;
|
var row;
|
||||||
$.each(employee, function(i, m) {
|
$.each(employee, function(i, m) {
|
||||||
if (i===0 || (i % 4) === 0) {
|
if (i===0 || (i % 4) === 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user