moved directory structure

This commit is contained in:
Rushabh Mehta
2012-09-24 19:13:42 +05:30
parent e47a6779e9
commit 2fa2f7178d
1637 changed files with 47 additions and 11450 deletions

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,33 @@
# Search Criteria, employee_appraisals
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:51',
'docstatus': 0,
'modified': '2012-04-03 12:49:51',
'modified_by': u'Administrator',
'owner': u'ashwini@webnotestech.com'
},
# These values are common for all Search Criteria
{
'columns': u'Appraisal\x01ID,Appraisal\x01Status,Appraisal\x01Employee,Appraisal\x01Employee Name,Appraisal\x01Start Date,Appraisal\x01End Date,Appraisal\x01Approver,Appraisal\x01Total Score',
'criteria_name': u'Employee Appraisals',
'doc_type': u'Appraisal',
'doctype': 'Search Criteria',
'filters': u"{'Appraisal\x01Saved':1,'Appraisal\x01Submitted':1,'Appraisal\x01Status':'','Appraisal\x01Fiscal Year':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabAppraisal`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, employee_appraisals
{
'doctype': 'Search Criteria',
'name': u'employee_appraisals'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,23 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
for c in range(0,len(colnames)):
l = (len(colnames[c])*9)
if l < 150 : col_width = '150px'
else: col_width = '%spx'%(l)
colwidths[c] = col_width

View File

@@ -0,0 +1,33 @@
# Search Criteria, employee_information
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:51',
'docstatus': 0,
'modified': '2012-04-03 12:49:51',
'modified_by': u'Administrator',
'owner': u'harshada@webnotestech.com'
},
# These values are common for all Search Criteria
{
'columns': u'Employee\x01ID,Employee\x01Employee Name,Employee\x01Employee Number,Employee\x01Date of Joining,Employee\x01Gender,Employee\x01Date of Birth,Employee\x01Employment Type,Employee\x01Scheduled Confirmation Date,Employee\x01Contract End Date,Employee\x01Status,Employee\x01Branch,Employee\x01Department,Employee\x01Designation,Employee\x01Grade,Employee\x01Reports to,Employee\x01Email (By company),Employee\x01Bank Name,Employee\x01Relieving Date',
'criteria_name': u'Employee Information',
'doc_type': u'Employee',
'doctype': 'Search Criteria',
'filters': u"{'Employee\x01Saved':1,'Employee\x01Submitted':1,'Employee\x01Gender':'','Employee\x01Month of Birth':'','Employee\x01Status':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabEmployee`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, employee_information
{
'doctype': 'Search Criteria',
'name': u'employee_information'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,33 @@
# Search Criteria, employees_birthday
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:51',
'docstatus': 0,
'modified': '2012-04-03 12:49:51',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Search Criteria
{
'columns': u'Employee\x01ID,Employee\x01Employee Name,Employee\x01Department,Employee\x01Gender,Employee\x01Date of Birth,Employee\x01Month of Birth',
'criteria_name': u"Employee's Birthday",
'doc_type': u'Employee',
'doctype': 'Search Criteria',
'filters': u"{'Employee\x01Saved':1,'Employee\x01Gender':'','Employee\x01Month of Birth':'May','Employee\x01Status':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabEmployee`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, employees_birthday
{
'doctype': 'Search Criteria',
'name': u'employees_birthday'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,40 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
this.mytabs.items['Select Columns'].hide();
this.mytabs.tabs['More Filters'].hide();
report.customize_filters = function() {
this.add_filter({
fieldname:'fiscal_year',
label:'Fiscal Year',
fieldtype:'Link',
ignore : 1,
options: 'Fiscal Year',
parent:'Leave Allocation',
in_first_page:1
});
this.add_filter({
fieldname:'employee_name',
label:'Employee Name',
fieldtype:'Data',
ignore : 1,
options: '',
parent:'Leave Allocation',
in_first_page:1
});
}

View File

@@ -0,0 +1,72 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
leave_types = sql("""
SELECT name FROM `tabLeave Type`
WHERE
docstatus!=2 AND
name NOT IN ('Compensatory Off', 'Leave Without Pay')""")
col=[]
col.append(['Employee ID', 'Data', '150px', ''])
col.append(['Employee Name', 'Data', '150px', ''])
col.append(['Fiscal Year', 'Data', '150px', ''])
for e in leave_types:
l = (len(e[0])*9)
if l < 150 : col_width = '150px'
else: col_width = '%spx'%(l)
col.append([e[0],'Currency',col_width,''])
col.append(['Total Balance','Currency','150px',''])
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)
data = res
res = []
try:
for d in data:
exists = 0
ind = None
# Check if the employee record exists in list 'res'
for r in res:
if r[0] == d[0] and r[1] == d[1]:
exists = 1
ind = res.index(r)
break
if d[3] in colnames:
# If exists, then append the leave type data
if exists:
res[ind][colnames.index(d[3])] = d[4] - d[5]
res[ind][len(colnames)-1] = sum(res[ind][3:-1])
# Else create a new row in res
else:
new_row = [0.0 for c in colnames]
new_row[0] = d[0]
new_row[1] = d[1]
new_row[2] = d[2]
new_row[colnames.index(d[3])] = d[4] - d[5]
new_row[len(colnames)-1] = sum(new_row[3:-1])
res.append(new_row)
except Exception, e:
msgprint(e)

View File

@@ -0,0 +1,26 @@
SELECT
leave_alloc.employee AS 'employee',
leave_alloc.employee_name AS 'employee_name',
leave_alloc.fiscal_year AS 'fiscal_year',
leave_alloc.leave_type AS 'leave_type',
leave_alloc.total_leaves_allocated AS 'total_leaves_allocated',
SUM(leave_app.total_leave_days) AS 'total_leaves_applied'
FROM
`tabLeave Allocation` AS leave_alloc,
`tabLeave Application` AS leave_app
WHERE
leave_alloc.employee=leave_app.employee AND
leave_alloc.leave_type=leave_app.leave_type AND
leave_alloc.fiscal_year=leave_app.fiscal_year AND
leave_alloc.docstatus=1 AND
leave_app.docstatus=1 AND
leave_alloc.fiscal_year LIKE '%(fiscal_year)s%%' AND
leave_alloc.employee_name LIKE '%(employee_name)s%%'
GROUP BY
employee,
fiscal_year,
leave_type
ORDER BY
employee,
fiscal_year,
leave_type

View File

@@ -0,0 +1,34 @@
# Search Criteria, employeewise_balance_leave_report
[
# These values are common in all dictionaries
{
'creation': '2010-12-14 10:33:09',
'docstatus': 0,
'modified': '2011-10-31 15:42:36',
'modified_by': 'Administrator',
'owner': 'harshada@webnotestech.com'
},
# These values are common for all Search Criteria
{
'columns': 'Employee\x01ID',
'criteria_name': 'Employee Leave Balance Report',
'description': 'Employeewise Balance Leave Report',
'doc_type': 'Employee',
'doctype': 'Search Criteria',
'filters': "{'Employee\x01Saved':1,'Employee\x01Submitted':1,'Employee\x01Gender':'','Employee\x01Month of Birth':'','Employee\x01Status':'Active'}",
'module': 'HR',
'name': '__common__',
'page_len': 100,
'sort_by': '`tabEmployee`.`name`',
'sort_order': 'ASC',
'standard': 'Yes'
},
# Search Criteria, employeewise_balance_leave_report
{
'doctype': 'Search Criteria',
'name': 'employeewise_balance_leave_report'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,33 @@
# Search Criteria, expense_claims
[
# These values are common in all dictionaries
{
'creation': '2012-03-30 13:33:32',
'docstatus': 0,
'modified': '2012-03-30 13:33:32',
'modified_by': u'Administrator',
'owner': u'ashwini@webnotestech.com'
},
# These values are common for all Search Criteria
{
'columns': u'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': u'Expense Claims',
'doc_type': u'Expense Claim',
'doctype': 'Search Criteria',
'filters': u"{'Expense Claim\x01Saved':1,'Expense Claim\x01Submitted':1,'Expense Claim\x01Approval Status':'','Expense Claim\x01Fiscal Year':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabExpense Claim`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, expense_claims
{
'doctype': 'Search Criteria',
'name': u'expense_claims'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,45 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
var get_month = function(){
var dict = {0:'Jan', 1:'Feb',2:'Mar',3:'Apr',4:'May',5:'June',6:'July',7:'Aug',8:'Sept',9:'Oct',10:'Nov',11:'Dec'}
var d = new Date();
return dict[d.getMonth()]
}
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'month', label:'Month', fieldtype:'Select', options:'Jan'+NEWLINE+'Feb'+NEWLINE+'Mar'+NEWLINE+'Apr'+NEWLINE+'May'+NEWLINE+'June'+NEWLINE+'July'+NEWLINE+'Aug'+NEWLINE+'Sept'+NEWLINE+'Oct'+NEWLINE+'Nov'+NEWLINE+'Dec',ignore : 1,parent:'Attendance', single_select:1});
this.filter_fields_dict['Attendance'+FILTER_SEP +'Employee'].df.filter_hide = 0;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Month'].df.filter_hide = 0;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Employee'].df.in_first_page = 1;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Month'].df.in_first_page = 1;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Fiscal Year'].df.in_first_page = 1;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Company'].df.in_first_page = 1;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Month'].df['report_default'] = get_month();
this.filter_fields_dict['Attendance'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
this.filter_fields_dict['Attendance'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
this.get_filter('Attendance', 'Fiscal Year').set_as_single();
}
this.mytabs.items['More Filters'].hide();
this.mytabs.items['Select Columns'].hide();

View File

@@ -0,0 +1,93 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#add column employee, employee name
#--------------------------------------------------------------------------------------
from __future__ import unicode_literals
col =[['Employee','Link','155px','Employee'],['Employee Name','Data','150px','']]
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)-1
#get feb months last day
#--------------------------------------------------------------------------------------
fy = filter_values.get('fiscal_year')
month = filter_values.get('month')
mdict = {'Jan':'01', 'Feb':'02','Mar':'03','Apr':'04','May':'05','June':'06','July':'07','Aug':'08','Sept':'09','Oct':'10','Nov':'11','Dec':'12'}
import webnotes.utils
from dateutil.relativedelta import relativedelta
ysd = sql("select year_start_date from `tabFiscal Year` where name = '%s' and docstatus !=2"%fy)[0][0]
last_date = webnotes.utils.get_last_day(ysd + relativedelta(months = (cint(ysd.strftime('%m'))>cint(mdict[month]) and (12-cint(ysd.strftime('%m'))+cint(mdict[month])) or (cint(mdict[month]) - cint(ysd.strftime('%m'))))))
feb = last_date.strftime('%d')
#get last day and add columns
#--------------------------------------------------------------------------------------
dict = {'Jan': 31,'Feb':cint(feb), 'Mar':31,'Apr':30,'May':31,'June':30,'July':31,'Aug':31,'Sept':30,'Oct':31,'Nov':30,'Dec':31}
for i in range(0,dict[month]):
colnames.append(i+1)
coltypes.append('Data')
colwidths.append('25px')
col_idx[c[0]] = len(colnames)-1
#add total present, absent days
#--------------------------------------------------------------------------------------
tot_col =[['Total Present Days','Data','120px'],['Total Absent Days','Data','120px']]
for c in tot_col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
col_idx[c[0]] = len(colnames)-1
#get data
#--------------------------------------------------------------------------------------
year = last_date.strftime('%Y')
out = []
for r in res:
p_cnt = a_cnt = 0
for i in range(0,dict[month]):
new_date = str(year)+'-'+mdict[month]+'-'+((i>=9) and str(i+1) or ('0'+str(i+1)))
chk = sql("select status from `tabAttendance` where employee='%s' and att_date = '%s' and docstatus=1"%(r[0],new_date))
chk = chk and chk[0][0][0] or '-'
if chk=='P':
p_cnt +=1
elif chk=='A':
a_cnt +=1
r.append(chk)
r.append(p_cnt)
r.append(a_cnt)
if p_cnt or a_cnt:
out.append(r)

View File

@@ -0,0 +1 @@
SELECT DISTINCT `tabAttendance`.employee, `tabAttendance`.employee_name FROM `tabAttendance` WHERE `tabAttendance`.fiscal_year like '%(fiscal_year)s%%' AND `tabAttendance`.`company` like '%(company)s%%' AND `tabAttendance`.`employee` like '%(employee)s%%'

View File

@@ -0,0 +1,33 @@
# Search Criteria, monthly_attendance_details
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:51',
'docstatus': 0,
'modified': '2012-04-03 12:49:51',
'modified_by': u'Administrator',
'owner': u'harshada@webnotestech.com'
},
# These values are common for all Search Criteria
{
'columns': u'Attendance\x01Employee',
'criteria_name': u'Monthly Attendance Details',
'doc_type': u'Attendance',
'doctype': 'Search Criteria',
'filters': u"{'Attendance\x01Status':'','Attendance\x01Fiscal Year':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabAttendance`.`employee`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, monthly_attendance_details
{
'doctype': 'Search Criteria',
'name': u'monthly_attendance_details'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,99 @@
from __future__ import unicode_literals
colwidths[col_idx['Employee Name']]="120px"
colwidths[col_idx['Leave Without Pay']] = '120px'
sum_net = total_earning = total_deduction = total_lwp = total_arr = 0
total = ['Total Net Pay','','']
earn_type_lst = sql("select name from `tabEarning Type`")
ded_type_lst = sql("select name from `tabDeduction Type`")
li=[]
for lst in earn_type_lst:
li.append(lst[0])
li.append('Total Earning')
for lst in ded_type_lst:
li.append(lst[0])
li.append('Total Deduction')
li.append('Net Pay')
for d in li:
colnames.append(d)
colwidths.append("150px")
coltypes.append("Currency")
coloptions.append("")
col_idx[d] = len(colnames)-1
for r in res:
r.append("0")
for r in res:
total_lwp += r[col_idx['Leave Without Pay']]
total_arr += r[col_idx['Arrear Amount']]
for d1 in li:
d2 = '%s'%d1
earn_ret=convert_to_lists(sql("select e_type,e_amount from `tabSalary Slip Earning` where parent = '%s'"%r[col_idx['ID']]))
ded_ret=convert_to_lists(sql("select d_type,d_amount from `tabSalary Slip Deduction` where parent = '%s'"%r[col_idx['ID']]))
for e in earn_ret:
e0 = '%s'%e[0]
r[col_idx[e0]]=flt(e[1]) or 0.00
for d in ded_ret:
d0 = '%s'%d[0]
r[col_idx[d0]]=flt(d[1]) or 0.00
tot_earn_ded_net_ret = sql("select gross_pay, total_deduction,net_pay from `tabSalary Slip` where name = '%s'"%r[col_idx['ID']])
if d2 == 'Total Earning':
r[col_idx[d2]] = flt(tot_earn_ded_net_ret[0][0]) or 0
total_earning += flt(tot_earn_ded_net_ret[0][0]) or 0
elif d2 == 'Total Deduction':
r[col_idx[d2]] = flt(tot_earn_ded_net_ret[0][1]) or 0
total_deduction += flt(tot_earn_ded_net_ret[0][1]) or 0
elif d2 == 'Net Pay':
r[col_idx[d2]] = flt(tot_earn_ded_net_ret[0][2]) or 0
sum_net += flt(tot_earn_ded_net_ret[0][2]) or 0
total.append(total_lwp)
total.append(total_arr)
for lst in earn_type_lst:
total_ear = 0
for r in res:
lst0 = '%s'%lst[0]
total_ear += flt(r[col_idx[lst0]])
total.append(total_ear)
total.append(total_earning)
for lst in ded_type_lst:
total_ded = 0
for r in res:
lst0 = '%s'%lst[0]
total_ded += flt(r[col_idx[lst0]])
total.append(total_ded)
total.append(total_deduction)
total.append(sum_net)
res.append(total)

View File

@@ -0,0 +1,33 @@
# Search Criteria, monthly_salary_register
[
# These values are common in all dictionaries
{
'creation': '2012-03-30 14:50:44',
'docstatus': 0,
'modified': '2012-04-05 17:23:13',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Search Criteria
{
'columns': u'Salary Slip\x01ID,Salary Slip\x01Employee,Salary Slip\x01Employee Name,Salary Slip\x01Leave Without Pay,Salary Slip\x01Arrear Amount',
'criteria_name': u'Monthly Salary Register',
'doc_type': u'Salary Slip',
'doctype': 'Search Criteria',
'filters': u'{"Salary Slip\\u0001Submitted":1,"Salary Slip\\u0001Company":[""],"Salary Slip\\u0001Month":[""]}',
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabSalary Slip`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, monthly_salary_register
{
'doctype': 'Search Criteria',
'name': u'monthly_salary_register'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,66 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
report.customize_filters = function() {
var d = new Date();
var month=["January","February","March","April","May","June","July","August","September","October","November","December"]
this.add_filter({fieldname:'month', label:'Month',fieldtype:'Select', options:"January"+NEWLINE+"February"+NEWLINE+"March"+NEWLINE+"April"+NEWLINE+"May"+NEWLINE+"June"+NEWLINE+"July"+NEWLINE+"August"+NEWLINE+"September"+NEWLINE+"October"+NEWLINE+"November"+NEWLINE+"December",report_default : month[d.getMonth()],ignore : 1, parent:'Employee'});
this.filter_fields_dict['Employee'+FILTER_SEP +'Month'].df.in_first_page = 1;
this.filter_fields_dict['Employee'+FILTER_SEP +'Status'].df.in_first_page = 1;
this.filter_fields_dict['Employee'+FILTER_SEP +'Status'].df.report_default = 'Active';
this.add_filter({fieldname:'year', label:'Year',fieldtype:'Select', options:"2000"+NEWLINE+"2001"+NEWLINE+"2002"+NEWLINE+"2003"+NEWLINE+"2004"+NEWLINE+"2005"+NEWLINE+"2006"+NEWLINE+"2007"+NEWLINE+"2008"+NEWLINE+"2009"+NEWLINE+"2010"+NEWLINE+"2011",report_default : d.getFullYear(),ignore : 1, parent:'Employee'});
this.filter_fields_dict['Employee'+FILTER_SEP +'Year'].df.in_first_page = 1;
}
report.get_query = function() {
emp_month = this.filter_fields_dict['Employee'+FILTER_SEP+'Month'].get_value();
emp_year = this.filter_fields_dict['Employee'+FILTER_SEP+'Year'].get_value();
emp_status = this.filter_fields_dict['Employee'+FILTER_SEP+'Status'].get_value();
// month and year mandatory
if ((emp_month == '') || (emp_year == '')) {
alert("Please enter Month and Year");
return;
}
month={"January":"1", "February":"2", "March":"3", "April":"4","May":"5", "June":"6", "July":"7","August":"8", "September":"9", "October":"10", "November":"11", "December":"12"}
mnt = ''
for(m=0; m<emp_month.length;m++){
if(mnt== '') mnt = "("+month[emp_month[m]];
else mnt +=", "+month[emp_month[m]];
}
mnt +=")"
c1 = '(MONTH(t1.date_of_joining) in '+mnt+' AND YEAR(t1.date_of_joining) = "'+emp_year+'")';
c2 = '(MONTH(t1.relieving_date) in '+mnt+' AND YEAR(t1.relieving_date) = "'+emp_year+'")';
if(emp_status == 'Active')
cond = c1;
else if (emp_status == 'Left')
cond = c2;
else
cond = c1 + ' OR '+c2;
var q = 'SELECT t1.name AS "ID", t1.employee_name AS "Employee Name", t1.employee_number AS "Employee Number" FROM `tabEmployee` t1 WHERE '+cond;
return q;
}

View File

@@ -0,0 +1,60 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
status = filter_values.get('status')
month = filter_values.get('month')
if status == 'Active' and not status == 'Left':
col = [['Employee', 'Link', 'Employee'], ['Employee Name', 'Data', ''], ['Employee Number', 'Data', ''], ['Employment Type','Link','Employment Type'],['Scheduled Confirmation Date','Data',''],['Final Confirmation Date','Data',''],['Contract End Date','Data',''],['Branch','Link','Branch'],['Department','Link','Department'],['Designation','Link','Designation'],['Reports to','Link','Employee'],['Grade','Link','Grade']]
elif status == 'Left' and not status == 'Active':
col = [['Employee', 'Link', 'Employee'], ['Employee Name', 'Data', ''], ['Employee Number', 'Data', ''], ['Resignation Letter Date','Data',''],['Relieving Date','Data',''],['Notice - Number of Days','Data',''],['Reason for Leaving','Data',''],['Leave Encashed?','Data',''],['Encashment Date','Data',''],['Reason for Resignation','Data','']]
else:
col = [['Employee', 'Link', 'Employee'], ['Employee Name', 'Data', ''], ['Employee Number', 'Data', ''], ['Employment Type','Link','Employment Type'],['Scheduled Confirmation Date','Data',''],['Final Confirmation Date','Data',''],['Contract End Date','Data',''],['Branch','Link','Branch'],['Department','Link','Department'],['Designation','Link','Designation'],['Reports to','Link','Employee'],['Grade','Link','Grade'],['Resignation Letter Date','Data',''],['Relieving Date','Data',''],['Notice - Number of Days','Data',''],['Reason for Leaving','Data',''],['Leave Encashed?','Data',''],['Encashment Date','Data',''],['Reason for Resignation','Data','']]
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append('150px')
coloptions.append(c[2])
col_idx[c[0]] = len(colnames)-1
for c in range(0,len(colnames)):
l = (len(colnames[c])*9)
if l < 150 : col_width = '150px'
else: col_width = '%spx'%(l)
colwidths[c] = col_width
for r in res:
if status == 'Active':
ret = sql("select employment_type,scheduled_confirmation_date,final_confirmation_date,contract_end_date,branch,department,designation,reports_to,grade from `tabEmployee` where name = %s",r[0])
elif status == 'Left':
ret = sql("select resignation_letter_date,relieving_date,notice_number_of_days,reason_for_leaving,leave_encashed,encashment_date,reason_for_resignation from `tabEmployee` where name =%s",r[0])
else:
ret = sql("select employment_type,scheduled_confirmation_date,final_confirmation_date,contract_end_date,branch,department,designation,reports_to,grade,resignation_letter_date,relieving_date,notice_number_of_days,reason_for_leaving,leave_encashed,encashment_date,reason_for_resignation from `tabEmployee` where name = %s",r[0])
ret = ret and ret[0] or []
for t in ret:
r.append(cstr(t))

View File

@@ -0,0 +1,33 @@
# Search Criteria, new_or_left_employees_for_a_month
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:51',
'docstatus': 0,
'modified': '2012-04-03 12:49:51',
'modified_by': u'Administrator',
'owner': u'harshada@webnotestech.com'
},
# These values are common for all Search Criteria
{
'columns': u'Employee\x01ID',
'criteria_name': u'New or left employees for a month',
'doc_type': u'Employee',
'doctype': 'Search Criteria',
'filters': u"{'Employee\x01Saved':1,'Employee\x01Submitted':1,'Employee\x01Gender':'','Employee\x01Month of Birth':'','Employee\x01Status':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabEmployee`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, new_or_left_employees_for_a_month
{
'doctype': 'Search Criteria',
'name': u'new_or_left_employees_for_a_month'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,25 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
report.customize_filters = function() {
fld_lst = ['ID','Employee']
for(var i = 0; i<fld_lst.length; i++){
this.filter_fields_dict['Salary Slip'+FILTER_SEP +fld_lst[i]].df.in_first_page = 1;
}
}
this.mytabs.items['Select Columns'].hide();

View File

@@ -0,0 +1,77 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
sal_slips_ids = ''
for r in res:
if not sal_slips_ids == '': sal_slips_ids +=","
sal_slips_ids+="'%s'"%r[col_idx['ID']]
earn_heads, ded_heads = [], []
if res:
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=[]
for e in earn_heads:
l = (len(cstr(e))*9)
if l < 150 :
col_width = '150px'
else:
col_width = '%spx'%(l)
col.append([e,'Currency',col_width,''])
col.append(['Arrear Amount','Currency','150px',''])
col.append(['Encashment Amount','Currency','170px',''])
col.append(['Gross Pay','Currency','150px',''])
for d in ded_heads:
l = (len(cstr(d))*9)
if l < 150 : col_width = '150px'
else: col_width = '%spx'%(l)
col.append([d,'Currency',col_width,''])
col.append(['Total Deduction','Currency','150px',''])
col.append(['Net Pay','Currency','150px',''])
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)
grand_tot = 0
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 `tabSalary Slip Earning` where e_type = '%s' and parent = '%s'"%(colnames[i],r[0]))
if not amt:
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))
else:
fld_nm = cstr(colnames[i]).lower().replace(' ','_')
tot = sql("select %s from `tabSalary Slip` where name ='%s'"%(fld_nm,r[0]))
tot = tot and flt(tot[0][0]) or 0
if colnames[i] == 'Net Pay':
grand_tot += tot
r.append(tot)
gt_row = ['' for i in range(len(colnames))]
gt_row[col_idx['Employee Name']] = '<b>Grand Totals</b>'
gt_row[col_idx['Net Pay']-1] = fmt_money(grand_tot)
res.append(gt_row)

View File

@@ -0,0 +1,33 @@
# Search Criteria, salary_register
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:52',
'docstatus': 0,
'modified': '2012-04-03 12:49:52',
'modified_by': u'Administrator',
'owner': u'harshada@webnotestech.com'
},
# These values are common for all Search Criteria
{
'columns': u'Salary Slip\x01ID,Salary Slip\x01Employee,Salary Slip\x01Employee Name,Salary Slip\x01Year,Salary Slip\x01Month,Salary Slip\x01Total days in month,Salary Slip\x01Payment days',
'criteria_name': u'Salary Register',
'doc_type': u'Salary Slip',
'doctype': 'Search Criteria',
'filters': u"{'Salary Slip\x01Submitted':1,'Salary Slip\x01Month':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabSalary Slip`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, salary_register
{
'doctype': 'Search Criteria',
'name': u'salary_register'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,33 @@
# Search Criteria, salary_slips
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:52',
'docstatus': 0,
'modified': '2012-04-03 12:49:52',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Search Criteria
{
'columns': u'Salary Slip\x01ID,Salary Slip\x01Fiscal Year,Salary Slip\x01Month,Salary Slip\x01Employee,Salary Slip\x01Employee Name,Salary Slip\x01Department,Salary Slip\x01Designation,Salary Slip\x01Branch,Salary Slip\x01Grade,Salary Slip\x01PF No.,Salary Slip\x01ESIC No.,Salary Slip\x01Leave Without Pay,Salary Slip\x01Bank Name,Salary Slip\x01Bank Account No.,Salary Slip\x01Payment days,Salary Slip\x01Arrear Amount,Salary Slip\x01Encashment Amount,Salary Slip\x01Gross Pay,Salary Slip\x01Total Deduction,Salary Slip\x01Net Pay',
'criteria_name': u'Salary Slips',
'doc_type': u'Salary Slip',
'doctype': 'Search Criteria',
'filters': u"{'Salary Slip\x01Saved':1,'Salary Slip\x01Submitted':1}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabSalary Slip`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, salary_slips
{
'doctype': 'Search Criteria',
'name': u'salary_slips'
}
]

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,33 @@
# Search Criteria, salary_structure_details
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:52',
'docstatus': 0,
'modified': '2012-04-03 12:49:52',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Search Criteria
{
'columns': u'Salary Structure\x01ID,Salary Structure\x01Employee,Salary Structure\x01From Date,Salary Structure\x01To Date,Salary Structure\x01Fiscal Year,Salary Structure\x01Branch,Salary Structure\x01Designation,Salary Structure\x01Department,Salary Structure\x01Grade,Salary Structure\x01Is Active,Salary Structure\x01Total Earning,Salary Structure\x01Total Deduction,Salary Structure\x01CTC,Salary Structure\x01Total',
'criteria_name': u'Salary Structure Details',
'doc_type': u'Salary Structure',
'doctype': 'Search Criteria',
'filters': u"{'Salary Structure\x01Branch':'','Salary Structure\x01Designation':'','Salary Structure\x01Department':'','Salary Structure\x01Grade':'','Salary Structure\x01Is Active':''}",
'module': u'HR',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabSalary Structure`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, salary_structure_details
{
'doctype': 'Search Criteria',
'name': u'salary_structure_details'
}
]