Added Employee Report Attendance Report
Made Holiday details mandatory
diff --git a/erpnext/config/hr.py b/erpnext/config/hr.py
index 3942766..4501be7 100644
--- a/erpnext/config/hr.py
+++ b/erpnext/config/hr.py
@@ -179,6 +179,12 @@
},
{
"type": "report",
+ "is_query_report": True,
+ "name": "Employee Holiday Attendance",
+ "doctype": "Employee"
+ },
+ {
+ "type": "report",
"name": "Employee Information",
"doctype": "Employee"
},
@@ -194,6 +200,7 @@
"name": "Monthly Attendance Sheet",
"doctype": "Attendance"
},
+
]
},
{
diff --git a/erpnext/hr/doctype/attendance/attendance.json b/erpnext/hr/doctype/attendance/attendance.json
index 78391c8..de32328 100644
--- a/erpnext/hr/doctype/attendance/attendance.json
+++ b/erpnext/hr/doctype/attendance/attendance.json
@@ -26,6 +26,7 @@
"options": "Simple",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -51,6 +52,7 @@
"options": "ATT-",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -76,6 +78,7 @@
"options": "Employee",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -100,6 +103,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -126,6 +130,7 @@
"options": "\nPresent\nAbsent\nHalf Day",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -151,6 +156,7 @@
"options": "Leave Type",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
"reqd": 0,
@@ -173,6 +179,7 @@
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -198,6 +205,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -223,6 +231,7 @@
"options": "Fiscal Year",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -248,6 +257,7 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -271,6 +281,7 @@
"options": "Attendance",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -289,7 +300,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:42.089225",
+ "modified": "2016-01-25 15:36:36.252173",
"modified_by": "Administrator",
"module": "HR",
"name": "Attendance",
diff --git a/erpnext/hr/doctype/holiday/holiday.json b/erpnext/hr/doctype/holiday/holiday.json
index a7fc6a7..091dd13 100644
--- a/erpnext/hr/doctype/holiday/holiday.json
+++ b/erpnext/hr/doctype/holiday/holiday.json
@@ -22,10 +22,11 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
@@ -48,9 +49,10 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -65,12 +67,13 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:47.483435",
+ "modified": "2016-01-27 11:52:46.864792",
"modified_by": "Administrator",
"module": "HR",
"name": "Holiday",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "sort_order": "ASC"
}
\ No newline at end of file
diff --git a/erpnext/hr/report/employee_holiday_attendance/__init__.py b/erpnext/hr/report/employee_holiday_attendance/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/__init__.py
diff --git a/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.js b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.js
new file mode 100644
index 0000000..f1037ff
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.query_reports["Employee Holiday Attendance"] = {
+ "filters": [
+
+ ]
+}
diff --git a/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.json b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.json
new file mode 100644
index 0000000..f538d30
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.json
@@ -0,0 +1,18 @@
+{
+ "add_total_row": 0,
+ "apply_user_permissions": 1,
+ "creation": "2016-01-27 11:12:14.972452",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2016-01-27 11:12:14.972452",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee Holiday Attendance",
+ "owner": "Administrator",
+ "ref_doctype": "Attendance",
+ "report_name": "Employee Holiday Attendance",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.py b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.py
new file mode 100644
index 0000000..ce8d5dd
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.py
@@ -0,0 +1,43 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+
+
+def execute(filters=None):
+ if not filters:
+ filters = {}
+
+ columns = get_columns()
+ data = get_employees()
+ return columns, data
+
+
+def get_columns():
+
+ return [
+ _("Employee") + ":Link/Employee:120", _("Name") + ":Data:200", _("Date")+ ":Date:100",
+ _("Status") + ":Data:70",_("Holiday") + ":Data:200"
+
+ ]
+
+
+def get_employees():
+ holidays = frappe.get_all("Holiday", fields=["holiday_date", "description"])
+ holiday_names = {}
+ holidays_list = []
+
+ for holiday in holidays:
+ holidays_list.append("'" + holiday.holiday_date.strftime('%Y-%m-%d') + "'")
+ holiday_names[holiday.holiday_date] = holiday.description
+
+ employee_list = frappe.db.sql(
+ "select employee, employee_name, att_date, status from tabAttendance where att_date in ("
+ + ', '.join(holidays_list) + ")",
+ as_list=True)
+
+ for employee_data in employee_list:
+ employee_data.append(holiday_names[employee_data[2]])
+ return employee_list