mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-29 22:58:25 +00:00
rename dt first cut
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# DocType Mapper, KRA Template-Appraisal
|
||||
# DocType Mapper, Appraisal Template-Appraisal
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -14,30 +14,30 @@
|
||||
{
|
||||
'doctype': 'Table Mapper Detail',
|
||||
'from_field': 'kra_sheet',
|
||||
'from_table': 'KRA Sheet',
|
||||
'from_table': 'Appraisal Template Goal',
|
||||
'match_id': 0,
|
||||
'name': '__common__',
|
||||
'parent': 'KRA Template-Appraisal',
|
||||
'parent': 'Appraisal Template-Appraisal',
|
||||
'parentfield': 'table_mapper_details',
|
||||
'parenttype': 'DocType Mapper',
|
||||
'to_field': 'appraisal_details',
|
||||
'to_table': 'Appraisal Detail',
|
||||
'to_table': 'Appraisal Goal',
|
||||
'validation_logic': 'name is not Null'
|
||||
},
|
||||
|
||||
# These values are common for all DocType Mapper
|
||||
{
|
||||
'doctype': 'DocType Mapper',
|
||||
'from_doctype': 'KRA Template',
|
||||
'from_doctype': 'Appraisal Template',
|
||||
'module': 'HR',
|
||||
'name': '__common__',
|
||||
'to_doctype': 'Appraisal'
|
||||
},
|
||||
|
||||
# DocType Mapper, KRA Template-Appraisal
|
||||
# DocType Mapper, Appraisal Template-Appraisal
|
||||
{
|
||||
'doctype': 'DocType Mapper',
|
||||
'name': 'KRA Template-Appraisal'
|
||||
'name': 'Appraisal Template-Appraisal'
|
||||
},
|
||||
|
||||
# Table Mapper Detail
|
||||
@@ -113,19 +113,19 @@
|
||||
{
|
||||
'doctype': 'Table Mapper Detail',
|
||||
'from_field': 'earning_details',
|
||||
'from_table': 'Earning Detail',
|
||||
'from_table': 'Salary Structure Earning',
|
||||
'match_id': 1,
|
||||
'to_field': 'earning_details',
|
||||
'to_table': 'SS Earning Detail'
|
||||
'to_table': 'Salary Slip Earning'
|
||||
},
|
||||
|
||||
# Table Mapper Detail
|
||||
{
|
||||
'doctype': 'Table Mapper Detail',
|
||||
'from_field': 'deduction_details',
|
||||
'from_table': 'Deduction Detail',
|
||||
'from_table': 'Salary Structure Deduction',
|
||||
'match_id': 2,
|
||||
'to_field': 'deduction_details',
|
||||
'to_table': 'SS Deduction Detail'
|
||||
'to_table': 'Salary Slip Deduction'
|
||||
}
|
||||
]
|
||||
@@ -1 +1 @@
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Calls', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:38', 'modified': '2010-08-23 18:26:38', 'module': 'Payroll', 'doctype': 'Expense Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Calls', 'parentfield': None}]
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Calls', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:38', 'modified': '2010-08-23 18:26:38', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Calls', 'parentfield': None}]
|
||||
@@ -1 +1 @@
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Food', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:30', 'modified': '2010-08-23 18:26:30', 'module': 'Payroll', 'doctype': 'Expense Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Food', 'parentfield': None}]
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Food', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:30', 'modified': '2010-08-23 18:26:30', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Food', 'parentfield': None}]
|
||||
@@ -1 +1 @@
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Medical', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:49', 'modified': '2010-08-23 18:26:49', 'module': 'Payroll', 'doctype': 'Expense Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Medical', 'parentfield': None}]
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Medical', 'parent': None, 'description': None, 'creation': '2010-08-23 18:26:49', 'modified': '2010-08-23 18:26:49', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Medical', 'parentfield': None}]
|
||||
@@ -1 +1 @@
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Others', 'parent': None, 'description': None, 'creation': '2010-09-20 12:16:45', 'modified': '2010-09-20 12:16:45', 'module': 'Payroll', 'doctype': 'Expense Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Others', 'parentfield': None}]
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Others', 'parent': None, 'description': None, 'creation': '2010-09-20 12:16:45', 'modified': '2010-09-20 12:16:45', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Others', 'parentfield': None}]
|
||||
@@ -1 +1 @@
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Travel', 'parent': None, 'description': None, 'creation': '2010-09-20 12:16:45', 'modified': '2010-09-20 12:16:45', 'module': 'Payroll', 'doctype': 'Expense Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Travel', 'parentfield': None}]
|
||||
[{'modified_by': 'harshada@webnotestech.com', 'name': 'Travel', 'parent': None, 'description': None, 'creation': '2010-09-20 12:16:45', 'modified': '2010-09-20 12:16:45', 'module': 'Payroll', 'doctype': 'Expense Claim Type', 'idx': None, 'parenttype': None, 'owner': 'harshada@webnotestech.com', 'docstatus': 0, 'expense_type': 'Travel', 'parentfield': None}]
|
||||
@@ -114,8 +114,8 @@
|
||||
# Module Def Item
|
||||
{
|
||||
'description': 'Submit Employees Expenses',
|
||||
'display_name': 'Expense Voucher',
|
||||
'doc_name': 'Expense Voucher',
|
||||
'display_name': 'Expense Claim',
|
||||
'doc_name': 'Expense Claim',
|
||||
'doc_type': 'Forms',
|
||||
'doctype': 'Module Def Item',
|
||||
'fields': 'status\nemployee\nemployee_name\nposting_date\ntotal_claimed_amount\ntotal_sanctioned_amount\nexp_approver',
|
||||
@@ -286,8 +286,8 @@
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'display_name': 'Pending Expense Vouchers',
|
||||
'doc_name': 'Expense Voucher',
|
||||
'display_name': 'Pending Expense Claims',
|
||||
'doc_name': 'Expense Claim',
|
||||
'doc_type': 'Reports',
|
||||
'doctype': 'Module Def Item',
|
||||
'idx': 25
|
||||
@@ -295,8 +295,8 @@
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'display_name': 'Expense Vouchers',
|
||||
'doc_name': 'Expense Voucher',
|
||||
'display_name': 'Expense Claims',
|
||||
'doc_name': 'Expense Claim',
|
||||
'doc_type': 'Reports',
|
||||
'doctype': 'Module Def Item',
|
||||
'idx': 26
|
||||
|
||||
@@ -39,9 +39,9 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
||||
|
||||
|
||||
cur_frm.cscript.refresh_appraisal_details = function(doc, cdt, cdn){
|
||||
var val = getchildren('Appraisal Detail', doc.name, 'appraisal_details', doc.doctype);
|
||||
var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
|
||||
for(var i = 0; i<val.length; i++){
|
||||
set_multiple('Appraisal Detail', val[i].name, {'target_achieved':'', 'score':'', 'scored_earned':''}, 'appraisal_details');
|
||||
set_multiple('Appraisal Goal', val[i].name, {'target_achieved':'', 'score':'', 'scored_earned':''}, 'appraisal_details');
|
||||
}
|
||||
doc.total_score = '';
|
||||
refresh_field('appraisal_details');
|
||||
@@ -62,7 +62,7 @@ cur_frm.cscript.employee = function(doc,cdt,cdn){
|
||||
|
||||
cur_frm.cscript['Calculate Total Score'] = function(doc,cdt,cdn){
|
||||
//get_server_fields('calculate_total','','',doc,cdt,cdn,1);
|
||||
var val = getchildren('Appraisal Detail', doc.name, 'appraisal_details', doc.doctype);
|
||||
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)
|
||||
@@ -161,7 +161,7 @@ cur_frm.cscript.score = function(doc,cdt,cdn){
|
||||
}
|
||||
|
||||
cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
||||
var val = getchildren('Appraisal Detail', doc.name, 'appraisal_details', doc.doctype);
|
||||
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);
|
||||
|
||||
@@ -46,10 +46,10 @@ class DocType:
|
||||
|
||||
def fetch_kra(self):
|
||||
if not self.doc.kra_template:
|
||||
msgprint("Please select KRA Template to be be fetched")
|
||||
msgprint("Please select Appraisal Template to be be fetched")
|
||||
raise Exception
|
||||
self.doc.clear_table(self.doclist,'appraisal_details')
|
||||
get_obj('DocType Mapper', 'KRA Template-Appraisal').dt_map('KRA Template', 'Appraisal', self.doc.kra_template, self.doc, self.doclist, "[['KRA Template','Appraisal'],['KRA Sheet', 'Appraisal Detail']]")
|
||||
get_obj('DocType Mapper', 'Appraisal Template-Appraisal').dt_map('Appraisal Template', 'Appraisal', self.doc.kra_template, self.doc, self.doclist, "[['Appraisal Template','Appraisal'],['Appraisal Template Goal', 'Appraisal Goal']]")
|
||||
|
||||
def validate_dates(self):
|
||||
if getdate(self.doc.start_date) > getdate(self.doc.end_date):
|
||||
|
||||
@@ -312,10 +312,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'kra_template',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'KRA Template',
|
||||
'label': u'Appraisal Template',
|
||||
'oldfieldname': u'kra_template',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'KRA Template',
|
||||
'options': u'Appraisal Template',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@@ -351,10 +351,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'appraisal_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Appraisal Details',
|
||||
'label': u'Appraisal Goals',
|
||||
'oldfieldname': u'appraisal_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Appraisal Detail',
|
||||
'options': u'Appraisal Goal',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Appraisal Detail
|
||||
# DocType, Appraisal Goal
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -28,15 +28,15 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Appraisal Detail',
|
||||
'parent': u'Appraisal Goal',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, Appraisal Detail
|
||||
# DocType, Appraisal Goal
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Appraisal Detail'
|
||||
'name': u'Appraisal Goal'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, KRA Template
|
||||
# DocType, Appraisal Template
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'KRA Template',
|
||||
'parent': u'Appraisal Template',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
@@ -38,7 +38,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'KRA Template',
|
||||
'parent': u'Appraisal Template',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
@@ -46,10 +46,10 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, KRA Template
|
||||
# DocType, Appraisal Template
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'KRA Template'
|
||||
'name': u'Appraisal Template'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@@ -103,9 +103,9 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'kra_sheet',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'KRA Sheet',
|
||||
'label': u'Appraisal Template Goal',
|
||||
'oldfieldname': u'kra_sheet',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'KRA Sheet'
|
||||
'options': u'Appraisal Template Goal'
|
||||
}
|
||||
]
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, KRA Sheet
|
||||
# DocType, Appraisal Template Goal
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,17 +27,17 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'KRA Sheet',
|
||||
'parent': u'Appraisal Template Goal',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocType, KRA Sheet
|
||||
# DocType, Appraisal Template Goal
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'KRA Sheet'
|
||||
'name': u'Appraisal Template Goal'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -234,7 +234,7 @@
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Amended From',
|
||||
'no_copy': 1,
|
||||
'options': u'Receivable Voucher',
|
||||
'options': u'Sales Invoice',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class DocType:
|
||||
# Autoname
|
||||
#========================================================================================================
|
||||
def autoname(self):
|
||||
ret = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'emp_created_by'")
|
||||
ret = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'emp_created_by'")
|
||||
if not ret:
|
||||
msgprint("To Save Employee, please go to Setup -->Global Defaults. Click on HR and select 'Employee Records to be created by'.")
|
||||
raise Exception
|
||||
@@ -113,7 +113,7 @@ class DocType:
|
||||
# Validate name
|
||||
#========================================================================================================
|
||||
def validate_name(self):
|
||||
ret = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'emp_created_by'")
|
||||
ret = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'emp_created_by'")
|
||||
|
||||
if not ret:
|
||||
msgprint("To Save Employee, please go to Setup -->Global Defaults. Click on HR and select 'Employee Records to be created by'.")
|
||||
|
||||
@@ -857,7 +857,7 @@
|
||||
'fieldname': u'educational_qualification_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Educational Qualification Details',
|
||||
'options': u'Educational Qualifications Detail',
|
||||
'options': u'Employee Education',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@@ -885,8 +885,8 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'previous_experience_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Previous Experience Details',
|
||||
'options': u'Previous Experience Detail',
|
||||
'label': u'Employee External Work Historys',
|
||||
'options': u'Employee External Work History',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@@ -905,8 +905,8 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'experience_in_company_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Experience In Company Details',
|
||||
'options': u'Experience In Company Detail',
|
||||
'label': u'Employee Internal Work Historys',
|
||||
'options': u'Employee Internal Work History',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Educational Qualifications Detail
|
||||
# DocType, Employee Education
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,16 +27,16 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Educational Qualifications Detail',
|
||||
'parent': u'Employee Education',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocType, Educational Qualifications Detail
|
||||
# DocType, Employee Education
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Educational Qualifications Detail'
|
||||
'name': u'Employee Education'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Previous Experience Detail
|
||||
# DocType, Employee External Work History
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Previous Experience Detail',
|
||||
'parent': u'Employee External Work History',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
@@ -38,7 +38,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Previous Experience Detail',
|
||||
'parent': u'Employee External Work History',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
@@ -47,10 +47,10 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, Previous Experience Detail
|
||||
# DocType, Employee External Work History
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Previous Experience Detail'
|
||||
'name': u'Employee External Work History'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Experience In Company Detail
|
||||
# DocType, Employee Internal Work History
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -26,16 +26,16 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Experience In Company Detail',
|
||||
'parent': u'Employee Internal Work History',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocType, Experience In Company Detail
|
||||
# DocType, Employee Internal Work History
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Experience In Company Detail'
|
||||
'name': u'Employee Internal Work History'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Professional Training Details
|
||||
# DocType, Employee Training
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,16 +27,16 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Professional Training Details',
|
||||
'parent': u'Employee Training',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocType, Professional Training Details
|
||||
# DocType, Employee Training
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Professional Training Details'
|
||||
'name': u'Employee Training'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -23,7 +23,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){
|
||||
|
||||
if (doc.__islocal) {
|
||||
if(doc.amended_from) set_multiple(cdt,cdn,{approval_status:'Draft'});
|
||||
var val = getchildren('Expense Voucher Detail', doc.name, 'expense_voucher_details', doc.doctype);
|
||||
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 ='';
|
||||
}
|
||||
@@ -60,7 +60,7 @@ cur_frm.cscript.employee = function(doc,cdt,cdn){
|
||||
|
||||
cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
||||
if(doc.approval_status == 'Draft'){
|
||||
var val = getchildren('Expense Voucher Detail', doc.name, 'expense_voucher_details', doc.doctype);
|
||||
var val = getchildren('Expense Claim Detail', doc.name, 'expense_voucher_details', doc.doctype);
|
||||
var total_claim =0;
|
||||
for(var i = 0; i<val.length; i++){
|
||||
total_claim = flt(total_claim)+flt(val[i].claim_amount);
|
||||
@@ -80,7 +80,7 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
||||
});
|
||||
}
|
||||
else if(doc.approval_status == 'Submitted'){
|
||||
var val = getchildren('Expense Voucher Detail', doc.name, 'expense_voucher_details', doc.doctype);
|
||||
var val = getchildren('Expense Claim Detail', doc.name, 'expense_voucher_details', doc.doctype);
|
||||
var total_sanctioned = 0;
|
||||
for(var i = 0; i<val.length; i++){
|
||||
total_sanctioned = flt(total_sanctioned)+flt(val[i].sanctioned_amount);
|
||||
@@ -139,8 +139,8 @@ cur_frm.cscript['Approve'] = function(doc,cdt,cdn){
|
||||
hide_field(['Update Voucher', 'Approve', 'Reject', 'Calculate Total Amount']);
|
||||
approve_voucher_dialog.hide();
|
||||
var args = {
|
||||
type: 'Expense Voucher Approved',
|
||||
doctype: 'Expense Voucher',
|
||||
type: 'Expense Claim Approved',
|
||||
doctype: 'Expense Claim',
|
||||
contact_name: doc.employee_name,
|
||||
send_to: doc.email_id
|
||||
}
|
||||
@@ -167,7 +167,7 @@ cur_frm.cscript['Approve'] = function(doc,cdt,cdn){
|
||||
doc.__unsaved = 0;
|
||||
cur_frm.refresh_header();
|
||||
}else{
|
||||
msgprint("Expense Voucher can be approved by Approver only");
|
||||
msgprint("Expense Claim can be approved by Approver only");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,8 +207,8 @@ cur_frm.cscript['Reject'] = function(doc,cdt,cdn){
|
||||
hide_field(['Update Voucher', 'Approve', 'Reject', 'Calculate Total Amount']);
|
||||
reject_voucher_dialog.hide();
|
||||
var args = {
|
||||
type: 'Expense Voucher Rejected',
|
||||
doctype: 'Expense Voucher',
|
||||
type: 'Expense Claim Rejected',
|
||||
doctype: 'Expense Claim',
|
||||
contact_name: doc.employee_name,
|
||||
send_to: doc.email_id
|
||||
}
|
||||
@@ -229,7 +229,7 @@ cur_frm.cscript['Reject'] = function(doc,cdt,cdn){
|
||||
doc.__unsaved = 0;
|
||||
cur_frm.refresh_header();
|
||||
}else{
|
||||
msgprint("Expense Voucher can be rejected by Approver only");
|
||||
msgprint("Expense Claim can be rejected by Approver only");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,8 +246,8 @@ cur_frm.cscript['Update Voucher'] = function(doc){
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
var args = {
|
||||
type: 'Expense Voucher',
|
||||
doctype: 'Expense Voucher'
|
||||
type: 'Expense Claim',
|
||||
doctype: 'Expense Claim'
|
||||
}
|
||||
cur_frm.cscript.notify(doc, args);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class DocType:
|
||||
return ret
|
||||
|
||||
def update_voucher(self):
|
||||
sql("delete from `tabExpense Voucher Detail` where parent = '%s'"%self.doc.name)
|
||||
sql("delete from `tabExpense Claim Detail` where parent = '%s'"%self.doc.name)
|
||||
for d in getlist(self.doclist, 'expense_voucher_details'):
|
||||
if not d.expense_type or not d.claim_amount:
|
||||
msgprint("Please remove the extra blank row added")
|
||||
@@ -88,7 +88,7 @@ class DocType:
|
||||
|
||||
set(self.doc, 'approval_status', 'Approved')
|
||||
# on approval notification
|
||||
#get_obj('Notification Control').notify_contact('Expense Voucher Approved', self.doc.doctype, self.doc.name, self.doc.email_id, self.doc.employee_name)
|
||||
#get_obj('Notification Control').notify_contact('Expense Claim Approved', self.doc.doctype, self.doc.name, self.doc.email_id, self.doc.employee_name)
|
||||
|
||||
return cstr('Approved')
|
||||
|
||||
@@ -99,7 +99,7 @@ class DocType:
|
||||
set(self.doc, 'approval_status', 'Rejected')
|
||||
|
||||
# on approval notification
|
||||
#get_obj('Notification Control').notify_contact('Expense Voucher Rejected', self.doc.doctype, self.doc.name, self.doc.email_id, self.doc.employee_name)
|
||||
#get_obj('Notification Control').notify_contact('Expense Claim Rejected', self.doc.doctype, self.doc.name, self.doc.email_id, self.doc.employee_name)
|
||||
|
||||
return cstr('Rejected')
|
||||
|
||||
@@ -107,7 +107,7 @@ class DocType:
|
||||
for d in getlist(self.doclist, 'expense_voucher_details'):
|
||||
if flt(d.sanctioned_amount) > 0:
|
||||
if self.doc.approval_status == 'Draft':
|
||||
msgprint("Sanctioned amount can be added by Approver person only for submitted Expense Voucher")
|
||||
msgprint("Sanctioned amount can be added by Approver person only for submitted Expense Claim")
|
||||
raise Exception
|
||||
elif self.doc.approval_status == 'Submitted' and session['user'] != self.doc.exp_approver:
|
||||
msgprint("Sanctioned amount can be added only by expense voucher Approver")
|
||||
@@ -138,7 +138,7 @@ class DocType:
|
||||
raise Exception
|
||||
|
||||
if not self.doc.exp_approver:
|
||||
msgprint("Please select Expense Voucher approver")
|
||||
msgprint("Please select Expense Claim approver")
|
||||
raise Exception
|
||||
|
||||
def validate_approver(self):
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Expense Voucher
|
||||
# DocType, Expense Claim
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -33,7 +33,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Expense Voucher',
|
||||
'parent': u'Expense Claim',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
@@ -42,16 +42,16 @@
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Expense Voucher',
|
||||
'parent': u'Expense Claim',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Expense Voucher
|
||||
# DocType, Expense Claim
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Expense Voucher'
|
||||
'name': u'Expense Claim'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@@ -368,10 +368,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'expense_voucher_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Expense Voucher Details',
|
||||
'label': u'Expense Claim Details',
|
||||
'oldfieldname': u'expense_voucher_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Expense Voucher Detail',
|
||||
'options': u'Expense Claim Detail',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Expense Voucher Detail
|
||||
# DocType, Expense Claim Detail
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -26,16 +26,16 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Expense Voucher Detail',
|
||||
'parent': u'Expense Claim Detail',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocType, Expense Voucher Detail
|
||||
# DocType, Expense Claim Detail
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Expense Voucher Detail'
|
||||
'name': u'Expense Claim Detail'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -55,10 +55,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'expense_type',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Expense Type',
|
||||
'label': u'Expense Claim Type',
|
||||
'oldfieldname': u'expense_type',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Expense Type',
|
||||
'options': u'Expense Claim Type',
|
||||
'reqd': 1,
|
||||
'width': u'150px'
|
||||
},
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Expense Type
|
||||
# DocType, Expense Claim Type
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Expense Type',
|
||||
'parent': u'Expense Claim Type',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
@@ -38,7 +38,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Expense Type',
|
||||
'parent': u'Expense Claim Type',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
@@ -46,10 +46,10 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, Expense Type
|
||||
# DocType, Expense Claim Type
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Expense Type'
|
||||
'name': u'Expense Claim Type'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@@ -76,7 +76,7 @@
|
||||
'fieldname': u'expense_type',
|
||||
'fieldtype': u'Data',
|
||||
'in_filter': 0,
|
||||
'label': u'Expense Type',
|
||||
'label': u'Expense Claim Type',
|
||||
'oldfieldname': u'expense_type',
|
||||
'oldfieldtype': u'Data',
|
||||
'reqd': 1,
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Holiday List Detail
|
||||
# DocType, Holiday
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -28,16 +28,16 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Holiday List Detail',
|
||||
'parent': u'Holiday',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocType, Holiday List Detail
|
||||
# DocType, Holiday
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Holiday List Detail'
|
||||
'name': u'Holiday'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -105,7 +105,7 @@ class DocType:
|
||||
yr_start_date, yr_end_date = self.get_fy_start_end_dates()
|
||||
date_list = self.get_weekly_off_date_list(yr_start_date, yr_end_date)
|
||||
for d in date_list:
|
||||
ch = addchild(self.doc, 'holiday_list_details', 'Holiday List Detail', 1, self.doclist)
|
||||
ch = addchild(self.doc, 'holiday_list_details', 'Holiday', 1, self.doclist)
|
||||
ch.description = self.doc.weekly_off
|
||||
ch.holiday_date = d
|
||||
|
||||
|
||||
@@ -133,10 +133,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'holiday_list_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Holiday List Details',
|
||||
'label': u'Holidays',
|
||||
'oldfieldname': u'holiday_list_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Holiday List Detail',
|
||||
'options': u'Holiday',
|
||||
'permlevel': 0,
|
||||
'reqd': 0
|
||||
},
|
||||
|
||||
@@ -87,11 +87,11 @@ class DocType:
|
||||
if ret_name:
|
||||
for b in ret_name:
|
||||
#get earning amount of basic
|
||||
ret_basic = sql("select e_amount from `tabSS Earning Detail` where parent = '%s' and e_type = 'Basic'"%(b[0]))
|
||||
ret_basic = sql("select e_amount from `tabSalary Slip Earning` where parent = '%s' and e_type = 'Basic'"%(b[0]))
|
||||
sum_basic += ret_basic[0][0] or 0
|
||||
|
||||
#get deduction amount of Provident Fund
|
||||
ret_pf = sql("select d_amount from `tabSS Deduction Detail` where parent = '%s' and d_type = 'Provident Fund'"%(b[0]))
|
||||
ret_pf = sql("select d_amount from `tabSalary Slip Deduction` where parent = '%s' and d_type = 'Provident Fund'"%(b[0]))
|
||||
|
||||
sum_pf += ret_pf[0][0] or 0
|
||||
|
||||
@@ -103,7 +103,7 @@ class DocType:
|
||||
|
||||
self.doc.basic = self.doc.gross_income = 0
|
||||
#query return list of earning types and resp. modified amount
|
||||
ret = convert_to_lists(sql("select e.e_type, e.modified_value from `tabEarning Detail` e , `tabSalary Structure` s where s.is_active = 'Yes' and s.employee='%s' and e.parent = s.name" %(self.doc.employee)))
|
||||
ret = convert_to_lists(sql("select e.e_type, e.modified_value from `tabSalary Structure Earning` e , `tabSalary Structure` s where s.is_active = 'Yes' and s.employee='%s' and e.parent = s.name" %(self.doc.employee)))
|
||||
hra_count=1
|
||||
if ret:
|
||||
count = 0.0
|
||||
@@ -132,7 +132,7 @@ class DocType:
|
||||
self.doc.pf = 0.0
|
||||
|
||||
#query returns amount
|
||||
ret_ded = sql("select d.d_modified_amt from `tabDeduction Detail` d , `tabSalary Structure` s where s.is_active = 'Yes' and s.employee='%s' and d.parent = s.name and d.d_type = 'Provident Fund'" %(self.doc.employee))
|
||||
ret_ded = sql("select d.d_modified_amt from `tabSalary Structure Deduction` d , `tabSalary Structure` s where s.is_active = 'Yes' and s.employee='%s' and d.parent = s.name and d.d_type = 'Provident Fund'" %(self.doc.employee))
|
||||
|
||||
if not ret_ded:
|
||||
msgprint("PF Amount in Salary Structure is zero")
|
||||
@@ -257,7 +257,7 @@ class DocType:
|
||||
if (self.doc.ann_rent > 0):
|
||||
|
||||
#query return sum of earning types amount where earning type = 'HRA'
|
||||
ret_sal_slip = sql("select sum(e.e_amount) from `tabSS Earning Detail` e , `tabSalary Slip` s where s.fiscal_year = '%s' and s.docstatus = 1 and s.employee='%s' and e.parent = s.name and e.e_type = 'House Rent Allowance'" %(self.doc.fiscal_year,self.doc.employee))
|
||||
ret_sal_slip = sql("select sum(e.e_amount) from `tabSalary Slip Earning` e , `tabSalary Slip` s where s.fiscal_year = '%s' and s.docstatus = 1 and s.employee='%s' and e.parent = s.name and e.e_type = 'House Rent Allowance'" %(self.doc.fiscal_year,self.doc.employee))
|
||||
if not ret_sal_slip:
|
||||
ret_sal_slip = 0.00
|
||||
else:
|
||||
@@ -422,7 +422,7 @@ class DocType:
|
||||
def calc_tax_pm(self):
|
||||
|
||||
ret_income_tax = 0
|
||||
ret_income_tax = sql("select sum(d.d_amount) from `tabSS Deduction Detail` d , `tabSalary Slip` s where s.docstatus = 1 and s.fiscal_year = '%s' and s.employee='%s' and d.parent = s.name and d.d_type = 'Income Tax'" %(self.doc.fiscal_year,self.doc.employee))
|
||||
ret_income_tax = sql("select sum(d.d_amount) from `tabSalary Slip Deduction` d , `tabSalary Slip` s where s.docstatus = 1 and s.fiscal_year = '%s' and s.employee='%s' and d.parent = s.name and d.d_type = 'Income Tax'" %(self.doc.fiscal_year,self.doc.employee))
|
||||
|
||||
new_tot_income = cint(self.doc.tax_tot_income) + cint(self.doc.edu_cess) - (cint(ret_income_tax[0][0]) or 0)
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ class DocType:
|
||||
"""
|
||||
get total holidays
|
||||
"""
|
||||
tot_hol = sql("select count(*) from `tabHoliday List Detail` h1, `tabHoliday List` h2, `tabEmployee` e1 where e1.name = '%s' and h1.parent = h2.name and e1.holiday_list = h2.name and h1.holiday_date between '%s' and '%s'"% (self.doc.employee, self.doc.from_date, self.doc.to_date))
|
||||
tot_hol = sql("select count(*) from `tabHoliday` h1, `tabHoliday List` h2, `tabEmployee` e1 where e1.name = '%s' and h1.parent = h2.name and e1.holiday_list = h2.name and h1.holiday_date between '%s' and '%s'"% (self.doc.employee, self.doc.from_date, self.doc.to_date))
|
||||
if not tot_hol:
|
||||
tot_hol = sql("select count(*) from `tabHoliday List Detail` h1, `tabHoliday List` h2 where h1.parent = h2.name and h1.holiday_date between '%s' and '%s' and ifnull(h2.is_default,0) = 1 and h2.fiscal_year = %s"% (self.doc.from_date, self.doc.to_date, self.doc.fiscal_year))
|
||||
tot_hol = sql("select count(*) from `tabHoliday` h1, `tabHoliday List` h2 where h1.parent = h2.name and h1.holiday_date between '%s' and '%s' and ifnull(h2.is_default,0) = 1 and h2.fiscal_year = %s"% (self.doc.from_date, self.doc.to_date, self.doc.fiscal_year))
|
||||
return tot_hol and flt(tot_hol[0][0]) or 0
|
||||
|
||||
|
||||
|
||||
@@ -30,15 +30,15 @@ class TestSalaryManager(unittest.TestCase):
|
||||
ss1[0].employee = emp1.name
|
||||
for s in ss1: s.save(1)
|
||||
for s in ss1[1:]:
|
||||
sql("update `tabEarning Detail` set parent = '%s' where name = '%s'" % (ss1[0].name, s.name))
|
||||
sql("update `tabDeduction Detail` set parent = '%s' where name = '%s'" % (ss1[0].name, s.name))
|
||||
sql("update `tabSalary Structure Earning` set parent = '%s' where name = '%s'" % (ss1[0].name, s.name))
|
||||
sql("update `tabSalary Structure Deduction` set parent = '%s' where name = '%s'" % (ss1[0].name, s.name))
|
||||
|
||||
|
||||
ss2[0].employee = emp2.name
|
||||
for s in ss2: s.save(1)
|
||||
for s in ss2[1:]:
|
||||
sql("update `tabEarning Detail` set parent = '%s' where name = '%s'" % (ss2[0].name, s.name))
|
||||
sql("update `tabDeduction Detail` set parent = '%s' where name = '%s'" % (ss2[0].name, s.name))
|
||||
sql("update `tabSalary Structure Earning` set parent = '%s' where name = '%s'" % (ss2[0].name, s.name))
|
||||
sql("update `tabSalary Structure Deduction` set parent = '%s' where name = '%s'" % (ss2[0].name, s.name))
|
||||
|
||||
sman.save()
|
||||
self.sm = get_obj('Salary Manager')
|
||||
@@ -158,7 +158,7 @@ ss1 = [
|
||||
Document(fielddata={
|
||||
'parenttype':'Salary Structure',
|
||||
'parentfield':'earning_details',
|
||||
'doctype':'Earning Detail',
|
||||
'doctype':'Salary Structure Earning',
|
||||
'e_type' : 'Basic',
|
||||
'depend_on_lwp':1,
|
||||
'modified_value':100
|
||||
@@ -166,7 +166,7 @@ ss1 = [
|
||||
Document(fielddata={
|
||||
'parenttype':'Salary Structure',
|
||||
'parentfield':'earning_details',
|
||||
'doctype':'Deduction Detail',
|
||||
'doctype':'Salary Structure Deduction',
|
||||
'd_type':'TDS',
|
||||
'd_modified_amt':20
|
||||
})
|
||||
@@ -181,14 +181,14 @@ ss2 = [
|
||||
Document(fielddata={
|
||||
'parenttype':'Salary Structure',
|
||||
'parentfield':'deduction_details',
|
||||
'doctype':'Earning Detail',
|
||||
'doctype':'Salary Structure Earning',
|
||||
'e_type' : 'Basic',
|
||||
'modified_value':100
|
||||
}),
|
||||
Document(fielddata={
|
||||
'parenttype':'Salary Structure',
|
||||
'parentfield':'deduction_details',
|
||||
'doctype':'Deduction Detail',
|
||||
'doctype':'Salary Structure Deduction',
|
||||
'd_type':'TDS',
|
||||
'd_modified_amt':20
|
||||
})
|
||||
|
||||
@@ -79,7 +79,7 @@ cur_frm.cscript.d_depends_on_lwp = cur_frm.cscript.d_modified_amount;
|
||||
// Calculate earning total
|
||||
// ------------------------------------------------------------------------
|
||||
var calculate_earning_total = function(doc, dt, dn) {
|
||||
var tbl = getchildren('SS Earning Detail', doc.name, 'earning_details', doc.doctype);
|
||||
var tbl = getchildren('Salary Slip Earning', doc.name, 'earning_details', doc.doctype);
|
||||
|
||||
var total_earn = 0;
|
||||
for(var i = 0; i < tbl.length; i++){
|
||||
@@ -96,7 +96,7 @@ var calculate_earning_total = function(doc, dt, dn) {
|
||||
// Calculate deduction total
|
||||
// ------------------------------------------------------------------------
|
||||
var calculate_ded_total = function(doc, dt, dn) {
|
||||
var tbl = getchildren('SS Deduction Detail', doc.name, 'deduction_details', doc.doctype);
|
||||
var tbl = getchildren('Salary Slip Deduction', doc.name, 'deduction_details', doc.doctype);
|
||||
|
||||
var total_ded = 0;
|
||||
for(var i = 0; i < tbl.length; i++){
|
||||
|
||||
@@ -73,7 +73,7 @@ class DocType(TransactionBase):
|
||||
self.doc.clear_table(self.doclist, 'earning_details')
|
||||
self.doc.clear_table(self.doclist, 'deduction_details')
|
||||
|
||||
get_obj('DocType Mapper', 'Salary Structure-Salary Slip').dt_map('Salary Structure', 'Salary Slip', struct, self.doc, self.doclist, "[['Salary Structure', 'Salary Slip'],['Earning Detail', 'SS Earning Detail'],['Deduction Detail','SS Deduction Detail']]")
|
||||
get_obj('DocType Mapper', 'Salary Structure-Salary Slip').dt_map('Salary Structure', 'Salary Slip', struct, self.doc, self.doclist, "[['Salary Structure', 'Salary Slip'],['Earning Detail', 'Salary Slip Earning'],['Deduction Detail','Salary Slip Deduction']]")
|
||||
|
||||
basic_info = sql("select bank_name, bank_ac_no, esic_card_no, pf_number from `tabEmployee` where name ='%s'" % self.doc.employee)
|
||||
self.doc.bank_name = basic_info[0][0]
|
||||
@@ -109,9 +109,9 @@ class DocType(TransactionBase):
|
||||
# Calculate LWP
|
||||
#=======================================================
|
||||
def calculate_lwp(self, m):
|
||||
holidays = sql("select t1.holiday_date from `tabHoliday List Detail` t1, tabEmployee t2 where t1.parent = t2.holiday_list and t2.name = '%s' and t1.holiday_date between '%s' and '%s'" % (self.doc.employee, m[1], m[2]))
|
||||
holidays = sql("select t1.holiday_date from `tabHoliday` t1, tabEmployee t2 where t1.parent = t2.holiday_list and t2.name = '%s' and t1.holiday_date between '%s' and '%s'" % (self.doc.employee, m[1], m[2]))
|
||||
if not holidays:
|
||||
holidays = sql("select t1.holiday_date from `tabHoliday List Detail` t1, `tabHoliday List` t2 where t1.parent = t2.name and ifnull(t2.is_default, 0) = 1 and t2.fiscal_year = '%s'" % self.doc.fiscal_year)
|
||||
holidays = sql("select t1.holiday_date from `tabHoliday` t1, `tabHoliday List` t2 where t1.parent = t2.name and ifnull(t2.is_default, 0) = 1 and t2.fiscal_year = '%s'" % self.doc.fiscal_year)
|
||||
holidays = [cstr(i[0]) for i in holidays]
|
||||
lwp = 0
|
||||
for d in range(m[3]):
|
||||
@@ -192,8 +192,8 @@ class DocType(TransactionBase):
|
||||
if emailid_ret:
|
||||
receiver = cstr(emailid_ret[0][0])
|
||||
subj = 'Salary Slip - ' + cstr(self.doc.month) +'/'+cstr(self.doc.fiscal_year)
|
||||
earn_ret=sql("select e_type,e_modified_amount from `tabSS Earning Detail` where parent = '%s'"%self.doc.name)
|
||||
ded_ret=sql("select d_type,d_modified_amount from `tabSS Deduction Detail` where parent = '%s'"%self.doc.name)
|
||||
earn_ret=sql("select e_type,e_modified_amount from `tabSalary Slip Earning` where parent = '%s'"%self.doc.name)
|
||||
ded_ret=sql("select d_type,d_modified_amount from `tabSalary Slip Deduction` where parent = '%s'"%self.doc.name)
|
||||
|
||||
earn_table = ''
|
||||
ded_table = ''
|
||||
|
||||
@@ -414,10 +414,10 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'earning_details',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Earning Details',
|
||||
'label': u'Salary Structure Earnings',
|
||||
'oldfieldname': u'earning_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'SS Earning Detail',
|
||||
'options': u'Salary Slip Earning',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@@ -441,7 +441,7 @@
|
||||
'label': u'Deduction Details',
|
||||
'oldfieldname': u'deduction_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'SS Deduction Detail',
|
||||
'options': u'Salary Slip Deduction',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, SS Deduction Detail
|
||||
# DocType, Salary Slip Deduction
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -28,7 +28,7 @@
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'SS Deduction Detail',
|
||||
'parent': u'Salary Slip Deduction',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
@@ -38,7 +38,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'SS Deduction Detail',
|
||||
'parent': u'Salary Slip Deduction',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
@@ -47,10 +47,10 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, SS Deduction Detail
|
||||
# DocType, Salary Slip Deduction
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'SS Deduction Detail'
|
||||
'name': u'Salary Slip Deduction'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, SS Earning Detail
|
||||
# DocType, Salary Slip Earning
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'SS Earning Detail',
|
||||
'parent': u'Salary Slip Earning',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
@@ -37,7 +37,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'SS Earning Detail',
|
||||
'parent': u'Salary Slip Earning',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
@@ -46,10 +46,10 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, SS Earning Detail
|
||||
# DocType, Salary Slip Earning
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'SS Earning Detail'
|
||||
'name': u'Salary Slip Earning'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@@ -19,8 +19,8 @@ cur_frm.add_fetch('employee', 'company', 'company');
|
||||
// On load
|
||||
//=======================================================================
|
||||
cur_frm.cscript.onload = function(doc, dt, dn){
|
||||
e_tbl = getchildren('Earning Detail', doc.name, 'earning_details', doc.doctype);
|
||||
d_tbl = getchildren('Deduction Detail', doc.name, 'deduction_details', doc.doctype);
|
||||
e_tbl = getchildren('Salary Structure Earning', doc.name, 'earning_details', doc.doctype);
|
||||
d_tbl = getchildren('Salary Structure Deduction', doc.name, 'deduction_details', doc.doctype);
|
||||
if (e_tbl.length == 0 && d_tbl.length == 0)
|
||||
$c_obj(make_doclist(doc.doctype,doc.name),'make_earn_ded_table','', function(r, rt) { refresh_many(['earning_details', 'deduction_details']);});
|
||||
}
|
||||
@@ -60,7 +60,7 @@ cur_frm.cscript['Make Salary Slip'] = function(){
|
||||
'from_doctype':'Salary Structure',
|
||||
'to_doctype':'Salary Slip',
|
||||
'from_docname':doc.name,
|
||||
'from_to_list':"[['Salary Structure', 'Salary Slip'], ['Earning Detail', 'SS Earning Detail'], ['Deduction Detail', 'SS Deduction Detail']]"
|
||||
'from_to_list':"[['Salary Structure', 'Salary Slip'], ['Earning Detail', 'Salary Slip Earning'], ['Deduction Detail', 'Salary Slip Deduction']]"
|
||||
},
|
||||
function(r,rt) {
|
||||
n.fiscal_year = sys_defaults.fiscal_year;
|
||||
@@ -98,8 +98,8 @@ cur_frm.cscript.d_modified_amt = function(doc, cdt, cdn){
|
||||
// calculate totals
|
||||
//=======================================================================
|
||||
var calculate_totals = function(doc, cdt, cdn) {
|
||||
var tbl1 = getchildren('Earning Detail', doc.name, 'earning_details', doc.doctype);
|
||||
var tbl2 = getchildren('Deduction Detail', doc.name, 'deduction_details', doc.doctype);
|
||||
var tbl1 = getchildren('Salary Structure Earning', doc.name, 'earning_details', doc.doctype);
|
||||
var tbl2 = getchildren('Salary Structure Deduction', doc.name, 'deduction_details', doc.doctype);
|
||||
|
||||
var total_earn = 0; var total_ded = 0;
|
||||
for(var i = 0; i < tbl1.length; i++){
|
||||
|
||||
@@ -88,10 +88,10 @@ class DocType:
|
||||
#---------------------------------------------------------
|
||||
def make_earn_ded_table(self):
|
||||
#Earning List
|
||||
self.make_table('Earning Type','earning_details','Earning Detail')
|
||||
self.make_table('Earning Type','earning_details','Salary Structure Earning')
|
||||
|
||||
#Deduction List
|
||||
self.make_table('Deduction Type','deduction_details', 'Deduction Detail')
|
||||
self.make_table('Deduction Type','deduction_details', 'Salary Structure Deduction')
|
||||
|
||||
|
||||
# Check if another active ss exists
|
||||
|
||||
@@ -352,7 +352,7 @@
|
||||
'label': u'Earning1',
|
||||
'oldfieldname': u'earning_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Earning Detail',
|
||||
'options': u'Salary Structure Earning',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@@ -380,7 +380,7 @@
|
||||
'label': u'Deduction1',
|
||||
'oldfieldname': u'deduction_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Deduction Detail',
|
||||
'options': u'Salary Structure Deduction',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Deduction Detail
|
||||
# DocType, Salary Structure Deduction
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -27,16 +27,16 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Deduction Detail',
|
||||
'parent': u'Salary Structure Deduction',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocType, Deduction Detail
|
||||
# DocType, Salary Structure Deduction
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Deduction Detail'
|
||||
'name': u'Salary Structure Deduction'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Earning Detail
|
||||
# DocType, Salary Structure Earning
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -29,16 +29,16 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Earning Detail',
|
||||
'parent': u'Salary Structure Earning',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocType, Earning Detail
|
||||
# DocType, Salary Structure Earning
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Earning Detail'
|
||||
'name': u'Salary Structure Earning'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -3,14 +3,14 @@
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': 'Employee Profile\x01Employee,Experience In Company Detail\x01Branch,Experience In Company Detail\x01Department,Experience In Company Detail\x01Designation,Experience In Company Detail\x01Grade,Experience In Company Detail\x01From Date,Experience In Company Detail\x01To Date',
|
||||
'columns': 'Employee Profile\x01Employee,Employee Internal Work History\x01Branch,Employee Internal Work History\x01Department,Employee Internal Work History\x01Designation,Employee Internal Work History\x01Grade,Employee Internal Work History\x01From Date,Employee Internal Work History\x01To Date',
|
||||
'creation': '2010-12-14 10:33:09',
|
||||
'criteria_name': 'Employee In Company Experience',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': 1,
|
||||
'doc_type': 'Experience In Company Detail',
|
||||
'doc_type': 'Employee Internal Work History',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': '{}',
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'Expense Voucher\x01ID,Expense Voucher\x01Approval Status,Expense Voucher\x01From Employee,Expense Voucher\x01Employee Name,Expense Voucher\x01Approver,Expense Voucher\x01Posting Date,Expense Voucher\x01Total Claimed Amount,Expense Voucher\x01Total Sanctioned Amount',
|
||||
'criteria_name': 'Expense Vouchers',
|
||||
'doc_type': 'Expense Voucher',
|
||||
'columns': 'Expense Claim\x01ID,Expense Claim\x01Approval Status,Expense Claim\x01From Employee,Expense Claim\x01Employee Name,Expense Claim\x01Approver,Expense Claim\x01Posting Date,Expense Claim\x01Total Claimed Amount,Expense Claim\x01Total Sanctioned Amount',
|
||||
'criteria_name': 'Expense Claims',
|
||||
'doc_type': 'Expense Claim',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Expense Voucher\x01Saved':1,'Expense Voucher\x01Submitted':1,'Expense Voucher\x01Approval Status':'','Expense Voucher\x01Fiscal Year':''}",
|
||||
'filters': "{'Expense Claim\x01Saved':1,'Expense Claim\x01Submitted':1,'Expense Claim\x01Approval Status':'','Expense Claim\x01Fiscal Year':''}",
|
||||
'module': 'HR',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_by': '`tabExpense Voucher`.`name`',
|
||||
'sort_by': '`tabExpense Claim`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
@@ -17,37 +17,37 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'approver', label:'Approver', fieldtype:'Link', options:'Profile', ignore : 1, parent:'Expense Voucher'});
|
||||
this.filter_fields_dict['Expense Voucher'+FILTER_SEP +'Approver'].df.in_first_page = 1;
|
||||
this.add_filter({fieldname:'approver', label:'Approver', fieldtype:'Link', options:'Profile', ignore : 1, parent:'Expense Claim'});
|
||||
this.filter_fields_dict['Expense Claim'+FILTER_SEP +'Approver'].df.in_first_page = 1;
|
||||
|
||||
this.filter_fields_dict['Expense Voucher'+FILTER_SEP +'From Employee'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Voucher'+FILTER_SEP +'Employee Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Voucher'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Voucher'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Voucher'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Claim'+FILTER_SEP +'From Employee'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Claim'+FILTER_SEP +'Employee Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Claim'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Claim'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Claim'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Expense Claim'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
}
|
||||
this.mytabs.items['Select Columns'].hide();
|
||||
|
||||
report.get_query = function(){
|
||||
//get filter values
|
||||
emp = this.filter_fields_dict['Expense Voucher'+FILTER_SEP+'From Employee'].get_value();
|
||||
emp_nm = this.filter_fields_dict['Expense Voucher'+FILTER_SEP+'Employee Name'].get_value();
|
||||
frm_start_date = this.filter_fields_dict['Expense Voucher'+FILTER_SEP+'From Posting Date'].get_value();
|
||||
to_end_date = this.filter_fields_dict['Expense Voucher'+FILTER_SEP+'To Posting Date'].get_value();
|
||||
fiscal_year = this.filter_fields_dict['Expense Voucher'+FILTER_SEP+'Fiscal Year'].get_value();
|
||||
approver = this.filter_fields_dict['Expense Voucher'+FILTER_SEP+'Approver'].get_value();
|
||||
company = this.filter_fields_dict['Expense Voucher'+FILTER_SEP+'Company'].get_value();
|
||||
emp = this.filter_fields_dict['Expense Claim'+FILTER_SEP+'From Employee'].get_value();
|
||||
emp_nm = this.filter_fields_dict['Expense Claim'+FILTER_SEP+'Employee Name'].get_value();
|
||||
frm_start_date = this.filter_fields_dict['Expense Claim'+FILTER_SEP+'From Posting Date'].get_value();
|
||||
to_end_date = this.filter_fields_dict['Expense Claim'+FILTER_SEP+'To Posting Date'].get_value();
|
||||
fiscal_year = this.filter_fields_dict['Expense Claim'+FILTER_SEP+'Fiscal Year'].get_value();
|
||||
approver = this.filter_fields_dict['Expense Claim'+FILTER_SEP+'Approver'].get_value();
|
||||
company = this.filter_fields_dict['Expense Claim'+FILTER_SEP+'Company'].get_value();
|
||||
|
||||
var cond = '';
|
||||
if(emp) cond += ' AND `tabExpense Voucher`.employee = "'+emp+'"';
|
||||
if(emp_nm) cond += ' AND `tabExpense Voucher`.employee_name = "'+emp_nm+'"';
|
||||
if(frm_start_date) cond += ' AND `tabExpense Voucher`.posting_date >= "'+frm_start_date+'"';
|
||||
if(to_end_date) cond += ' AND `tabExpense Voucher`.posting_date <= "'+to_end_date+'"';
|
||||
if(fiscal_year !='') cond += ' AND `tabExpense Voucher`.fiscal_year = "'+fiscal_year+'"';
|
||||
if(approver) cond += ' AND `tabExpense Voucher`.exp_approver = "'+approver+'"';
|
||||
if(company) cond += ' AND `tabExpense Voucher`.company = "'+company+'"';
|
||||
if(emp) cond += ' AND `tabExpense Claim`.employee = "'+emp+'"';
|
||||
if(emp_nm) cond += ' AND `tabExpense Claim`.employee_name = "'+emp_nm+'"';
|
||||
if(frm_start_date) cond += ' AND `tabExpense Claim`.posting_date >= "'+frm_start_date+'"';
|
||||
if(to_end_date) cond += ' AND `tabExpense Claim`.posting_date <= "'+to_end_date+'"';
|
||||
if(fiscal_year !='') cond += ' AND `tabExpense Claim`.fiscal_year = "'+fiscal_year+'"';
|
||||
if(approver) cond += ' AND `tabExpense Claim`.exp_approver = "'+approver+'"';
|
||||
if(company) cond += ' AND `tabExpense Claim`.company = "'+company+'"';
|
||||
|
||||
var q = 'SELECT DISTINCT `tabExpense Voucher`.name, `tabExpense Voucher`.employee, `tabExpense Voucher`.employee_name, `tabExpense Voucher`.posting_date,`tabExpense Voucher`.exp_approver, `tabExpense Voucher`.total_claimed_amount, `tabExpense Voucher`.total_sanctioned_amount FROM `tabExpense Voucher` WHERE `tabExpense Voucher`.approval_status= "Submitted"'+cond;
|
||||
var q = 'SELECT DISTINCT `tabExpense Claim`.name, `tabExpense Claim`.employee, `tabExpense Claim`.employee_name, `tabExpense Claim`.posting_date,`tabExpense Claim`.exp_approver, `tabExpense Claim`.total_claimed_amount, `tabExpense Claim`.total_sanctioned_amount FROM `tabExpense Claim` WHERE `tabExpense Claim`.approval_status= "Submitted"'+cond;
|
||||
return q;
|
||||
}
|
||||
@@ -12,10 +12,10 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'criteria_name': 'Pending Expense Vouchers',
|
||||
'doc_type': 'Expense Voucher',
|
||||
'criteria_name': 'Pending Expense Claims',
|
||||
'doc_type': 'Expense Claim',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Expense Voucher\x01Approval Status':'','Expense Voucher\x01Fiscal Year':''}",
|
||||
'filters': "{'Expense Claim\x01Approval Status':'','Expense Claim\x01Fiscal Year':''}",
|
||||
'module': 'HR',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
|
||||
@@ -19,8 +19,8 @@ for r in res:
|
||||
if not sal_slips_ids == '': sal_slips_ids +=","
|
||||
sal_slips_ids+="'%s'"%r[col_idx['ID']]
|
||||
|
||||
earn_heads =[i[0] for i in sql("select distinct e_type from `tabSS Earning Detail` where parent in (%s)"%sal_slips_ids)]
|
||||
ded_heads =[i[0] for i in sql("select distinct d_type from `tabSS Deduction Detail` where parent in (%s)"%sal_slips_ids)]
|
||||
earn_heads =[i[0] for i in sql("select distinct e_type from `tabSalary Slip Earning` where parent in (%s)"%sal_slips_ids)]
|
||||
ded_heads =[i[0] for i in sql("select distinct d_type from `tabSalary Slip Deduction` where parent in (%s)"%sal_slips_ids)]
|
||||
|
||||
col=[]
|
||||
|
||||
@@ -57,9 +57,9 @@ for r in res:
|
||||
|
||||
for i in range(6,len(colnames)):
|
||||
if colnames[i] not in ('Arrear Amount','Encashment Amount','Net Pay','Gross Pay','Total Deduction'):
|
||||
amt = sql("select e_modified_amount from `tabSS Earning Detail` where e_type = '%s' and parent = '%s'"%(colnames[i],r[0]))
|
||||
amt = sql("select e_modified_amount from `tabSalary Slip Earning` where e_type = '%s' and parent = '%s'"%(colnames[i],r[0]))
|
||||
if not amt:
|
||||
amt = sql("select d_modified_amount from `tabSS Deduction Detail` where d_type = '%s' and parent = '%s'"%(colnames[i],r[0]))
|
||||
amt = sql("select d_modified_amount from `tabSalary Slip Deduction` where d_type = '%s' and parent = '%s'"%(colnames[i],r[0]))
|
||||
amt = amt and amt[0][0] or 0
|
||||
r.append(flt(amt))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user