templating for hr
This commit is contained in:
parent
a660464cec
commit
7a4e739d6c
@ -13,13 +13,13 @@ def get_data():
|
||||
},
|
||||
{
|
||||
"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 @@ def get_data():
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Expense Claim",
|
||||
"description": _("Claims for company expense."),
|
||||
"name": "Salary Slip",
|
||||
"description": _("Monthly salary statement."),
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
|
@ -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"
|
||||
}
|
19
erpnext/hr/doctype/attendance/attendance_list.html
Normal file
19
erpnext/hr/doctype/attendance/attendance_list.html
Normal file
@ -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>
|
3
erpnext/hr/doctype/attendance/attendance_list.js
Normal file
3
erpnext/hr/doctype/attendance/attendance_list.js
Normal file
@ -0,0 +1,3 @@
|
||||
frappe.listview_settings['Attendance'] = {
|
||||
add_fields: ["status", "att_date"],
|
||||
};
|
10
erpnext/hr/doctype/attendance/test_attendance.py
Normal file
10
erpnext/hr/doctype/attendance/test_attendance.py
Normal file
@ -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
|
6
erpnext/hr/doctype/attendance/test_records.json
Normal file
6
erpnext/hr/doctype/attendance/test_records.json
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Attendance",
|
||||
"name": "_Test Attendance 1"
|
||||
}
|
||||
]
|
35
erpnext/hr/doctype/employee/employee_list.html
Normal file
35
erpnext/hr/doctype/employee/employee_list.html
Normal file
@ -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>
|
4
erpnext/hr/doctype/employee/employee_list.js
Normal file
4
erpnext/hr/doctype/employee/employee_list.js
Normal file
@ -0,0 +1,4 @@
|
||||
frappe.listview_settings['Employee'] = {
|
||||
add_fields: ["status", "branch", "department", "designation"],
|
||||
filters:[["status","=", "Active"]]
|
||||
};
|
23
erpnext/hr/doctype/expense_claim/expense_claim_list.html
Normal file
23
erpnext/hr/doctype/expense_claim/expense_claim_list.html
Normal file
@ -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>
|
4
erpnext/hr/doctype/expense_claim/expense_claim_list.js
Normal file
4
erpnext/hr/doctype/expense_claim/expense_claim_list.js
Normal file
@ -0,0 +1,4 @@
|
||||
frappe.listview_settings['Expense Claim'] = {
|
||||
add_fields: ["approval_status", "employee", "employee_name", "total_claimed_amount"],
|
||||
filters:[["approval_status","!=", "Rejected"]]
|
||||
};
|
@ -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>
|
@ -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()]]
|
||||
};
|
26
erpnext/hr/doctype/salary_slip/salary_slip_list.html
Normal file
26
erpnext/hr/doctype/salary_slip/salary_slip_list.html
Normal file
@ -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>
|
3
erpnext/hr/doctype/salary_slip/salary_slip_list.js
Normal file
3
erpnext/hr/doctype/salary_slip/salary_slip_list.js
Normal file
@ -0,0 +1,3 @@
|
||||
frappe.listview_settings['Salary Slip'] = {
|
||||
add_fields: ["employee", "employee_name", "fiscal_year", "month"],
|
||||
};
|
@ -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"
|
||||
}
|
6
erpnext/hr/doctype/salary_structure/test_records.json
Normal file
6
erpnext/hr/doctype/salary_structure/test_records.json
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Salary Structure",
|
||||
"name": "_Test Salary Structure 1"
|
||||
}
|
||||
]
|
10
erpnext/hr/doctype/salary_structure/test_salary_structure.py
Normal file
10
erpnext/hr/doctype/salary_structure/test_salary_structure.py
Normal file
@ -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
|
@ -7,11 +7,11 @@ cur_frm.cscript.refresh = function(doc) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>
|
@ -0,0 +1,3 @@
|
||||
frappe.listview_settings['Maintenance Visit'] = {
|
||||
add_fields: ["customer", "customer_name", "completion_status", "maintenance_type"],
|
||||
};
|
16
erpnext/utilities/doctype/note/note_list.html
Normal file
16
erpnext/utilities/doctype/note/note_list.html
Normal file
@ -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>
|
@ -1,4 +1,5 @@
|
||||
frappe.listview_settings['Note'] = {
|
||||
add_fields: ["title", "public"],
|
||||
set_title_left: function() {
|
||||
frappe.set_route();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user