templating for hr
diff --git a/erpnext/config/hr.py b/erpnext/config/hr.py
index 1fac469..575de69 100644
--- a/erpnext/config/hr.py
+++ b/erpnext/config/hr.py
@@ -13,13 +13,13 @@
},
{
"type": "doctype",
- "name": "Salary Slip",
- "description": _("Monthly salary statement."),
+ "name": "Leave Application",
+ "description": _("Applications for leave."),
},
{
"type": "doctype",
- "name": "Leave Application",
- "description": _("Applications for leave."),
+ "name": "Expense Claim",
+ "description": _("Claims for company expense."),
},
{
"type": "doctype",
@@ -28,8 +28,8 @@
},
{
"type": "doctype",
- "name": "Expense Claim",
- "description": _("Claims for company expense."),
+ "name": "Salary Slip",
+ "description": _("Monthly salary statement."),
},
{
"type": "doctype",
diff --git a/erpnext/hr/doctype/attendance/attendance.json b/erpnext/hr/doctype/attendance/attendance.json
index 2ca5b33..18c39e0 100644
--- a/erpnext/hr/doctype/attendance/attendance.json
+++ b/erpnext/hr/doctype/attendance/attendance.json
@@ -129,7 +129,7 @@
"icon": "icon-ok",
"idx": 1,
"is_submittable": 1,
- "modified": "2014-05-27 03:49:07.580876",
+ "modified": "2014-08-05 06:52:02.226904",
"modified_by": "Administrator",
"module": "HR",
"name": "Attendance",
@@ -178,5 +178,6 @@
],
"search_fields": "employee, employee_name, att_date, status",
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "title_field": "employee_name"
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/attendance/attendance_list.html b/erpnext/hr/doctype/attendance/attendance_list.html
new file mode 100644
index 0000000..bfda7f8
--- /dev/null
+++ b/erpnext/hr/doctype/attendance/attendance_list.html
@@ -0,0 +1,19 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-10">
+ <div class="text-ellipsis">
+ {%= list.get_avatar_and_id(doc) %}
+
+ <span class="label
+ label-{%= {"Present":"success", "Absent":"default", "Half Day": "warning"}[doc.status] %} filterable"
+ title="{%= __("Status") %}"
+ data-filter="status,=,{%= doc.status %}">
+ {%= doc.status %}
+ </span>
+ </div>
+ </div>
+ <div class="col-xs-2 text-right">
+ <span style="margin-right: 8px;" class="filterable"
+ data-filter="att_date,=,{%= doc.att_date %}">
+ {%= doc.get_formatted("att_date") %}</span>
+ </div>
+</div>
diff --git a/erpnext/hr/doctype/attendance/attendance_list.js b/erpnext/hr/doctype/attendance/attendance_list.js
new file mode 100644
index 0000000..87c87d7
--- /dev/null
+++ b/erpnext/hr/doctype/attendance/attendance_list.js
@@ -0,0 +1,3 @@
+frappe.listview_settings['Attendance'] = {
+ add_fields: ["status", "att_date"],
+};
diff --git a/erpnext/hr/doctype/attendance/test_attendance.py b/erpnext/hr/doctype/attendance/test_attendance.py
new file mode 100644
index 0000000..e4f390b
--- /dev/null
+++ b/erpnext/hr/doctype/attendance/test_attendance.py
@@ -0,0 +1,10 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
+# See license.txt
+
+import frappe
+import unittest
+
+test_records = frappe.get_test_records('Attendance')
+
+class TestAttendance(unittest.TestCase):
+ pass
diff --git a/erpnext/hr/doctype/attendance/test_records.json b/erpnext/hr/doctype/attendance/test_records.json
new file mode 100644
index 0000000..ccb77bf
--- /dev/null
+++ b/erpnext/hr/doctype/attendance/test_records.json
@@ -0,0 +1,6 @@
+[
+ {
+ "doctype": "Attendance",
+ "name": "_Test Attendance 1"
+ }
+]
diff --git a/erpnext/hr/doctype/employee/employee_list.html b/erpnext/hr/doctype/employee/employee_list.html
new file mode 100644
index 0000000..98b45a9
--- /dev/null
+++ b/erpnext/hr/doctype/employee/employee_list.html
@@ -0,0 +1,35 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-12">
+ <div class="text-ellipsis">
+ {%= list.get_avatar_and_id(doc) %}
+
+ {% if(doc.status==="Active") { %}
+ <span style="margin-right: 8px;"
+ title="{%= __("Active") %}" class="filterable"
+ data-filter="status,=,Active">
+ <i class="icon-ok"></i>
+ </span>
+ {% } %}
+
+ {% if(doc.designation) { %}
+ <span style="margin-right: 8px;" class="filterable"
+ data-filter="designation,=,{%= doc.designation %}">
+ {%= doc.designation %}</span>
+ {% } %}
+
+ {% if(doc.branch) { %}
+ <span class="label label-default filterable"
+ data-filter="branch,=,{%= doc.branch %}">
+ <i class="icon-map-marker"></i> {%= doc.branch %}
+ </span>
+ {% } %}
+
+ {% if(doc.department) { %}
+ <span class="label label-default filterable"
+ data-filter="department,=,{%= doc.department %}">
+ <i class="icon-sitemap"></i> {%= doc.department %}
+ </span>
+ {% } %}
+ </div>
+ </div>
+</div>
diff --git a/erpnext/hr/doctype/employee/employee_list.js b/erpnext/hr/doctype/employee/employee_list.js
new file mode 100644
index 0000000..c1b23ac
--- /dev/null
+++ b/erpnext/hr/doctype/employee/employee_list.js
@@ -0,0 +1,4 @@
+frappe.listview_settings['Employee'] = {
+ add_fields: ["status", "branch", "department", "designation"],
+ filters:[["status","=", "Active"]]
+};
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim_list.html b/erpnext/hr/doctype/expense_claim/expense_claim_list.html
new file mode 100644
index 0000000..dd3c78f
--- /dev/null
+++ b/erpnext/hr/doctype/expense_claim/expense_claim_list.html
@@ -0,0 +1,23 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-10">
+ <div class="text-ellipsis">
+ {%= list.get_avatar_and_id(doc) %}
+
+ <span style="margin-right: 8px;" class="filterable"
+ data-filter="employee,=,{%= doc.employee %}">
+ {%= doc.employee_name %}</span>
+
+ <span class="label
+ label-{%= frappe.utils.guess_style(doc.approval_status) %} filterable"
+ title="{%= __("Status") %}"
+ data-filter="status,=,{%= doc.approval_status %}">
+ {%= doc.approval_status %}
+ </span>
+
+ </div>
+ </div>
+ <!-- sample graph -->
+ <div class="col-xs-2 text-right">
+ {%= doc.get_formatted("total_claimed_amount") %}
+ </div>
+</div>
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim_list.js b/erpnext/hr/doctype/expense_claim/expense_claim_list.js
new file mode 100644
index 0000000..34ee5c1
--- /dev/null
+++ b/erpnext/hr/doctype/expense_claim/expense_claim_list.js
@@ -0,0 +1,4 @@
+frappe.listview_settings['Expense Claim'] = {
+ add_fields: ["approval_status", "employee", "employee_name", "total_claimed_amount"],
+ filters:[["approval_status","!=", "Rejected"]]
+};
diff --git a/erpnext/hr/doctype/leave_application/leave_application_list.html b/erpnext/hr/doctype/leave_application/leave_application_list.html
new file mode 100644
index 0000000..dfae436
--- /dev/null
+++ b/erpnext/hr/doctype/leave_application/leave_application_list.html
@@ -0,0 +1,28 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-12">
+ <div class="text-ellipsis">
+ {%= list.get_avatar_and_id(doc) %}
+
+ <span style="margin-right: 8px;" class="filterable"
+ data-filter="employee,=,{%= doc.employee %}">
+ {%= doc.employee_name %}</span>
+
+ <span style="margin-right: 8px;" class="text-muted">
+ {%= __("{0} days from {1}",
+ [doc.total_leave_days, doc.get_formatted("from_date")]) %}</span>
+
+ <span class="label
+ label-{%= frappe.utils.guess_style(doc.status) %} filterable"
+ title="{%= __("Status") %}"
+ data-filter="status,=,{%= doc.status %}">
+ {%= doc.status %}
+ </span>
+
+ <span class="label label-default filterable"
+ title="{%= __("Leave Type") %}"
+ data-filter="leave_type,=,{%= doc.leave_type %}">
+ {%= doc.leave_type %}
+ </span>
+ </div>
+ </div>
+</div>
diff --git a/erpnext/hr/doctype/leave_application/leave_application_list.js b/erpnext/hr/doctype/leave_application/leave_application_list.js
new file mode 100644
index 0000000..e2a8901
--- /dev/null
+++ b/erpnext/hr/doctype/leave_application/leave_application_list.js
@@ -0,0 +1,4 @@
+frappe.listview_settings['Leave Application'] = {
+ add_fields: ["status", "leave_type", "employee", "employee_name", "total_leave_days", "from_date"],
+ filters:[["status","!=", "Rejected"], ["to_date", ">=", frappe.datetime.get_today()]]
+};
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip_list.html b/erpnext/hr/doctype/salary_slip/salary_slip_list.html
new file mode 100644
index 0000000..ef54450
--- /dev/null
+++ b/erpnext/hr/doctype/salary_slip/salary_slip_list.html
@@ -0,0 +1,26 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-9">
+ <div class="text-ellipsis">
+ {%= list.get_avatar_and_id(doc) %}
+
+ <!-- sample text -->
+ <span style="margin-right: 8px;" class="filterable"
+ data-filter="employee,=,{%= doc.employee %}">
+ {%= doc.employee_name %}</span>
+
+ </div>
+ </div>
+ <div class="col-xs-3 text-right">
+ <span class="label label-default filterable"
+ title="{%= __("Month") %}"
+ data-filter="month,=,{%= doc.month %}">
+ {%= doc.month %}
+ </span>
+
+ <span class="label label-default filterable"
+ title="{%= __("Fiscal Year") %}"
+ data-filter="fiscal_year,=,{%= doc.fiscal_year %}">
+ {%= doc.fiscal_year %}
+ </span>
+ </div>
+</div>
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip_list.js b/erpnext/hr/doctype/salary_slip/salary_slip_list.js
new file mode 100644
index 0000000..17f13d6
--- /dev/null
+++ b/erpnext/hr/doctype/salary_slip/salary_slip_list.js
@@ -0,0 +1,3 @@
+frappe.listview_settings['Salary Slip'] = {
+ add_fields: ["employee", "employee_name", "fiscal_year", "month"],
+};
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.json b/erpnext/hr/doctype/salary_structure/salary_structure.json
index c31696c..2ddd95b 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.json
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.json
@@ -227,7 +227,7 @@
],
"icon": "icon-file-text",
"idx": 1,
- "modified": "2014-05-27 03:49:17.438605",
+ "modified": "2014-08-05 06:56:27.038404",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Structure",
@@ -260,5 +260,6 @@
}
],
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "title_field": "employee_name"
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure/test_records.json b/erpnext/hr/doctype/salary_structure/test_records.json
new file mode 100644
index 0000000..28d37c2
--- /dev/null
+++ b/erpnext/hr/doctype/salary_structure/test_records.json
@@ -0,0 +1,6 @@
+[
+ {
+ "doctype": "Salary Structure",
+ "name": "_Test Salary Structure 1"
+ }
+]
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.py b/erpnext/hr/doctype/salary_structure/test_salary_structure.py
new file mode 100644
index 0000000..0a1db7e
--- /dev/null
+++ b/erpnext/hr/doctype/salary_structure/test_salary_structure.py
@@ -0,0 +1,10 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
+# See license.txt
+
+import frappe
+import unittest
+
+test_records = frappe.get_test_records('Salary Structure')
+
+class TestSalaryStructure(unittest.TestCase):
+ pass
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index 9b2c6d0..cdb494e 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -7,11 +7,11 @@
cur_frm.add_custom_button(__("Gantt Chart"), function() {
frappe.route_options = {"project": doc.name}
frappe.set_route("Gantt", "Task");
- }, "icon-tasks");
+ }, "icon-tasks", true);
cur_frm.add_custom_button(__("Tasks"), function() {
frappe.route_options = {"project": doc.name}
frappe.set_route("List", "Task");
- }, "icon-list");
+ }, "icon-list", true);
}
}
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit_list.html b/erpnext/support/doctype/maintenance_visit/maintenance_visit_list.html
new file mode 100644
index 0000000..2ddef7a
--- /dev/null
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit_list.html
@@ -0,0 +1,35 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-12">
+ <div class="text-ellipsis">
+ {%= list.get_avatar_and_id(doc) %}
+
+ <!-- sample text -->
+ <span style="margin-right: 8px;" class="filterable"
+ data-filter="customer,=,{%= doc.customer %}">
+ {%= doc.customer_name %}</span>
+
+ <!-- sample label -->
+ {% var style = {
+ "Scheduled": "default",
+ "Unscheduled": "default",
+ "Breakdown": "danger"
+ }[doc.maintenance_type] %}
+ <span class="label
+ label-{%= style %} filterable"
+ data-filter="maintenance_type,=,{%= doc.maintenance_type %}">
+ {%= doc.maintenance_type %}
+ </span>
+ {% var style = doc.completion_status==="Partially Completed" ? "warning" : "success" %}
+ <span class="label
+ label-{%= style %} filterable"
+ data-filter="completion_status,=,{%= doc.completion_status %}">
+ {%= doc.completion_status %}
+ </span>
+ </div>
+ </div>
+ <!-- sample graph -->
+ <div class="col-xs-1 text-right">
+ {% var completed = doc.completed, title = __("Completed") %}
+ {% include "templates/form_grid/includes/progress.html" %}
+ </div>
+</div>
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit_list.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit_list.js
new file mode 100644
index 0000000..77f28d7
--- /dev/null
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit_list.js
@@ -0,0 +1,3 @@
+frappe.listview_settings['Maintenance Visit'] = {
+ add_fields: ["customer", "customer_name", "completion_status", "maintenance_type"],
+};
diff --git a/erpnext/utilities/doctype/note/note_list.html b/erpnext/utilities/doctype/note/note_list.html
new file mode 100644
index 0000000..e106dd4
--- /dev/null
+++ b/erpnext/utilities/doctype/note/note_list.html
@@ -0,0 +1,16 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-12">
+ <div class="text-ellipsis">
+ {%= list.get_avatar_and_id(doc) %}
+
+ {% if(doc.public) { %}
+ <span style="margin-right: 8px;"
+ title="{%= __("Private") %}" class="filterable"
+ data-filter="public,=,Yes">
+ <i class="icon-lock text-muted"></i>
+ </span>
+ {% } %}
+
+ </div>
+ </div>
+</div>
diff --git a/erpnext/utilities/doctype/note/note_list.js b/erpnext/utilities/doctype/note/note_list.js
index b188941..a713aca 100644
--- a/erpnext/utilities/doctype/note/note_list.js
+++ b/erpnext/utilities/doctype/note/note_list.js
@@ -1,4 +1,5 @@
frappe.listview_settings['Note'] = {
+ add_fields: ["title", "public"],
set_title_left: function() {
frappe.set_route();
}