mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
Merge remote-tracking branch 'webnotes/4.0.0-wip' into permissions
Conflicts: erpnext/accounts/page/accounts_browser/accounts_browser.css erpnext/controllers/buying_controller.py erpnext/manufacturing/doctype/production_order/production_order.py erpnext/patches/patch_list.py erpnext/selling/doctype/customer/customer.txt erpnext/selling/doctype/sales_order/sales_order.py erpnext/selling/doctype/sales_order/test_sales_order.py erpnext/setup/doctype/features_setup/features_setup.txt erpnext/stock/doctype/stock_entry/test_stock_entry.py erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py startup/query_handlers.py
This commit is contained in:
6
erpnext/hr/README.md
Normal file
6
erpnext/hr/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
Key features:
|
||||
|
||||
- Leave and Attendance
|
||||
- Payroll
|
||||
- Appraisal
|
||||
- Expense Claim
|
||||
0
erpnext/hr/__init__.py
Normal file
0
erpnext/hr/__init__.py
Normal file
1
erpnext/hr/doctype/__init__.py
Normal file
1
erpnext/hr/doctype/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
1
erpnext/hr/doctype/appraisal/README.md
Normal file
1
erpnext/hr/doctype/appraisal/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Performance of an Employee in a Time Period against given goals.
|
||||
1
erpnext/hr/doctype/appraisal/__init__.py
Normal file
1
erpnext/hr/doctype/appraisal/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
75
erpnext/hr/doctype/appraisal/appraisal.js
Normal file
75
erpnext/hr/doctype/appraisal/appraisal.js
Normal file
@@ -0,0 +1,75 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
cur_frm.add_fetch('employee', 'company', 'company');
|
||||
cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
|
||||
|
||||
cur_frm.cscript.onload = function(doc,cdt,cdn){
|
||||
if(!doc.status)
|
||||
set_multiple(cdt,cdn,{status:'Draft'});
|
||||
if(doc.amended_from && doc.__islocal) {
|
||||
doc.status = "Draft";
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){
|
||||
if(doc.__islocal && doc.employee==wn.defaults.get_user_default("employee")) {
|
||||
cur_frm.set_value("employee", "");
|
||||
cur_frm.set_value("employee_name", "")
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.kra_template = function(doc, dt, dn) {
|
||||
wn.model.map_current_doc({
|
||||
method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template",
|
||||
source_name: cur_frm.doc.kra_template,
|
||||
});
|
||||
}
|
||||
|
||||
cur_frm.cscript.calculate_total_score = function(doc,cdt,cdn){
|
||||
//return get_server_fields('calculate_total','','',doc,cdt,cdn,1);
|
||||
var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
|
||||
var total =0;
|
||||
for(var i = 0; i<val.length; i++){
|
||||
total = flt(total)+flt(val[i].score_earned)
|
||||
}
|
||||
doc.total_score = flt(total)
|
||||
refresh_field('total_score')
|
||||
}
|
||||
|
||||
cur_frm.cscript.score = function(doc,cdt,cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
if (d.score){
|
||||
if (flt(d.score) > 5) {
|
||||
msgprint(wn._("Score must be less than or equal to 5"));
|
||||
d.score = 0;
|
||||
refresh_field('score', d.name, 'appraisal_details');
|
||||
}
|
||||
total = flt(d.per_weightage*d.score)/100;
|
||||
d.score_earned = total.toPrecision(2);
|
||||
refresh_field('score_earned', d.name, 'appraisal_details');
|
||||
}
|
||||
else{
|
||||
d.score_earned = 0;
|
||||
refresh_field('score_earned', d.name, 'appraisal_details');
|
||||
}
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
}
|
||||
|
||||
cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
||||
var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
|
||||
var total =0;
|
||||
for(var i = 0; i<val.length; i++){
|
||||
total = flt(total)+flt(val[i].score_earned);
|
||||
}
|
||||
doc.total_score = flt(total);
|
||||
refresh_field('total_score');
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
|
||||
return{ query: "erpnext.controllers.queries.employee_query" }
|
||||
}
|
||||
83
erpnext/hr/doctype/appraisal/appraisal.py
Normal file
83
erpnext/hr/doctype/appraisal/appraisal.py
Normal file
@@ -0,0 +1,83 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import cstr, flt, getdate
|
||||
from webnotes.model.bean import getlist
|
||||
from webnotes import msgprint
|
||||
|
||||
class DocType:
|
||||
def __init__(self, doc, doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
def validate(self):
|
||||
if not self.doc.status:
|
||||
self.doc.status = "Draft"
|
||||
|
||||
self.validate_dates()
|
||||
self.validate_existing_appraisal()
|
||||
self.calculate_total()
|
||||
|
||||
def get_employee_name(self):
|
||||
emp_nm = webnotes.conn.sql("select employee_name from `tabEmployee` where name=%s", self.doc.employee)
|
||||
emp_nm= emp_nm and emp_nm[0][0] or ''
|
||||
self.doc.employee_name = emp_nm
|
||||
return emp_nm
|
||||
|
||||
def validate_dates(self):
|
||||
if getdate(self.doc.start_date) > getdate(self.doc.end_date):
|
||||
msgprint("End Date can not be less than Start Date")
|
||||
raise Exception
|
||||
|
||||
def validate_existing_appraisal(self):
|
||||
chk = webnotes.conn.sql("""select name from `tabAppraisal` where employee=%s
|
||||
and (status='Submitted' or status='Completed')
|
||||
and ((start_date>=%s and start_date<=%s)
|
||||
or (end_date>=%s and end_date<=%s))""",(self.doc.employee,self.doc.start_date,self.doc.end_date,self.doc.start_date,self.doc.end_date))
|
||||
if chk:
|
||||
msgprint("You have already created Appraisal "\
|
||||
+cstr(chk[0][0])+" in the current date range for employee "\
|
||||
+cstr(self.doc.employee_name))
|
||||
raise Exception
|
||||
|
||||
def calculate_total(self):
|
||||
total, total_w = 0, 0
|
||||
for d in getlist(self.doclist, 'appraisal_details'):
|
||||
if d.score:
|
||||
d.score_earned = flt(d.score) * flt(d.per_weightage) / 100
|
||||
total = total + d.score_earned
|
||||
total_w += flt(d.per_weightage)
|
||||
|
||||
if int(total_w) != 100:
|
||||
msgprint("Total weightage assigned should be 100%. It is :" + str(total_w) + "%",
|
||||
raise_exception=1)
|
||||
|
||||
if webnotes.conn.get_value("Employee", self.doc.employee, "user_id") != \
|
||||
webnotes.session.user and total == 0:
|
||||
msgprint("Total can't be zero. You must atleast give some points!", raise_exception=1)
|
||||
|
||||
self.doc.total_score = total
|
||||
|
||||
def on_submit(self):
|
||||
webnotes.conn.set(self.doc, 'status', 'Submitted')
|
||||
|
||||
def on_cancel(self):
|
||||
webnotes.conn.set(self.doc, 'status', 'Cancelled')
|
||||
|
||||
@webnotes.whitelist()
|
||||
def fetch_appraisal_template(source_name, target_doclist=None):
|
||||
from webnotes.model.mapper import get_mapped_doclist
|
||||
|
||||
doclist = get_mapped_doclist("Appraisal Template", source_name, {
|
||||
"Appraisal Template": {
|
||||
"doctype": "Appraisal",
|
||||
},
|
||||
"Appraisal Template Goal": {
|
||||
"doctype": "Appraisal Goal",
|
||||
}
|
||||
}, target_doclist)
|
||||
|
||||
return [d.fields for d in doclist]
|
||||
252
erpnext/hr/doctype/appraisal/appraisal.txt
Normal file
252
erpnext/hr/doctype/appraisal/appraisal.txt
Normal file
@@ -0,0 +1,252 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:12",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:55",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "ashwini@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"autoname": "APRSL.#####",
|
||||
"doctype": "DocType",
|
||||
"icon": "icon-thumbs-up",
|
||||
"is_submittable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__",
|
||||
"search_fields": "status, employee, employee_name"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Appraisal",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Appraisal",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Appraisal"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Employee Details",
|
||||
"oldfieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"description": "Select template from which you want to get the Goals",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "kra_template",
|
||||
"fieldtype": "Link",
|
||||
"label": "Appraisal Template",
|
||||
"oldfieldname": "kra_template",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Appraisal Template",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"description": "Select the Employee for whom you are creating the Appraisal.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "For Employee",
|
||||
"oldfieldname": "employee",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Employee",
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_name",
|
||||
"fieldtype": "Data",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "For Employee Name",
|
||||
"oldfieldname": "employee_name",
|
||||
"oldfieldtype": "Data",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break0",
|
||||
"fieldtype": "Column Break",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"default": "Draft",
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Status",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "status",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nDraft\nSubmitted\nCompleted\nCancelled",
|
||||
"read_only": 1,
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "start_date",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Start Date",
|
||||
"oldfieldname": "start_date",
|
||||
"oldfieldtype": "Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "end_date",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"label": "End Date",
|
||||
"oldfieldname": "end_date",
|
||||
"oldfieldtype": "Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "section_break0",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Goals",
|
||||
"oldfieldtype": "Section Break",
|
||||
"options": "Simple"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "appraisal_details",
|
||||
"fieldtype": "Table",
|
||||
"label": "Appraisal Goals",
|
||||
"oldfieldname": "appraisal_details",
|
||||
"oldfieldtype": "Table",
|
||||
"options": "Appraisal Goal"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "calculate_total_score",
|
||||
"fieldtype": "Button",
|
||||
"label": "Calculate Total Score",
|
||||
"oldfieldtype": "Button",
|
||||
"options": "calculate_total"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "total_score",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"label": "Total Score (Out of 5)",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "total_score",
|
||||
"oldfieldtype": "Currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "section_break1",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"description": "Any other comments, noteworthy effort that should go in the records.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "comments",
|
||||
"fieldtype": "Text",
|
||||
"label": "Comments"
|
||||
},
|
||||
{
|
||||
"depends_on": "kra_template",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "other_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Other Details"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Company",
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "link:Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "fiscal_year",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Fiscal Year",
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "link:Fiscal Year",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"ignore_restrictions": 1,
|
||||
"label": "Amended From",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "amended_from",
|
||||
"oldfieldtype": "Data",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 1,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"match": "owner",
|
||||
"role": "Employee",
|
||||
"submit": 0
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"cancel": 1,
|
||||
"doctype": "DocPerm",
|
||||
"role": "System Manager",
|
||||
"submit": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"cancel": 1,
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR User",
|
||||
"submit": 1
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/appraisal_goal/README.md
Normal file
1
erpnext/hr/doctype/appraisal_goal/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Goal for the parent Appraisal.
|
||||
1
erpnext/hr/doctype/appraisal_goal/__init__.py
Normal file
1
erpnext/hr/doctype/appraisal_goal/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
9
erpnext/hr/doctype/appraisal_goal/appraisal_goal.py
Normal file
9
erpnext/hr/doctype/appraisal_goal/appraisal_goal.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
77
erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
Normal file
77
erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
Normal file
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:27:44",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:22:53",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "ashwini@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"autoname": "APRSLD.#####",
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Appraisal Goal",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Appraisal Goal"
|
||||
},
|
||||
{
|
||||
"description": "Key Responsibility Area",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "kra",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Goal",
|
||||
"oldfieldname": "kra",
|
||||
"oldfieldtype": "Small Text",
|
||||
"print_width": "240px",
|
||||
"reqd": 1,
|
||||
"width": "240px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "per_weightage",
|
||||
"fieldtype": "Float",
|
||||
"label": "Weightage (%)",
|
||||
"oldfieldname": "per_weightage",
|
||||
"oldfieldtype": "Currency",
|
||||
"print_width": "70px",
|
||||
"reqd": 1,
|
||||
"width": "70px"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "score",
|
||||
"fieldtype": "Float",
|
||||
"label": "Score (0-5)",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "score",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\n0\n1\n2\n3\n4\n5",
|
||||
"print_width": "70px",
|
||||
"width": "70px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "score_earned",
|
||||
"fieldtype": "Float",
|
||||
"label": "Score Earned",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "score_earned",
|
||||
"oldfieldtype": "Currency",
|
||||
"print_width": "70px",
|
||||
"read_only": 1,
|
||||
"width": "70px"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/appraisal_template/README.md
Normal file
1
erpnext/hr/doctype/appraisal_template/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Standard set of goals for an Employee / Designation / Job Profile. New Appraisal transactions can be created from the Template.
|
||||
1
erpnext/hr/doctype/appraisal_template/__init__.py
Normal file
1
erpnext/hr/doctype/appraisal_template/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
20
erpnext/hr/doctype/appraisal_template/appraisal_template.py
Normal file
20
erpnext/hr/doctype/appraisal_template/appraisal_template.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes import _
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def validate(self):
|
||||
self.doc.total_points = 0
|
||||
for d in self.doclist.get({"doctype":"Appraisal Template Goal"}):
|
||||
self.doc.total_points += int(d.per_weightage or 0)
|
||||
|
||||
if int(self.doc.total_points) != 100:
|
||||
webnotes.msgprint(_("Total (sum of) points distribution for all goals should be 100.") \
|
||||
+ " " + _("Not") + " " + str(self.doc.total_points),
|
||||
raise_exception=True)
|
||||
82
erpnext/hr/doctype/appraisal_template/appraisal_template.txt
Normal file
82
erpnext/hr/doctype/appraisal_template/appraisal_template.txt
Normal file
@@ -0,0 +1,82 @@
|
||||
[
|
||||
{
|
||||
"creation": "2012-07-03 13:30:39",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:55",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "ashwini@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "field:kra_title",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-file-text",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Appraisal Template",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Appraisal Template",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Appraisal Template"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "kra_title",
|
||||
"fieldtype": "Data",
|
||||
"label": "Appraisal Template Title",
|
||||
"oldfieldname": "kra_title",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
"oldfieldname": "description",
|
||||
"oldfieldtype": "Small Text",
|
||||
"print_width": "300px",
|
||||
"width": "300px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "kra_sheet",
|
||||
"fieldtype": "Table",
|
||||
"label": "Appraisal Template Goal",
|
||||
"oldfieldname": "kra_sheet",
|
||||
"oldfieldtype": "Table",
|
||||
"options": "Appraisal Template Goal"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "total_points",
|
||||
"fieldtype": "Int",
|
||||
"label": "Total Points"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/appraisal_template_goal/README.md
Normal file
1
erpnext/hr/doctype/appraisal_template_goal/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Goal details for the parent Appraisal Template.
|
||||
1
erpnext/hr/doctype/appraisal_template_goal/__init__.py
Normal file
1
erpnext/hr/doctype/appraisal_template_goal/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
@@ -0,0 +1,51 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:27:44",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:22:54",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "ashwini@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"autoname": "KSHEET.#####",
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Appraisal Template Goal",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Appraisal Template Goal"
|
||||
},
|
||||
{
|
||||
"description": "Key Performance Area",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "kra",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "KRA",
|
||||
"oldfieldname": "kra",
|
||||
"oldfieldtype": "Small Text",
|
||||
"print_width": "200px",
|
||||
"width": "200px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "per_weightage",
|
||||
"fieldtype": "Float",
|
||||
"label": "Weightage (%)",
|
||||
"oldfieldname": "per_weightage",
|
||||
"oldfieldtype": "Currency",
|
||||
"print_width": "100px",
|
||||
"width": "100px"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/attendance/README.md
Normal file
1
erpnext/hr/doctype/attendance/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Attendance record of an Employee on a particular date.
|
||||
1
erpnext/hr/doctype/attendance/__init__.py
Normal file
1
erpnext/hr/doctype/attendance/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
15
erpnext/hr/doctype/attendance/attendance.js
Normal file
15
erpnext/hr/doctype/attendance/attendance.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
cur_frm.add_fetch('employee', 'company', 'company');
|
||||
cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
|
||||
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
if(doc.__islocal) cur_frm.set_value("att_date", get_today());
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
|
||||
return{
|
||||
query: "erpnext.controllers.queries.employee_query"
|
||||
}
|
||||
}
|
||||
62
erpnext/hr/doctype/attendance/attendance.py
Normal file
62
erpnext/hr/doctype/attendance/attendance.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import getdate, nowdate
|
||||
from webnotes import msgprint, _
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self, doc, doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
def validate_duplicate_record(self):
|
||||
res = webnotes.conn.sql("""select name from `tabAttendance` where employee = %s and att_date = %s
|
||||
and name != %s and docstatus = 1""",
|
||||
(self.doc.employee, self.doc.att_date, self.doc.name))
|
||||
if res:
|
||||
msgprint(_("Attendance for the employee: ") + self.doc.employee +
|
||||
_(" already marked"), raise_exception=1)
|
||||
|
||||
def check_leave_record(self):
|
||||
if self.doc.status == 'Present':
|
||||
leave = webnotes.conn.sql("""select name from `tabLeave Application`
|
||||
where employee = %s and %s between from_date and to_date and status = 'Approved'
|
||||
and docstatus = 1""", (self.doc.employee, self.doc.att_date))
|
||||
|
||||
if leave:
|
||||
webnotes.msgprint(_("Employee: ") + self.doc.employee + _(" was on leave on ")
|
||||
+ self.doc.att_date + _(". You can not mark his attendance as 'Present'"),
|
||||
raise_exception=1)
|
||||
|
||||
def validate_fiscal_year(self):
|
||||
from erpnext.accounts.utils import validate_fiscal_year
|
||||
validate_fiscal_year(self.doc.att_date, self.doc.fiscal_year)
|
||||
|
||||
def validate_att_date(self):
|
||||
if getdate(self.doc.att_date) > getdate(nowdate()):
|
||||
msgprint(_("Attendance can not be marked for future dates"), raise_exception=1)
|
||||
|
||||
def validate_employee(self):
|
||||
emp = webnotes.conn.sql("select name from `tabEmployee` where name = %s and status = 'Active'",
|
||||
self.doc.employee)
|
||||
if not emp:
|
||||
msgprint(_("Employee: ") + self.doc.employee +
|
||||
_(" not active or does not exists in the system"), raise_exception=1)
|
||||
|
||||
def validate(self):
|
||||
from erpnext.utilities import validate_status
|
||||
validate_status(self.doc.status, ["Present", "Absent", "Half Day"])
|
||||
self.validate_fiscal_year()
|
||||
self.validate_att_date()
|
||||
self.validate_duplicate_record()
|
||||
self.check_leave_record()
|
||||
|
||||
def on_update(self):
|
||||
# this is done because sometimes user entered wrong employee name
|
||||
# while uploading employee attendance
|
||||
employee_name = webnotes.conn.get_value("Employee", self.doc.employee, "employee_name")
|
||||
webnotes.conn.set(self.doc, 'employee_name', employee_name)
|
||||
179
erpnext/hr/doctype/attendance/attendance.txt
Normal file
179
erpnext/hr/doctype/attendance/attendance.txt
Normal file
@@ -0,0 +1,179 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:13",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:55",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "ashwini@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "naming_series:",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-ok",
|
||||
"is_submittable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__",
|
||||
"search_fields": "employee, employee_name, att_date, status"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Attendance",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Attendance",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Attendance"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "attendance_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Attendance Details",
|
||||
"oldfieldtype": "Section Break",
|
||||
"options": "Simple"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"label": "Series",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "naming_series",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "ATT",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "Employee",
|
||||
"oldfieldname": "employee",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Employee",
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Employee Name",
|
||||
"oldfieldname": "employee_name",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"default": "Present",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Status",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "status",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nPresent\nAbsent\nHalf Day",
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "leave_type",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Leave Type",
|
||||
"oldfieldname": "leave_type",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Leave Type",
|
||||
"print_hide": 1,
|
||||
"report_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break0",
|
||||
"fieldtype": "Column Break",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "att_date",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"label": "Attendance Date",
|
||||
"oldfieldname": "att_date",
|
||||
"oldfieldtype": "Date",
|
||||
"reqd": 1,
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "fiscal_year",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Fiscal Year",
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "link:Fiscal Year",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Company",
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "link:Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"ignore_restrictions": 1,
|
||||
"label": "Amended From",
|
||||
"no_copy": 1,
|
||||
"options": "Attendance",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "System Manager"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR User"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR Manager"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/branch/README.md
Normal file
1
erpnext/hr/doctype/branch/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Location belonging to the organization where Employees can belong.
|
||||
1
erpnext/hr/doctype/branch/__init__.py
Normal file
1
erpnext/hr/doctype/branch/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
10
erpnext/hr/doctype/branch/branch.py
Normal file
10
erpnext/hr/doctype/branch/branch.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
73
erpnext/hr/doctype/branch/branch.txt
Normal file
73
erpnext/hr/doctype/branch/branch.txt
Normal file
@@ -0,0 +1,73 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:13",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:57",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:branch",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-code-fork",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Branch",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Branch",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Branch"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"oldfieldtype": "Small Text",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "branch",
|
||||
"fieldtype": "Data",
|
||||
"label": "Branch",
|
||||
"oldfieldname": "branch",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR User"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR Manager"
|
||||
}
|
||||
]
|
||||
4
erpnext/hr/doctype/branch/test_branch.py
Normal file
4
erpnext/hr/doctype/branch/test_branch.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_records = [[{"doctype":"Branch", "branch":"_Test Branch"}]]
|
||||
3
erpnext/hr/doctype/deduction_type/README.md
Normal file
3
erpnext/hr/doctype/deduction_type/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Type of salary deduction.
|
||||
|
||||
e.g. Tax paid on behalf of the employee that is deducted from the salary.
|
||||
1
erpnext/hr/doctype/deduction_type/__init__.py
Normal file
1
erpnext/hr/doctype/deduction_type/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
9
erpnext/hr/doctype/deduction_type/deduction_type.py
Normal file
9
erpnext/hr/doctype/deduction_type/deduction_type.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
78
erpnext/hr/doctype/deduction_type/deduction_type.txt
Normal file
78
erpnext/hr/doctype/deduction_type/deduction_type.txt
Normal file
@@ -0,0 +1,78 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-22 16:50:30",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:02",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:deduction_name",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-flag",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Deduction Type",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Deduction Type",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Deduction Type"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"oldfieldtype": "Small Text",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "deduction_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Name",
|
||||
"oldfieldname": "deduction_name",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
"oldfieldname": "description",
|
||||
"oldfieldtype": "Small Text",
|
||||
"width": "300px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
13
erpnext/hr/doctype/deduction_type/test_deduction_type.py
Normal file
13
erpnext/hr/doctype/deduction_type/test_deduction_type.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_records = [
|
||||
[{
|
||||
"doctype": "Deduction Type",
|
||||
"deduction_name": "_Test Professional Tax"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Deduction Type",
|
||||
"deduction_name": "_Test TDS"
|
||||
}]
|
||||
]
|
||||
1
erpnext/hr/doctype/department/README.md
Normal file
1
erpnext/hr/doctype/department/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Department where Employee belongs.
|
||||
1
erpnext/hr/doctype/department/__init__.py
Normal file
1
erpnext/hr/doctype/department/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
10
erpnext/hr/doctype/department/department.py
Normal file
10
erpnext/hr/doctype/department/department.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
76
erpnext/hr/doctype/department/department.txt
Normal file
76
erpnext/hr/doctype/department/department.txt
Normal file
@@ -0,0 +1,76 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-05 11:48:26",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:04",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "field:department_name",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-sitemap",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Department",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Department",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Department"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"oldfieldtype": "Small Text",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "department_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Department",
|
||||
"oldfieldname": "department_name",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"description": "Days for which Holidays are blocked for this department.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "leave_block_list",
|
||||
"fieldtype": "Link",
|
||||
"label": "Leave Block List",
|
||||
"options": "Leave Block List"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
9
erpnext/hr/doctype/department/test_department.py
Normal file
9
erpnext/hr/doctype/department/test_department.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_ignore = ["Leave Block List"]
|
||||
|
||||
test_records = [
|
||||
[{"doctype":"Department", "department_name":"_Test Department"}],
|
||||
[{"doctype":"Department", "department_name":"_Test Department 1"}]
|
||||
]
|
||||
1
erpnext/hr/doctype/designation/README.md
Normal file
1
erpnext/hr/doctype/designation/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Employee Designation.
|
||||
1
erpnext/hr/doctype/designation/__init__.py
Normal file
1
erpnext/hr/doctype/designation/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
10
erpnext/hr/doctype/designation/designation.py
Normal file
10
erpnext/hr/doctype/designation/designation.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
69
erpnext/hr/doctype/designation/designation.txt
Normal file
69
erpnext/hr/doctype/designation/designation.txt
Normal file
@@ -0,0 +1,69 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:13",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:04",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:designation_name",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-bookmark",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Designation",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Designation",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Designation"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"oldfieldtype": "Small Text",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "designation_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Designation",
|
||||
"oldfieldname": "designation_name",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
4
erpnext/hr/doctype/designation/test_designation.py
Normal file
4
erpnext/hr/doctype/designation/test_designation.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_records = [[{"doctype":"Designation", "designation_name":"_Test Designation"}]]
|
||||
3
erpnext/hr/doctype/earning_type/README.md
Normal file
3
erpnext/hr/doctype/earning_type/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Type of earning that is a part of the salary.
|
||||
|
||||
e.g. basic salary, bonus etc.
|
||||
1
erpnext/hr/doctype/earning_type/__init__.py
Normal file
1
erpnext/hr/doctype/earning_type/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
9
erpnext/hr/doctype/earning_type/earning_type.py
Normal file
9
erpnext/hr/doctype/earning_type/earning_type.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
99
erpnext/hr/doctype/earning_type/earning_type.txt
Normal file
99
erpnext/hr/doctype/earning_type/earning_type.txt
Normal file
@@ -0,0 +1,99 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-24 11:03:32",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:05",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:earning_name",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-flag",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Earning Type",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Earning Type",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Earning Type"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"oldfieldtype": "Small Text",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "earning_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Name",
|
||||
"oldfieldname": "earning_name",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
"oldfieldname": "description",
|
||||
"oldfieldtype": "Small Text",
|
||||
"reqd": 0,
|
||||
"width": "300px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "taxable",
|
||||
"fieldtype": "Select",
|
||||
"label": "Taxable",
|
||||
"oldfieldname": "taxable",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nYes\nNo",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.taxable=='No'",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "exemption_limit",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"label": "Exemption Limit",
|
||||
"oldfieldname": "exemption_limit",
|
||||
"oldfieldtype": "Currency"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
15
erpnext/hr/doctype/earning_type/test_earning_type.py
Normal file
15
erpnext/hr/doctype/earning_type/test_earning_type.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_records = [
|
||||
[{
|
||||
"doctype": "Earning Type",
|
||||
"earning_name": "_Test Basic Salary",
|
||||
"taxable": "Yes"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Earning Type",
|
||||
"earning_name": "_Test Allowance",
|
||||
"taxable": "Yes"
|
||||
}]
|
||||
]
|
||||
1
erpnext/hr/doctype/employee/README.md
Normal file
1
erpnext/hr/doctype/employee/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Employee master.
|
||||
1
erpnext/hr/doctype/employee/__init__.py
Normal file
1
erpnext/hr/doctype/employee/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
96
erpnext/hr/doctype/employee/employee.js
Normal file
96
erpnext/hr/doctype/employee/employee.js
Normal file
@@ -0,0 +1,96 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
wn.provide("erpnext.hr");
|
||||
erpnext.hr.EmployeeController = wn.ui.form.Controller.extend({
|
||||
setup: function() {
|
||||
this.frm.fields_dict.user_id.get_query = function(doc,cdt,cdn) {
|
||||
return { query:"core.doctype.profile.profile.profile_query"} }
|
||||
this.frm.fields_dict.reports_to.get_query = function(doc,cdt,cdn) {
|
||||
return{ query: "erpnext.controllers.queries.employee_query"} }
|
||||
},
|
||||
|
||||
onload: function() {
|
||||
this.setup_leave_approver_select();
|
||||
this.frm.toggle_display(["esic_card_no", "gratuity_lic_id", "pan_number", "pf_number"],
|
||||
wn.control_panel.country==="India");
|
||||
if(this.frm.doc.__islocal) this.frm.set_value("employee_name", "");
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
var me = this;
|
||||
erpnext.hide_naming_series();
|
||||
if(!this.frm.doc.__islocal) {
|
||||
cur_frm.add_custom_button(wn._('Make Salary Structure'), function() {
|
||||
me.make_salary_structure(this); });
|
||||
}
|
||||
},
|
||||
|
||||
setup_leave_approver_select: function() {
|
||||
var me = this;
|
||||
return this.frm.call({
|
||||
method: "erpnext.hr.utils.get_leave_approver_list",
|
||||
callback: function(r) {
|
||||
var df = wn.meta.get_docfield("Employee Leave Approver", "leave_approver",
|
||||
me.frm.doc.name);
|
||||
df.options = $.map(r.message, function(profile) {
|
||||
return {value: profile, label: wn.user_info(profile).fullname};
|
||||
});
|
||||
me.frm.fields_dict.employee_leave_approvers.refresh();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
date_of_birth: function() {
|
||||
return cur_frm.call({
|
||||
method: "get_retirement_date",
|
||||
args: {date_of_birth: this.frm.doc.date_of_birth}
|
||||
});
|
||||
},
|
||||
|
||||
salutation: function() {
|
||||
if(this.frm.doc.salutation) {
|
||||
this.frm.set_value("gender", {
|
||||
"Mr": "Male",
|
||||
"Ms": "Female"
|
||||
}[this.frm.doc.salutation]);
|
||||
}
|
||||
},
|
||||
|
||||
make_salary_structure: function(btn) {
|
||||
var me = this;
|
||||
this.validate_salary_structure(btn, function(r) {
|
||||
if(r.message) {
|
||||
msgprint(wn._("Employee") + ' "' + me.frm.doc.name + '": '
|
||||
+ wn._("An active Salary Structure already exists. \
|
||||
If you want to create new one, please ensure that no active \
|
||||
Salary Structure exists for this Employee. \
|
||||
Go to the active Salary Structure and set \"Is Active\" = \"No\""));
|
||||
} else if(!r.exc) {
|
||||
wn.model.map({
|
||||
source: wn.model.get_doclist(me.frm.doc.doctype, me.frm.doc.name),
|
||||
target: "Salary Structure"
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
validate_salary_structure: function(btn, callback) {
|
||||
var me = this;
|
||||
return this.frm.call({
|
||||
btn: btn,
|
||||
method: "webnotes.client.get_value",
|
||||
args: {
|
||||
doctype: "Salary Structure",
|
||||
fieldname: "name",
|
||||
filters: {
|
||||
employee: me.frm.doc.name,
|
||||
is_active: "Yes",
|
||||
docstatus: ["!=", 2]
|
||||
},
|
||||
},
|
||||
callback: callback
|
||||
});
|
||||
},
|
||||
});
|
||||
cur_frm.cscript = new erpnext.hr.EmployeeController({frm: cur_frm});
|
||||
199
erpnext/hr/doctype/employee/employee.py
Normal file
199
erpnext/hr/doctype/employee/employee.py
Normal file
@@ -0,0 +1,199 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import getdate, validate_email_add, cstr, cint
|
||||
from webnotes.model.doc import make_autoname
|
||||
from webnotes import msgprint, _
|
||||
import webnotes.permissions
|
||||
from webnotes.defaults import get_restrictions
|
||||
from webnotes.model.controller import DocListController
|
||||
|
||||
class DocType(DocListController):
|
||||
def autoname(self):
|
||||
naming_method = webnotes.conn.get_value("HR Settings", None, "emp_created_by")
|
||||
if not naming_method:
|
||||
webnotes.throw(_("Please setup Employee Naming System in Human Resource > HR Settings"))
|
||||
else:
|
||||
if naming_method=='Naming Series':
|
||||
self.doc.name = make_autoname(self.doc.naming_series + '.####')
|
||||
elif naming_method=='Employee Number':
|
||||
self.doc.name = self.doc.employee_number
|
||||
|
||||
self.doc.employee = self.doc.name
|
||||
|
||||
def validate(self):
|
||||
from erpnext.utilities import validate_status
|
||||
validate_status(self.doc.status, ["Active", "Left"])
|
||||
|
||||
self.doc.employee = self.doc.name
|
||||
self.validate_date()
|
||||
self.validate_email()
|
||||
self.validate_status()
|
||||
self.validate_employee_leave_approver()
|
||||
self.update_dob_event()
|
||||
|
||||
def on_update(self):
|
||||
if self.doc.user_id:
|
||||
self.restrict_user()
|
||||
self.update_user_default()
|
||||
self.update_profile()
|
||||
|
||||
self.restrict_leave_approver()
|
||||
|
||||
def restrict_user(self):
|
||||
"""restrict to this employee for user"""
|
||||
self.add_restriction_if_required("Employee", self.doc.user_id)
|
||||
|
||||
def update_user_default(self):
|
||||
webnotes.conn.set_default("employee_name", self.doc.employee_name, self.doc.user_id)
|
||||
webnotes.conn.set_default("company", self.doc.company, self.doc.user_id)
|
||||
|
||||
def restrict_leave_approver(self):
|
||||
"""restrict to this employee for leave approver"""
|
||||
employee_leave_approvers = [d.leave_approver for d in self.doclist.get({"parentfield": "employee_leave_approvers"})]
|
||||
if self.doc.reports_to and self.doc.reports_to not in employee_leave_approvers:
|
||||
employee_leave_approvers.append(webnotes.conn.get_value("Employee", self.doc.reports_to, "user_id"))
|
||||
|
||||
for user in employee_leave_approvers:
|
||||
self.add_restriction_if_required("Employee", user)
|
||||
self.add_restriction_if_required("Leave Application", user)
|
||||
|
||||
def add_restriction_if_required(self, doctype, user):
|
||||
if webnotes.permissions.has_only_non_restrict_role(webnotes.get_doctype(doctype), user) \
|
||||
and self.doc.name not in get_restrictions(user).get("Employee", []):
|
||||
|
||||
webnotes.defaults.add_default("Employee", self.doc.name, user, "Restriction")
|
||||
|
||||
def update_profile(self):
|
||||
# add employee role if missing
|
||||
if not "Employee" in webnotes.conn.sql_list("""select role from tabUserRole
|
||||
where parent=%s""", self.doc.user_id):
|
||||
from webnotes.profile import add_role
|
||||
add_role(self.doc.user_id, "Employee")
|
||||
|
||||
profile_wrapper = webnotes.bean("Profile", self.doc.user_id)
|
||||
|
||||
# copy details like Fullname, DOB and Image to Profile
|
||||
if self.doc.employee_name:
|
||||
employee_name = self.doc.employee_name.split(" ")
|
||||
if len(employee_name) >= 3:
|
||||
profile_wrapper.doc.last_name = " ".join(employee_name[2:])
|
||||
profile_wrapper.doc.middle_name = employee_name[1]
|
||||
elif len(employee_name) == 2:
|
||||
profile_wrapper.doc.last_name = employee_name[1]
|
||||
|
||||
profile_wrapper.doc.first_name = employee_name[0]
|
||||
|
||||
if self.doc.date_of_birth:
|
||||
profile_wrapper.doc.birth_date = self.doc.date_of_birth
|
||||
|
||||
if self.doc.gender:
|
||||
profile_wrapper.doc.gender = self.doc.gender
|
||||
|
||||
if self.doc.image:
|
||||
if not profile_wrapper.doc.user_image == self.doc.image:
|
||||
profile_wrapper.doc.user_image = self.doc.image
|
||||
try:
|
||||
webnotes.doc({
|
||||
"doctype": "File Data",
|
||||
"file_name": self.doc.image,
|
||||
"attached_to_doctype": "Profile",
|
||||
"attached_to_name": self.doc.user_id
|
||||
}).insert()
|
||||
except webnotes.DuplicateEntryError, e:
|
||||
# already exists
|
||||
pass
|
||||
profile_wrapper.ignore_permissions = True
|
||||
profile_wrapper.save()
|
||||
|
||||
def validate_date(self):
|
||||
if self.doc.date_of_birth and self.doc.date_of_joining and getdate(self.doc.date_of_birth) >= getdate(self.doc.date_of_joining):
|
||||
msgprint('Date of Joining must be greater than Date of Birth')
|
||||
raise Exception
|
||||
|
||||
elif self.doc.scheduled_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.scheduled_confirmation_date) < getdate(self.doc.date_of_joining)):
|
||||
msgprint('Scheduled Confirmation Date must be greater than Date of Joining')
|
||||
raise Exception
|
||||
|
||||
elif self.doc.final_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.final_confirmation_date) < getdate(self.doc.date_of_joining)):
|
||||
msgprint('Final Confirmation Date must be greater than Date of Joining')
|
||||
raise Exception
|
||||
|
||||
elif self.doc.date_of_retirement and self.doc.date_of_joining and (getdate(self.doc.date_of_retirement) <= getdate(self.doc.date_of_joining)):
|
||||
msgprint('Date Of Retirement must be greater than Date of Joining')
|
||||
raise Exception
|
||||
|
||||
elif self.doc.relieving_date and self.doc.date_of_joining and (getdate(self.doc.relieving_date) <= getdate(self.doc.date_of_joining)):
|
||||
msgprint('Relieving Date must be greater than Date of Joining')
|
||||
raise Exception
|
||||
|
||||
elif self.doc.contract_end_date and self.doc.date_of_joining and (getdate(self.doc.contract_end_date)<=getdate(self.doc.date_of_joining)):
|
||||
msgprint('Contract End Date must be greater than Date of Joining')
|
||||
raise Exception
|
||||
|
||||
def validate_email(self):
|
||||
if self.doc.company_email and not validate_email_add(self.doc.company_email):
|
||||
msgprint("Please enter valid Company Email")
|
||||
raise Exception
|
||||
if self.doc.personal_email and not validate_email_add(self.doc.personal_email):
|
||||
msgprint("Please enter valid Personal Email")
|
||||
raise Exception
|
||||
|
||||
def validate_status(self):
|
||||
if self.doc.status == 'Left' and not self.doc.relieving_date:
|
||||
msgprint("Please enter relieving date.")
|
||||
raise Exception
|
||||
|
||||
def validate_employee_leave_approver(self):
|
||||
from webnotes.profile import Profile
|
||||
from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
|
||||
|
||||
for l in self.doclist.get({"parentfield": "employee_leave_approvers"}):
|
||||
if "Leave Approver" not in Profile(l.leave_approver).get_roles():
|
||||
msgprint(_("Invalid Leave Approver") + ": \"" + l.leave_approver + "\"",
|
||||
raise_exception=InvalidLeaveApproverError)
|
||||
|
||||
def update_dob_event(self):
|
||||
if self.doc.status == "Active" and self.doc.date_of_birth \
|
||||
and not cint(webnotes.conn.get_value("HR Settings", None, "stop_birthday_reminders")):
|
||||
birthday_event = webnotes.conn.sql("""select name from `tabEvent` where repeat_on='Every Year'
|
||||
and ref_type='Employee' and ref_name=%s""", self.doc.name)
|
||||
|
||||
starts_on = self.doc.date_of_birth + " 00:00:00"
|
||||
ends_on = self.doc.date_of_birth + " 00:15:00"
|
||||
|
||||
if birthday_event:
|
||||
event = webnotes.bean("Event", birthday_event[0][0])
|
||||
event.doc.starts_on = starts_on
|
||||
event.doc.ends_on = ends_on
|
||||
event.save()
|
||||
else:
|
||||
webnotes.bean({
|
||||
"doctype": "Event",
|
||||
"subject": _("Birthday") + ": " + self.doc.employee_name,
|
||||
"description": _("Happy Birthday!") + " " + self.doc.employee_name,
|
||||
"starts_on": starts_on,
|
||||
"ends_on": ends_on,
|
||||
"event_type": "Public",
|
||||
"all_day": 1,
|
||||
"send_reminder": 1,
|
||||
"repeat_this_event": 1,
|
||||
"repeat_on": "Every Year",
|
||||
"ref_type": "Employee",
|
||||
"ref_name": self.doc.name
|
||||
}).insert()
|
||||
else:
|
||||
webnotes.conn.sql("""delete from `tabEvent` where repeat_on='Every Year' and
|
||||
ref_type='Employee' and ref_name=%s""", self.doc.name)
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_retirement_date(date_of_birth=None):
|
||||
import datetime
|
||||
ret = {}
|
||||
if date_of_birth:
|
||||
dt = getdate(date_of_birth) + datetime.timedelta(21915)
|
||||
ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')}
|
||||
return ret
|
||||
775
erpnext/hr/doctype/employee/employee.txt
Normal file
775
erpnext/hr/doctype/employee/employee.txt
Normal file
@@ -0,0 +1,775 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-03-07 09:04:18",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-23 19:35:27",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_attach": 1,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "naming_series:",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-user",
|
||||
"module": "HR",
|
||||
"name": "__common__",
|
||||
"search_fields": "employee_name"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Employee",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Employee",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"submit": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Employee"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "basic_information",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Basic Information",
|
||||
"oldfieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break0",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "image_view",
|
||||
"fieldtype": "Image",
|
||||
"in_list_view": 0,
|
||||
"label": "Image View",
|
||||
"options": "image"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"label": "Employee",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1,
|
||||
"report_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"label": "Series",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "naming_series",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "EMP/",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "salutation",
|
||||
"fieldtype": "Select",
|
||||
"label": "Salutation",
|
||||
"oldfieldname": "salutation",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nMr\nMs",
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Full Name",
|
||||
"oldfieldname": "employee_name",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Select",
|
||||
"label": "Image",
|
||||
"options": "attach_files:"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break1",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"description": "System User (login) ID. If set, it will become default for all HR forms.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "user_id",
|
||||
"fieldtype": "Link",
|
||||
"label": "User ID",
|
||||
"options": "Profile"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_number",
|
||||
"fieldtype": "Data",
|
||||
"in_filter": 1,
|
||||
"label": "Employee Number",
|
||||
"oldfieldname": "employee_number",
|
||||
"oldfieldtype": "Data",
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "date_of_joining",
|
||||
"fieldtype": "Date",
|
||||
"label": "Date of Joining",
|
||||
"oldfieldname": "date_of_joining",
|
||||
"oldfieldtype": "Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"description": "You can enter any date manually",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "date_of_birth",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"label": "Date of Birth",
|
||||
"oldfieldname": "date_of_birth",
|
||||
"oldfieldtype": "Date",
|
||||
"reqd": 1,
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "gender",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Gender",
|
||||
"oldfieldname": "gender",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nMale\nFemale",
|
||||
"reqd": 1,
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Company",
|
||||
"options": "link:Company",
|
||||
"print_hide": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employment_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Employment Details"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "col_break_21",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "Active",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Status",
|
||||
"oldfieldname": "status",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nActive\nLeft",
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employment_type",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Employment Type",
|
||||
"oldfieldname": "employment_type",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Employment Type",
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"description": "Applicable Holiday List",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "holiday_list",
|
||||
"fieldtype": "Link",
|
||||
"label": "Holiday List",
|
||||
"oldfieldname": "holiday_list",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Holiday List"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "col_break_22",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "scheduled_confirmation_date",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"label": "Offer Date",
|
||||
"oldfieldname": "scheduled_confirmation_date",
|
||||
"oldfieldtype": "Date",
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "final_confirmation_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Confirmation Date",
|
||||
"oldfieldname": "final_confirmation_date",
|
||||
"oldfieldtype": "Date",
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "contract_end_date",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"label": "Contract End Date",
|
||||
"oldfieldname": "contract_end_date",
|
||||
"oldfieldtype": "Date",
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "date_of_retirement",
|
||||
"fieldtype": "Date",
|
||||
"label": "Date Of Retirement",
|
||||
"oldfieldname": "date_of_retirement",
|
||||
"oldfieldtype": "Date"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "job_profile",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Job Profile"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break2",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "branch",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "Branch",
|
||||
"oldfieldname": "branch",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Branch",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "department",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "Department",
|
||||
"oldfieldname": "department",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Department",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "designation",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "Designation",
|
||||
"oldfieldname": "designation",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Designation",
|
||||
"reqd": 0,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "grade",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "Grade",
|
||||
"oldfieldname": "grade",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Grade",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"description": "Provide email id registered in company",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company_email",
|
||||
"fieldtype": "Data",
|
||||
"in_filter": 1,
|
||||
"label": "Company Email",
|
||||
"oldfieldname": "company_email",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "notice_number_of_days",
|
||||
"fieldtype": "Int",
|
||||
"label": "Notice (days)",
|
||||
"oldfieldname": "notice_number_of_days",
|
||||
"oldfieldtype": "Int"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "salary_information",
|
||||
"fieldtype": "Column Break",
|
||||
"label": "Salary Information",
|
||||
"oldfieldtype": "Section Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "salary_mode",
|
||||
"fieldtype": "Select",
|
||||
"label": "Salary Mode",
|
||||
"oldfieldname": "salary_mode",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nBank\nCash\nCheque"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.salary_mode == 'Bank'",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "bank_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"in_filter": 1,
|
||||
"label": "Bank Name",
|
||||
"oldfieldname": "bank_name",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Suggest"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.salary_mode == 'Bank'",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "bank_ac_no",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Bank A/C No.",
|
||||
"oldfieldname": "bank_ac_no",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "esic_card_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "ESIC CARD No",
|
||||
"oldfieldname": "esic_card_no",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "pf_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "PF Number",
|
||||
"oldfieldname": "pf_number",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "gratuity_lic_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Gratuity LIC ID",
|
||||
"oldfieldname": "gratuity_lic_id",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "organization_profile",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Organization Profile"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "reports_to",
|
||||
"fieldtype": "Link",
|
||||
"ignore_restrictions": 1,
|
||||
"label": "Reports to",
|
||||
"oldfieldname": "reports_to",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Employee"
|
||||
},
|
||||
{
|
||||
"description": "The first Leave Approver in the list will be set as the default Leave Approver",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_leave_approvers",
|
||||
"fieldtype": "Table",
|
||||
"label": "Leave Approvers",
|
||||
"options": "Employee Leave Approver"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "contact_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Contact Details"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break3",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "cell_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "Cell Number"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "personal_email",
|
||||
"fieldtype": "Data",
|
||||
"label": "Personal Email"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "emergency_contact_details",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Emergency Contact Details",
|
||||
"options": "<h4 class=\"text-muted\">Emergency Contact Details</h4>"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "person_to_be_contacted",
|
||||
"fieldtype": "Data",
|
||||
"label": "Emergency Contact"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "relation",
|
||||
"fieldtype": "Data",
|
||||
"label": "Relation"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "emergency_phone_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "Emergency Phone"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break4",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "permanent_accommodation_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Permanent Address Is",
|
||||
"options": "\nRented\nOwned"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "permanent_address",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Permanent Address"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "current_accommodation_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Current Address Is",
|
||||
"options": "\nRented\nOwned"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "current_address",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Current Address"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "sb53",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Bio"
|
||||
},
|
||||
{
|
||||
"description": "Short biography for website and other publications.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "bio",
|
||||
"fieldtype": "Text Editor",
|
||||
"label": "Bio"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "personal_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Personal Details"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break5",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "pan_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "PAN Number"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "passport_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "Passport Number"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "date_of_issue",
|
||||
"fieldtype": "Date",
|
||||
"label": "Date of Issue"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "valid_upto",
|
||||
"fieldtype": "Date",
|
||||
"label": "Valid Upto"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "place_of_issue",
|
||||
"fieldtype": "Data",
|
||||
"label": "Place of Issue"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break6",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "marital_status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Marital Status",
|
||||
"options": "\nSingle\nMarried\nDivorced\nWidowed"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "blood_group",
|
||||
"fieldtype": "Select",
|
||||
"label": "Blood Group",
|
||||
"options": "\nA+\nA-\nB+\nB-\nAB+\nAB-\nO+\nO-"
|
||||
},
|
||||
{
|
||||
"description": "Here you can maintain family details like name and occupation of parent, spouse and children",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "family_background",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Family Background"
|
||||
},
|
||||
{
|
||||
"description": "Here you can maintain height, weight, allergies, medical concerns etc",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "health_details",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Health Details"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "educational_qualification",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Educational Qualification"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "educational_qualification_details",
|
||||
"fieldtype": "Table",
|
||||
"label": "Educational Qualification Details",
|
||||
"options": "Employee Education"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "previous_work_experience",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Previous Work Experience",
|
||||
"options": "Simple"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "previous_experience_details",
|
||||
"fieldtype": "Table",
|
||||
"label": "Employee External Work History",
|
||||
"options": "Employee External Work History"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "history_in_company",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "History In Company",
|
||||
"options": "Simple"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "experience_in_company_details",
|
||||
"fieldtype": "Table",
|
||||
"label": "Employee Internal Work Historys",
|
||||
"options": "Employee Internal Work History"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "exit",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Exit",
|
||||
"oldfieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break7",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "resignation_letter_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Resignation Letter Date",
|
||||
"oldfieldname": "resignation_letter_date",
|
||||
"oldfieldtype": "Date"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "relieving_date",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"label": "Relieving Date",
|
||||
"oldfieldname": "relieving_date",
|
||||
"oldfieldtype": "Date"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "reason_for_leaving",
|
||||
"fieldtype": "Data",
|
||||
"label": "Reason for Leaving",
|
||||
"oldfieldname": "reason_for_leaving",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "leave_encashed",
|
||||
"fieldtype": "Select",
|
||||
"label": "Leave Encashed?",
|
||||
"oldfieldname": "leave_encashed",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nYes\nNo"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "encashment_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Encashment Date",
|
||||
"oldfieldname": "encashment_date",
|
||||
"oldfieldtype": "Date"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "exit_interview_details",
|
||||
"fieldtype": "Column Break",
|
||||
"label": "Exit Interview Details",
|
||||
"oldfieldname": "col_brk6",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "held_on",
|
||||
"fieldtype": "Date",
|
||||
"label": "Held On",
|
||||
"oldfieldname": "held_on",
|
||||
"oldfieldtype": "Date"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "reason_for_resignation",
|
||||
"fieldtype": "Select",
|
||||
"label": "Reason for Resignation",
|
||||
"oldfieldname": "reason_for_resignation",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nBetter Prospects\nHealth Concerns"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "new_workplace",
|
||||
"fieldtype": "Data",
|
||||
"label": "New Workplace",
|
||||
"oldfieldname": "new_workplace",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "feedback",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Feedback",
|
||||
"oldfieldname": "feedback",
|
||||
"oldfieldtype": "Text"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"oldfieldtype": "Small Text",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"cancel": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"role": "Employee",
|
||||
"write": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"restrict": 0,
|
||||
"role": "HR User",
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"restrict": 1,
|
||||
"role": "HR Manager",
|
||||
"write": 1
|
||||
}
|
||||
]
|
||||
40
erpnext/hr/doctype/employee/test_employee.py
Normal file
40
erpnext/hr/doctype/employee/test_employee.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_records = [[{
|
||||
"doctype":"Employee",
|
||||
"employee_name": "_Test Employee",
|
||||
"naming_series": "_T-Employee-",
|
||||
"date_of_joining": "2010-01-01",
|
||||
"date_of_birth": "1980-01-01",
|
||||
"gender": "Female",
|
||||
"status": "Active",
|
||||
"company": "_Test Company",
|
||||
"user_id": "test@example.com",
|
||||
"department": "_Test Department"
|
||||
}],
|
||||
[{
|
||||
"doctype":"Employee",
|
||||
"employee_name": "_Test Employee 1",
|
||||
"naming_series": "_T-Employee-",
|
||||
"date_of_joining": "2010-01-01",
|
||||
"date_of_birth": "1980-01-01",
|
||||
"gender": "Male",
|
||||
"status": "Active",
|
||||
"company": "_Test Company",
|
||||
"user_id": "test1@example.com",
|
||||
"department": "_Test Department 1"
|
||||
}],
|
||||
[{
|
||||
"doctype":"Employee",
|
||||
"employee_name": "_Test Employee 2",
|
||||
"naming_series": "_T-Employee-",
|
||||
"date_of_joining": "2010-01-01",
|
||||
"date_of_birth": "1980-01-01",
|
||||
"gender": "Male",
|
||||
"status": "Active",
|
||||
"company": "_Test Company",
|
||||
"user_id": "test2@example.com",
|
||||
"department": "_Test Department 1"
|
||||
}]
|
||||
]
|
||||
1
erpnext/hr/doctype/employee_education/README.md
Normal file
1
erpnext/hr/doctype/employee_education/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Education detail for parent Employee.
|
||||
1
erpnext/hr/doctype/employee_education/__init__.py
Normal file
1
erpnext/hr/doctype/employee_education/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
79
erpnext/hr/doctype/employee_education/employee_education.txt
Normal file
79
erpnext/hr/doctype/employee_education/employee_education.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:27:45",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:12",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Employee Education",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Employee Education"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "school_univ",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "School/University",
|
||||
"oldfieldname": "school_univ",
|
||||
"oldfieldtype": "Small Text"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "qualification",
|
||||
"fieldtype": "Data",
|
||||
"label": "Qualification",
|
||||
"oldfieldname": "qualification",
|
||||
"oldfieldtype": "Data",
|
||||
"print_width": "100px",
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "level",
|
||||
"fieldtype": "Select",
|
||||
"label": "Level",
|
||||
"oldfieldname": "level",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Graduate\nPost Graduate\nUnder Graduate"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "year_of_passing",
|
||||
"fieldtype": "Int",
|
||||
"label": "Year of Passing",
|
||||
"oldfieldname": "year_of_passing",
|
||||
"oldfieldtype": "Int"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "class_per",
|
||||
"fieldtype": "Data",
|
||||
"label": "Class / Percentage",
|
||||
"oldfieldname": "class_per",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "maj_opt_subj",
|
||||
"fieldtype": "Text",
|
||||
"label": "Major/Optional Subjects",
|
||||
"oldfieldname": "maj_opt_subj",
|
||||
"oldfieldtype": "Text"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
External work history details of parent Employee.
|
||||
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:27:45",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:12",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Employee External Work History",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Employee External Work History"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Company",
|
||||
"oldfieldname": "company_name",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "designation",
|
||||
"fieldtype": "Data",
|
||||
"label": "Designation",
|
||||
"oldfieldname": "designation",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "salary",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Salary",
|
||||
"oldfieldname": "salary",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "address",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Address",
|
||||
"oldfieldname": "address",
|
||||
"oldfieldtype": "Small Text"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "contact",
|
||||
"fieldtype": "Data",
|
||||
"label": "Contact",
|
||||
"oldfieldname": "contact",
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "total_experience",
|
||||
"fieldtype": "Data",
|
||||
"label": "Total Experience",
|
||||
"oldfieldname": "total_experience",
|
||||
"oldfieldtype": "Data"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
Work history details of parent Employee within the organization.
|
||||
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
@@ -0,0 +1,80 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:27:45",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:12",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Employee Internal Work History",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Employee Internal Work History"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "branch",
|
||||
"fieldtype": "Select",
|
||||
"label": "Branch",
|
||||
"oldfieldname": "branch",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "link:Branch"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "department",
|
||||
"fieldtype": "Select",
|
||||
"label": "Department",
|
||||
"oldfieldname": "department",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "link:Department"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "designation",
|
||||
"fieldtype": "Select",
|
||||
"label": "Designation",
|
||||
"oldfieldname": "designation",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "link:Designation"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "grade",
|
||||
"fieldtype": "Select",
|
||||
"label": "Grade",
|
||||
"oldfieldname": "grade",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "link:Grade"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "from_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "From Date",
|
||||
"oldfieldname": "from_date",
|
||||
"oldfieldtype": "Date"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "to_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "To Date",
|
||||
"oldfieldname": "to_date",
|
||||
"oldfieldtype": "Date"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/employee_leave_approver/README.md
Normal file
1
erpnext/hr/doctype/employee_leave_approver/README.md
Normal file
@@ -0,0 +1 @@
|
||||
User authorized to approve Leave Application for an Employee.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
@@ -0,0 +1,40 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-04-12 06:56:15",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:12",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 0,
|
||||
"autoname": "LAPPR-/.#####",
|
||||
"description": "Users who can approve a specific employee's leave applications",
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "leave_approver",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Leave Approver",
|
||||
"name": "__common__",
|
||||
"parent": "Employee Leave Approver",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"reqd": 1,
|
||||
"width": "200"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Employee Leave Approver"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField"
|
||||
}
|
||||
]
|
||||
3
erpnext/hr/doctype/employment_type/README.md
Normal file
3
erpnext/hr/doctype/employment_type/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Type of employment.
|
||||
|
||||
e.g. Permanent, Probation, Intern etc.
|
||||
1
erpnext/hr/doctype/employment_type/__init__.py
Normal file
1
erpnext/hr/doctype/employment_type/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
10
erpnext/hr/doctype/employment_type/employment_type.py
Normal file
10
erpnext/hr/doctype/employment_type/employment_type.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
72
erpnext/hr/doctype/employment_type/employment_type.txt
Normal file
72
erpnext/hr/doctype/employment_type/employment_type.txt
Normal file
@@ -0,0 +1,72 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:14",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:07",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "field:employee_type_name",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-flag",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Employment Type",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Employment Type",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Employment Type"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_type_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Employment Type",
|
||||
"oldfieldname": "employee_type_name",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"oldfieldtype": "Small Text",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR User"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR Manager"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,5 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_records = [[{"doctype":"Employment Type",
|
||||
"employee_type_name": "_Test Employment Type"}]]
|
||||
1
erpnext/hr/doctype/expense_claim/README.md
Normal file
1
erpnext/hr/doctype/expense_claim/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Amount claimed by Employee for expense made by the Employee on organization's behalf.
|
||||
1
erpnext/hr/doctype/expense_claim/__init__.py
Normal file
1
erpnext/hr/doctype/expense_claim/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
158
erpnext/hr/doctype/expense_claim/expense_claim.js
Normal file
158
erpnext/hr/doctype/expense_claim/expense_claim.js
Normal file
@@ -0,0 +1,158 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
wn.provide("erpnext.hr");
|
||||
|
||||
erpnext.hr.ExpenseClaimController = wn.ui.form.Controller.extend({
|
||||
make_bank_voucher: function() {
|
||||
var me = this;
|
||||
return wn.call({
|
||||
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
|
||||
args: {
|
||||
"company": cur_frm.doc.company,
|
||||
"voucher_type": "Bank Voucher"
|
||||
},
|
||||
callback: function(r) {
|
||||
var jv = wn.model.make_new_doc_and_get_name('Journal Voucher');
|
||||
jv = locals['Journal Voucher'][jv];
|
||||
jv.voucher_type = 'Bank Voucher';
|
||||
jv.company = cur_frm.doc.company;
|
||||
jv.remark = 'Payment against Expense Claim: ' + cur_frm.doc.name;
|
||||
jv.fiscal_year = cur_frm.doc.fiscal_year;
|
||||
|
||||
var d1 = wn.model.add_child(jv, 'Journal Voucher Detail', 'entries');
|
||||
d1.debit = cur_frm.doc.total_sanctioned_amount;
|
||||
|
||||
// credit to bank
|
||||
var d1 = wn.model.add_child(jv, 'Journal Voucher Detail', 'entries');
|
||||
d1.credit = cur_frm.doc.total_sanctioned_amount;
|
||||
if(r.message) {
|
||||
d1.account = r.message.account;
|
||||
d1.balance = r.message.balance;
|
||||
}
|
||||
|
||||
loaddoc('Journal Voucher', jv.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
$.extend(cur_frm.cscript, new erpnext.hr.ExpenseClaimController({frm: cur_frm}));
|
||||
|
||||
cur_frm.add_fetch('employee', 'company', 'company');
|
||||
cur_frm.add_fetch('employee','employee_name','employee_name');
|
||||
|
||||
cur_frm.cscript.onload = function(doc,cdt,cdn) {
|
||||
if(!doc.approval_status)
|
||||
cur_frm.set_value("approval_status", "Draft")
|
||||
|
||||
if (doc.__islocal) {
|
||||
cur_frm.set_value("posting_date", dateutil.get_today());
|
||||
if(doc.amended_from)
|
||||
cur_frm.set_value("approval_status", "Draft");
|
||||
cur_frm.cscript.clear_sanctioned(doc);
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
|
||||
return{
|
||||
query: "erpnext.controllers.queries.employee_query"
|
||||
}
|
||||
}
|
||||
var exp_approver = doc.exp_approver;
|
||||
return cur_frm.call({
|
||||
method: "erpnext.hr.utils.get_expense_approver_list",
|
||||
callback: function(r) {
|
||||
cur_frm.set_df_property("exp_approver", "options", r.message);
|
||||
if(exp_approver) cur_frm.set_value("exp_approver", exp_approver);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cur_frm.cscript.clear_sanctioned = function(doc) {
|
||||
var val = getchildren('Expense Claim Detail', doc.name,
|
||||
'expense_voucher_details', doc.doctype);
|
||||
for(var i = 0; i<val.length; i++){
|
||||
val[i].sanctioned_amount ='';
|
||||
}
|
||||
|
||||
doc.total_sanctioned_amount = '';
|
||||
refresh_many(['sanctioned_amount', 'total_sanctioned_amount']);
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.set_help(doc);
|
||||
|
||||
if(!doc.__islocal) {
|
||||
cur_frm.toggle_enable("exp_approver", (doc.owner==user && doc.approval_status=="Draft"));
|
||||
cur_frm.toggle_enable("approval_status", (doc.exp_approver==user && doc.docstatus==0));
|
||||
|
||||
if(!doc.__islocal && user!=doc.exp_approver)
|
||||
cur_frm.frm_head.appframe.set_title_right("");
|
||||
|
||||
if(doc.docstatus==0 && doc.exp_approver==user && doc.approval_status=="Approved")
|
||||
cur_frm.savesubmit();
|
||||
|
||||
if(doc.docstatus==1 && wn.model.can_create("Journal Voucher"))
|
||||
cur_frm.add_custom_button(wn._("Make Bank Voucher"), cur_frm.cscript.make_bank_voucher);
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.set_help = function(doc) {
|
||||
cur_frm.set_intro("");
|
||||
if(doc.__islocal && !in_list(user_roles, "HR User")) {
|
||||
cur_frm.set_intro(wn._("Fill the form and save it"))
|
||||
} else {
|
||||
if(doc.docstatus==0 && doc.approval_status=="Draft") {
|
||||
if(user==doc.exp_approver) {
|
||||
cur_frm.set_intro(wn._("You are the Expense Approver for this record. Please Update the 'Status' and Save"));
|
||||
} else {
|
||||
cur_frm.set_intro(wn._("Expense Claim is pending approval. Only the Expense Approver can update status."));
|
||||
}
|
||||
} else {
|
||||
if(doc.approval_status=="Approved") {
|
||||
cur_frm.set_intro(wn._("Expense Claim has been approved."));
|
||||
} else if(doc.approval_status=="Rejected") {
|
||||
cur_frm.set_intro(wn._("Expense Claim has been rejected."));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.validate = function(doc) {
|
||||
cur_frm.cscript.calculate_total(doc);
|
||||
}
|
||||
|
||||
cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
||||
doc.total_claimed_amount = 0;
|
||||
doc.total_sanctioned_amount = 0;
|
||||
$.each(wn.model.get("Expense Claim Detail", {parent:doc.name}), function(i, d) {
|
||||
doc.total_claimed_amount += d.claim_amount;
|
||||
if(d.sanctioned_amount==null) {
|
||||
d.sanctioned_amount = d.claim_amount;
|
||||
}
|
||||
doc.total_sanctioned_amount += d.sanctioned_amount;
|
||||
});
|
||||
|
||||
refresh_field("total_claimed_amount");
|
||||
refresh_field('total_sanctioned_amount');
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.calculate_total_amount = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
}
|
||||
cur_frm.cscript.claim_amount = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
|
||||
var child = locals[cdt][cdn];
|
||||
refresh_field("sanctioned_amount", child.name, child.parentfield);
|
||||
}
|
||||
cur_frm.cscript.sanctioned_amount = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
}
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings && wn.boot.notification_settings.expense_claim)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.expense_claim_message);
|
||||
}
|
||||
}
|
||||
31
erpnext/hr/doctype/expense_claim/expense_claim.py
Normal file
31
erpnext/hr/doctype/expense_claim/expense_claim.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
from webnotes.model.bean import getlist
|
||||
from webnotes import msgprint
|
||||
|
||||
class DocType:
|
||||
def __init__(self, doc, doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
def validate(self):
|
||||
self.validate_fiscal_year()
|
||||
self.validate_exp_details()
|
||||
|
||||
def on_submit(self):
|
||||
if self.doc.approval_status=="Draft":
|
||||
webnotes.msgprint("""Please set Approval Status to 'Approved' or \
|
||||
'Rejected' before submitting""", raise_exception=1)
|
||||
|
||||
def validate_fiscal_year(self):
|
||||
from erpnext.accounts.utils import validate_fiscal_year
|
||||
validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date")
|
||||
|
||||
def validate_exp_details(self):
|
||||
if not getlist(self.doclist, 'expense_voucher_details'):
|
||||
msgprint("Please add expense voucher details")
|
||||
raise Exception
|
||||
242
erpnext/hr/doctype/expense_claim/expense_claim.txt
Normal file
242
erpnext/hr/doctype/expense_claim/expense_claim.txt
Normal file
@@ -0,0 +1,242 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:14",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:07",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "harshada@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"autoname": "EXP.######",
|
||||
"doctype": "DocType",
|
||||
"icon": "icon-money",
|
||||
"is_submittable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__",
|
||||
"search_fields": "approval_status,employee,employee_name"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Expense Claim",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Expense Claim",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Expense Claim"
|
||||
},
|
||||
{
|
||||
"default": "Draft",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "approval_status",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Approval Status",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "approval_status",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Draft\nApproved\nRejected",
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "exp_approver",
|
||||
"fieldtype": "Select",
|
||||
"label": "Approver",
|
||||
"oldfieldname": "exp_approver",
|
||||
"oldfieldtype": "Select",
|
||||
"width": "160px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break0",
|
||||
"fieldtype": "Column Break",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "total_claimed_amount",
|
||||
"fieldtype": "Currency",
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Total Claimed Amount",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "total_claimed_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1,
|
||||
"reqd": 0,
|
||||
"width": "160px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "total_sanctioned_amount",
|
||||
"fieldtype": "Currency",
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Total Sanctioned Amount",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "total_sanctioned_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1,
|
||||
"width": "160px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "expense_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Expense Details",
|
||||
"oldfieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "expense_voucher_details",
|
||||
"fieldtype": "Table",
|
||||
"label": "Expense Claim Details",
|
||||
"oldfieldname": "expense_voucher_details",
|
||||
"oldfieldtype": "Table",
|
||||
"options": "Expense Claim Detail"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "sb1",
|
||||
"fieldtype": "Section Break",
|
||||
"options": "Simple"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "From Employee",
|
||||
"oldfieldname": "employee",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Employee",
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "employee_name",
|
||||
"fieldtype": "Data",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Employee Name",
|
||||
"oldfieldname": "employee_name",
|
||||
"oldfieldtype": "Data",
|
||||
"read_only": 1,
|
||||
"search_index": 0,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "fiscal_year",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Fiscal Year",
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "link:Fiscal Year",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"label": "Company",
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "link:Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "cb1",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"in_filter": 1,
|
||||
"label": "Posting Date",
|
||||
"oldfieldname": "posting_date",
|
||||
"oldfieldtype": "Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "remark",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Remark",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "remark",
|
||||
"oldfieldtype": "Small Text"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "email_id",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"label": "Employees Email Id",
|
||||
"oldfieldname": "email_id",
|
||||
"oldfieldtype": "Data",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Data",
|
||||
"ignore_restrictions": 1,
|
||||
"label": "Amended From",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "amended_from",
|
||||
"oldfieldtype": "Data",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 1,
|
||||
"width": "160px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"match": "owner",
|
||||
"role": "Employee"
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"cancel": 1,
|
||||
"doctype": "DocPerm",
|
||||
"role": "Expense Approver",
|
||||
"submit": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"cancel": 1,
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR User",
|
||||
"submit": 1
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/expense_claim_detail/README.md
Normal file
1
erpnext/hr/doctype/expense_claim_detail/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Detail of expense in parent Expense Claim.
|
||||
1
erpnext/hr/doctype/expense_claim_detail/__init__.py
Normal file
1
erpnext/hr/doctype/expense_claim_detail/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
@@ -0,0 +1,86 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:27:46",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:13",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "harshada@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Expense Claim Detail",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Expense Claim Detail"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "expense_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Expense Date",
|
||||
"oldfieldname": "expense_date",
|
||||
"oldfieldtype": "Date",
|
||||
"print_width": "150px",
|
||||
"reqd": 0,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "expense_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Expense Claim Type",
|
||||
"oldfieldname": "expense_type",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "link:Expense Claim Type",
|
||||
"print_width": "150px",
|
||||
"reqd": 1,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
"oldfieldname": "description",
|
||||
"oldfieldtype": "Small Text",
|
||||
"print_width": "300px",
|
||||
"width": "300px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "claim_amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Claim Amount",
|
||||
"oldfieldname": "claim_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"print_width": "150px",
|
||||
"reqd": 1,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "sanctioned_amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Sanctioned Amount",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "sanctioned_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"print_width": "150px",
|
||||
"width": "150px"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/expense_claim_type/README.md
Normal file
1
erpnext/hr/doctype/expense_claim_type/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Type of expense for Expense Claim.
|
||||
1
erpnext/hr/doctype/expense_claim_type/__init__.py
Normal file
1
erpnext/hr/doctype/expense_claim_type/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
68
erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
Normal file
68
erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
Normal file
@@ -0,0 +1,68 @@
|
||||
[
|
||||
{
|
||||
"creation": "2012-03-27 14:35:55",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:07",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "harshada@webnotestech.com"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "field:expense_type",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-flag",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Expense Claim Type",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Expense Claim Type",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR Manager",
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Expense Claim Type"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "expense_type",
|
||||
"fieldtype": "Data",
|
||||
"in_filter": 0,
|
||||
"label": "Expense Claim Type",
|
||||
"oldfieldname": "expense_type",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1,
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
"oldfieldname": "description",
|
||||
"oldfieldtype": "Small Text",
|
||||
"width": "300px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/grade/README.md
Normal file
1
erpnext/hr/doctype/grade/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Employee grade.
|
||||
1
erpnext/hr/doctype/grade/__init__.py
Normal file
1
erpnext/hr/doctype/grade/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
10
erpnext/hr/doctype/grade/grade.py
Normal file
10
erpnext/hr/doctype/grade/grade.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
59
erpnext/hr/doctype/grade/grade.txt
Normal file
59
erpnext/hr/doctype/grade/grade.txt
Normal file
@@ -0,0 +1,59 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:14",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:24:08",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "field:grade_name",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"icon": "icon-star-half-empty",
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "grade_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Grade",
|
||||
"name": "__common__",
|
||||
"oldfieldname": "grade_name",
|
||||
"oldfieldtype": "Data",
|
||||
"parent": "Grade",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"email": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Grade",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Grade"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
4
erpnext/hr/doctype/grade/test_grade.py
Normal file
4
erpnext/hr/doctype/grade/test_grade.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
test_records = [[{"doctype":"Grade", "grade_name":"_Test Grade"}]]
|
||||
1
erpnext/hr/doctype/holiday/README.md
Normal file
1
erpnext/hr/doctype/holiday/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Holiday date in Holiday List.
|
||||
1
erpnext/hr/doctype/holiday/__init__.py
Normal file
1
erpnext/hr/doctype/holiday/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
9
erpnext/hr/doctype/holiday/holiday.py
Normal file
9
erpnext/hr/doctype/holiday/holiday.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
44
erpnext/hr/doctype/holiday/holiday.txt
Normal file
44
erpnext/hr/doctype/holiday/holiday.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:27:46",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-12-20 19:23:14",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"istable": 1,
|
||||
"module": "HR",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Holiday",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Holiday"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
"print_width": "300px",
|
||||
"width": "300px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "holiday_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Date",
|
||||
"oldfieldname": "holiday_date",
|
||||
"oldfieldtype": "Date"
|
||||
}
|
||||
]
|
||||
1
erpnext/hr/doctype/holiday_list/README.md
Normal file
1
erpnext/hr/doctype/holiday_list/README.md
Normal file
@@ -0,0 +1 @@
|
||||
List of Holidays.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user