diff --git a/addons/hr_payroll/__openerp__.py b/addons/hr_payroll/__openerp__.py index 44c0fb93506..8bfa8510322 100644 --- a/addons/hr_payroll/__openerp__.py +++ b/addons/hr_payroll/__openerp__.py @@ -38,7 +38,7 @@ Generic Payroll system. """, 'author':'OpenERP SA', 'website':'http://www.openerp.com', - 'images': ['images/hr_company_contributions.jpeg','images/hr_salary_heads.jpeg','images/hr_salary_structure.jpeg','images/hr_employee_payslip.jpeg','images/hr_payment_advice.jpeg','images/hr_payroll_register.jpeg'], + 'images': ['images/hr_company_contributions.jpeg','images/hr_salary_heads.jpeg','images/hr_salary_structure.jpeg','images/hr_employee_payslip.jpeg'], 'depends': [ 'hr', 'hr_contract', @@ -56,13 +56,9 @@ Generic Payroll system. 'hr_payroll_report.xml', 'hr_payroll_data.xml', 'security/ir.model.access.csv', - 'wizard/hr_payroll_employees_detail.xml', - 'wizard/hr_payroll_year_salary.xml', ], 'test': [ # 'test/payslip.yml', -# 'test/payment_advice.yml', -# 'test/payroll_register.yml', # 'test/hr_payroll_report.yml', ], 'demo_xml': [ diff --git a/addons/hr_payroll/hr_payroll_sequence.xml b/addons/hr_payroll/hr_payroll_sequence.xml index e1c27bbad27..58445e29584 100644 --- a/addons/hr_payroll/hr_payroll_sequence.xml +++ b/addons/hr_payroll/hr_payroll_sequence.xml @@ -1,6 +1,7 @@ + Salary Slip salary.slip @@ -11,27 +12,6 @@ SLIP/ 3 - - - Salary Register - salary.register - - - Salary Register - salary.register - REG/ - 3 - - - - Payment Advice - payment.advice - - - Payment Advice - payment.advice - PAY/ - 3 - + diff --git a/addons/hr_payroll/hr_payroll_wizard.xml b/addons/hr_payroll/hr_payroll_wizard.xml deleted file mode 100644 index 71267ddb742..00000000000 --- a/addons/hr_payroll/hr_payroll_wizard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/addons/hr_payroll/report/__init__.py b/addons/hr_payroll/report/__init__.py index e4d936e9197..17d38ecbed5 100644 --- a/addons/hr_payroll/report/__init__.py +++ b/addons/hr_payroll/report/__init__.py @@ -24,10 +24,5 @@ import report_payslip import report_payslip_details -import report_payroll_advice -import report_year_salary -import report_payroll_register -import report_employees_detail -import report_emp_salary_structure # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/payroll_register.rml b/addons/hr_payroll/report/payroll_register.rml deleted file mode 100644 index 3fecf454aa1..00000000000 --- a/addons/hr_payroll/report/payroll_register.rml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - Employee Name - - - Basic - - - Others - - - Allowances - - - Gross Sal. - - - Deduction - - - Net Sal. - - - - - [[ repeatIn(objects, 'o') ]] - Salary Payment Register - [[o.name]] - For the month of [[get_month(o.date)]] - - - - - - - Number : [[o.number]] - Date : [[formatLang(time.strftime('%Y-%m-%d'), date = True)]] - - - -
- - - - # - - - Employee Name - - - Basic - - - Others - - - Allowances - - - Gross Sal. - - - Deduction - - - Net Sal. - - - -
-
- [[repeatIn(o.line_ids, 'l')]] - - - - [[ get_no() ]] - - - [[ l.employee_id.name ]] - - - [[ formatLang(l.basic, dp='Account') ]] [[ company.currency_id.symbol]] - - - [[ formatLang(l.other_pay, dp='Account')]] [[ company.currency_id.symbol]] - - - [[ formatLang(l.allounce, dp='Account')]] [[ company.currency_id.symbol]] - - - [[ formatLang(l.grows, dp='Account')]] [[ company.currency_id.symbol]] - - - [[ formatLang(l.deduction, dp='Account')]] [[ company.currency_id.symbol]] - - - [[ formatLang(l.net, dp='Account')]] [[ company.currency_id.symbol]] - - - -
- - - - - - - - - Total Salary - - - [[formatLang(get_basic(o), dp='Account')]][[ company.currency_id.symbol]] - - - [[formatLang(get_other(o), dp='Account')]] [[ company.currency_id.symbol]] - - - [[formatLang(get_allow(o), dp='Account')]] [[ company.currency_id.symbol]] - - - [[formatLang(get_grows(o), dp='Account')]] [[ company.currency_id.symbol]] - - - [[formatLang(get_deduct(o), dp='Account')]] [[ company.currency_id.symbol]] - - - [[formatLang(get_net(o), dp='Account')]] [[ company.currency_id.symbol]] - - - - - - - - - - - - - For [[company.name]], - - - - - - - - - - HR Manager - Authorised Signature - - - - - - - - - - - -
-
-
diff --git a/addons/hr_payroll/report/payslip.rml b/addons/hr_payroll/report/payslip.rml deleted file mode 100644 index d70e4b6a362..00000000000 --- a/addons/hr_payroll/report/payslip.rml +++ /dev/null @@ -1,584 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(objects,'o')]] - - - - Pay Slip - - - - - - - - - - - - - Code - - - [[ o.employee_id.sinid or '' ]] - - - Name - - - [[o.employee_id.name]] - - - - - - - Address - - - [[o.employee_id.address_home_id and o.employee_id.address_home_id.name or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.street or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.street2 or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.zip or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.city or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.state_id and o.employee_id.address_home_id.state_id.name or '' ]] [[o.employee_id.address_home_id and o.employee_id.address_home_id.country_id and o.employee_id.address_home_id.country_id.name or '' ]] - - - - - - - Email - - - [[ o.employee_id.work_email or '' ]] - - - Bank Details - - - [[ o.employee_id.otherid or '' ]] - - - - - - - Slip ID - - - [[ o.number or '' ]] - - - Identification No - - - [[ o.employee_id.passport_id and o.employee_id.passport_id.name or '' ]] - - - - - - - Register - - - [[ o.register_id and o.register_id.name or '' ]] - - - Designation - - - [[ o.employee_id.contract_id and o.employee_id.contract_id.job_id.name or '' ]] - - - - - - - - - - - Basic Salary without Leave: - - - - - - - Working Days - - - [[ o.working_days or '' ]] - - - Number of Leaves - - - [[ o.holiday_days or '' ]] - - - Worked Day - - - [[ o.worked_days or '' ]] - - - - - - - Basic Salary - - - [[ formatLang(o.contract_id.wage, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - Leaved Deduction - - - [[ formatLang(o.leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - Basic Salary – Leaves - - - [[ formatLang(o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - - - - - Leave Deductions Line: - - - - - - - Deductions - - - [[ get_month(o) ]] - - - -
- [[repeatIn(get_leave(o.line_ids),'ld') ]] - - - - [[ ld.code ]] - - - [[ formatLang(ld.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - -
- - - - Earnings - - - [[ get_month(o) ]] - - - Deductions - - - [[ get_month(o) ]] - - - - - - - - - - Basic Salary - - - [[ formatLang(o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - - - [[repeatIn(get_earnings(o.line_ids),'a') ]] [[ a.code ]] - - - [[ formatLang(a.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - - - - - - -
- [[repeatIn(get_deductions(o.line_ids),'b') ]] - - - - [[ b.code ]] - - - [[ formatLang(b.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - - - - -
- - - - - -
- - - - Total Earnings([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) - - - [[ formatLang(o.allounce + o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - Total Deductions([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) - - - [[ formatLang(o.deduction, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - - - - - - - - - - - - - - Net Amount([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) - - - [[ formatLang(o.net, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] - - - - - - - Amount (in words) : - - - - - - - - - - [[ convert(o.net,company.currency_id.name) ]] - - - - - - - - - - - - - - - - - - - - - - - Authorized Signature - - - - - - -
-
diff --git a/addons/hr_payroll/report/report_emp_salary_structure.py b/addons/hr_payroll/report/report_emp_salary_structure.py deleted file mode 100644 index 0da09d16562..00000000000 --- a/addons/hr_payroll/report/report_emp_salary_structure.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- - -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# d$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time -from report import report_sxw - -class salary_structure_report(report_sxw.rml_parse): - - def __init__(self, cr, uid, name, context): - super(salary_structure_report, self).__init__(cr, uid, name, context) - self.localcontext.update({ - 'time': time, - 'get_type':self.get_type, - #'get_contract':self.get_contract, - 'get_line_amount_type':self.get_line_amount_type, - 'get_line_type':self.get_line_type, - 'get_line_amount_symbol':self.get_line_amount_symbol - }) - -# def get_contract(self,emp): -# curr_date = "'"+time.strftime("%Y-%m-%d")+"'" -# sql_req= ''' -# SELECT c.id as id, c.wage as wage, struct_id as struct -# FROM hr_contract c -# LEFT JOIN hr_employee emp on (c.employee_id=emp.id) -# LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id) -# LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id) -# WHERE -# (emp.id=%s) AND -# (date_start <= %s) AND -# (date_end IS NULL OR date_end >= %s) -# LIMIT 1 -# '''%(emp.id, curr_date, curr_date) -# self.cr.execute(sql_req) -# contract_id = self.cr.dictfetchone() -# if not contract_id: -# return [] -# contract = self.pool.get('hr.contract').browse(self.cr, self.uid, [contract_id['id']]) -# return contract - - def get_type(self,type): - return type[0].swapcase() + type[1:] +' Salary' - - def get_line_amount_type(self,amount_type): - if amount_type == 'per': - return 'Percent(%)' - else: - return 'Fixed' - - def get_line_amount_symbol(self,amount_type): - if amount_type != 'per': - return self.pool.get('res.users').browse(self.cr, self.uid,self.uid).company_id.currency_id.symbol - - def get_line_type(self,type): - if type == 'allounce': - return 'Allowance' - elif type == 'deduction': - return 'Deduction' - elif type == 'advance': - return 'Advance' - elif type == 'loan': - return 'Loan' - elif type == 'otherpay': - return 'Other Payment' - else: - return 'Other Deduction' - -report_sxw.report_sxw('report.salary.structure', 'hr.employee', 'hr_payroll/report/report_emp_salary_structure.rml', parser=salary_structure_report) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - - - - - - - diff --git a/addons/hr_payroll/report/report_emp_salary_structure.rml b/addons/hr_payroll/report/report_emp_salary_structure.rml deleted file mode 100644 index 27ff2fcc4e4..00000000000 --- a/addons/hr_payroll/report/report_emp_salary_structure.rml +++ /dev/null @@ -1,578 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - Name - - - Amount - - - Amount Type - - - - - [[repeatIn(objects,'employee')]] - - - -
- [[ not employee.contract_id and removeParentNode('section') ]] - - - - Code - - - [[ employee.ssnid ]] - - - Department - - - [[ employee.company_id and employee.company_id.name or '' ]] - - - Bank - - - [[ employee.otherid or '' ]] - - - - - - - Name - - - [[ employee.name ]] - - - Other No. - - - [[ employee.otherid or '' ]] - - - Address - - - [[employee.address_home_id and employee.address_home_id.name or '' ]] - - - - - - - Designation - - - [[ employee.contract_id.job_id and employee.contract_id.job_id.name or '' ]] - - - Phone No. - - - [[ employee.work_phone or '' ]] - - - E-mail - - - [[ employee.work_email or '' ]] - - - - - - - - - - Contract Detail: - - - - - - - - - - - - - Start Date - - - [[ formatLang(employee.contract_id.date_start,date=True) or '' ]] - - - End Date - - - [[ formatLang(employee.contract_id.date_end,date=True) or removeParentNode('para') ]] - - - Type - - - [[ get_type(employee.contract_id.wage_type_id.type) or '' ]] - - - - - - - Salary - - - [[ formatLang(employee.contract_id.wage) or '' ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]] - - - Notes: - - - [[ employee.contract_id.notes or '' ]] - - - - - - - Basic - - - [[ formatLang(employee.basic) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]] - - - Allowances - - - [[ formatLang(employee.advantages_gross) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]] - - - Gross Salary - - - [[ formatLang(employee.gross) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]] - - - - - - - Deductions - - - [[ formatLang(employee.advantages_net) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]] - - - Net Salary - - - [[ formatLang(employee.net) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]] - - - - - - - - - - Salary Structure: - - - - - - -
- - - - - - - Code - - - Name - - - Amount - - - Amount Type - - - - - - -
- [[repeatIn(employee.contract_id.struct_id and employee.contract_id.struct_id.line_ids or [],'line')]] - - - - [[ line.code or '' ]] - - - [[ line.name ]] - - - [[ line.amount_type =='per' and formatLang(line.amount*100) or formatLang(line.amount)]] [[ get_line_amount_symbol(line.amount_type) ]] - - - [[ get_line_amount_type(line.amount_type) ]] - - - - - - -
- - - -
-
- - - - - - - Special Allowances and Deductions For Employee: - - - - - - -
- - - - - - - Code - - - Name - - - Amount - - - Amount Type - - - - - - -
- [[repeatIn(employee.line_ids,'line1')]] - - - - [[ line1.code or '' ]] - - - [[ line1.name ]] - - - [[ line1.amount_type =='per' and formatLang(line1.amount*100) or formatLang(line1.amount) ]] [[ get_line_amount_symbol(line1.amount_type) ]] - - - [[ get_line_amount_type(line1.amount_type) ]] - - - - - - -
- - - -
- - - -
-
-
diff --git a/addons/hr_payroll/report/report_employees_detail.py b/addons/hr_payroll/report/report_employees_detail.py deleted file mode 100644 index 0e1451e469c..00000000000 --- a/addons/hr_payroll/report/report_employees_detail.py +++ /dev/null @@ -1,252 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- - -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# d$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time -import locale -import datetime -from report import report_sxw -import time -import pooler - -class employees_salary_report(report_sxw.rml_parse): - - def __init__(self, cr, uid, name, context): - super(employees_salary_report, self).__init__(cr, uid, name, context) - self.localcontext.update({ - 'time': time, - 'get_employee': self.get_employee, - 'get_employee_detail': self.get_employee_detail, - 'cal_monthly_amt': self.cal_monthly_amt, - 'get_periods': self.get_periods, - 'get_total': self.get_total, - 'get_allow': self.get_allow, - 'get_deduct': self.get_deduct, - 'get_other': self.get_other, - 'get_monthly_total': self.get_monthly_total, - }) - - self.mnths =[] - self.allow_list =[] - self.deduct_list = [] - self.other_list = [] - self.month_total_list =[] - self.total=0.00 - - def get_periods(self,form): - self.mnths =[] -# Get start year-month-date and end year-month-date - fy = int(form['date_from'][0:4]) - ly = int(form['date_to'][0:4]) - - fm = int(form['date_from'][5:7]) - lm = int(form['date_to'][5:7]) - no_months = (ly-fy)*12+lm-fm + 1 - cm = fm - cy = fy - -# Get name of the months from integer - mnth_name = [] - for count in range(0,no_months): - m = datetime.date(cy, cm, 1).strftime('%b') - mnth_name.append(m) - self.mnths.append(str(cm)+'-'+str(cy)) - - if cm == 12: - cm = 0 - cy = ly - cm = cm +1 - for c in range(0,(12-no_months)): - mnth_name.append('None') - self.mnths.append('None') - return [mnth_name] - - def get_employee(self,form): - result = [] - periods = [] - emp = pooler.get_pool(self.cr.dbname).get('hr.employee') - emp_ids = form['employee_ids'] - result = emp.browse(self.cr,self.uid, emp_ids) - return result - - def get_employee_detail(self,obj): - self.month_total_list =['Net Total (Allowances with Basic - Deductions)',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00] - self.allow_list =[] - self.deduct_list = [] - self.other_list = [] - allowance_cat_ids =[] - deduction_cat_ids = [] - other_cat_ids =[] - self.total = 0.00 - payment_category = self.pool.get('hr.allounce.deduction.categoty') - payslip = self.pool.get('hr.payslip') - allowance_cat_ids = payment_category.search( self.cr, self.uid, [('type','=','allowance')]) - deduction_cat_ids = payment_category.search( self.cr, self.uid, [('type','=','deduction')]) - other_cat_ids = payment_category.search( self.cr, self.uid, [('type','in',('advance','loan','installment','otherpay','otherdeduct'))]) - #for Basic Salary - res = [] - res = self.cal_monthly_amt(obj.id,False) - self.total += res[len(res)-1] - basic_flag = False - for i in range(1,len(res)): - if res[i] > 0.0: - basic_flag = True - if basic_flag: - self.allow_list.append(res) - #for allowance - if allowance_cat_ids: - for allow in allowance_cat_ids: - res = [] - res = self.cal_monthly_amt(obj.id,allow) - all_flag = False - for i in range(1,len(res)): - if res[i] > 0.0: - all_flag = True - if all_flag: - self.allow_list.append(res) - self.total += res[len(res)-1] - #for Deduction - if deduction_cat_ids: - for deduct in deduction_cat_ids: - res = [] - res = self.cal_monthly_amt(obj.id,deduct) - ded_flag = False - for i in range(1,len(res)): - if res[i] > 0.0: - ded_flag = True - if ded_flag: - self.deduct_list.append(res) - self.total -= res[len(res)-1] - #for Other - if other_cat_ids: - for other in other_cat_ids: - res = [] - res = self.cal_monthly_amt(obj.id,other) - other_flag = False - for i in range(1,len(res)): - if res[i] > 0.0: - other_flag = True - if other_flag: - self.other_list.append(res) - return None - - def cal_monthly_amt(self,emp_id,category): - tot = 0.0 - cnt = 1 - result = [] - res ={} - if not category: - result.append('Basic Salary') - else: - category_name = self.pool.get('hr.allounce.deduction.categoty').read(self.cr, self.uid, [category],['name','type'])[0] - result.append(category_name['name']) - for mnth in self.mnths: - if mnth <> 'None': - if len(mnth) != 7: - mnth = '0' + str(mnth) - query = "select id from hr_payslip where employee_id = "+str(emp_id)+" and to_char(date,'mm-yyyy') like '%"+mnth+"%' and state = 'done' " - self.cr.execute(query) - payslip_id = self.cr.dictfetchone() - else: - payslip_id = False - if payslip_id: - payslip_obj = self.pool.get('hr.payslip').browse(self.cr, self.uid, payslip_id['id']) - if not category: - tot += payslip_obj.basic - res[mnth] = payslip_obj.basic - result.append(payslip_obj.basic) - self.month_total_list[cnt] = self.month_total_list[cnt] + payslip_obj.basic - else: - append_index = 0 - for line in payslip_obj.line_ids: - if line.category_id.id == category: - if category_name['type'] == 'allowance': - if res: - self.month_total_list[cnt] = self.month_total_list[cnt] + line.total - result[append_index] += line.total - tot += line.total - res[mnth] = result[append_index] - else: - self.month_total_list[cnt] = self.month_total_list[cnt] + line.total - tot += line.total - res[mnth] = line.total - append_index = len(result) - 1 - result.append(line.total) - if category_name['type'] == 'deduction': - if res: - self.month_total_list[cnt] = self.month_total_list[cnt] - line.total - result[append_index] += line.total - tot += line.total - res[mnth] = result[append_index] - else: - self.month_total_list[cnt] = self.month_total_list[cnt] - line.total - tot += line.total - res[mnth] = line.total - append_index = len(result) - 1 - result.append(line.total) - if category_name['type'] in ('advance','loan','installment','otherpay','otherdeduct'): - if res: - result[append_index] += line.total - tot += line.total - res[mnth] = result[append_index] - else: - res[mnth] = line.total - result.append(res[mnth]) - append_index = len(result) - 1 - tot += line.total - else: - if mnth == 'None': - result.append('') - res[mnth] = '' - self.month_total_list[cnt] = '' - else: - result.append(0.00) - res[mnth] = 0.00 - if not res: - result.append(0.00) - res = {} - cnt = cnt + 1 - cnt = 1 - result.append(tot) - tot = 0.0 - return result - - def get_allow(self): - return self.allow_list - - def get_deduct(self): - return self.deduct_list - - def get_other(self): - return self.other_list - - def get_total(self): - return self.total - - def get_monthly_total(self): - return self.month_total_list - -report_sxw.report_sxw('report.employees.salary', 'hr.payslip', 'hr_payroll/report/report_employees_detail.rml', parser=employees_salary_report,header='internal landscape') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/hr_payroll/report/report_employees_detail.rml b/addons/hr_payroll/report/report_employees_detail.rml deleted file mode 100644 index 87ec7a3d3d9..00000000000 --- a/addons/hr_payroll/report/report_employees_detail.rml +++ /dev/null @@ -1,730 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Title - - - [[ m[0] != 'None' and m[0] or '' ]] - - - [[ m[1] != 'None' and m[1] or '' ]] - - - [[ m[2] != 'None' and m[2] or '' ]] - - - [[ m[3] != 'None' and m[3] or '' ]] - - - [[ m[4] != 'None' and m[4] or '' ]] - - - [[ m[5] != 'None' and m[5] or '' ]] - - - [[ m[6] != 'None' and m[6] or '' ]] - - - [[ m[7] != 'None' and m[7] or '' ]] - - - [[ m[8] != 'None' and m[8] or '' ]] - - - [[ m[9] != 'None' and m[9] or '' ]] - - - [[ m[10] != 'None' and m[10] or '' ]] - - - [[ m[11] != 'None' and m[11] or '' ]] - - - Total - - - - - [[ repeatIn(get_employee(data['form']), 'o') ]] - - - - Employees Salary Details - From [[ formatLang(data['form']['date_from'], date=True) ]] To [[ formatLang(data['form']['date_to'], date=True) ]] - - - - - - - - - - Employee Code - - - [[ o.ssnid ]] - - - Department - - - [[ o.company_id and o.company_id.name or '' ]] - - - Bank - - - [[ o.otherid or '' ]] - - - - - - - Employee Name - - - [[ o.name ]] - - - Other No. - - - [[ o.otherid or '' ]] - - - Address - - - [[o.address_home_id and o.address_home_id.name or '' ]] - - - - - - - Designation - - - [[ o.contract_ids and o.contract_ids[0].job_id.name or '' ]] - - - Phone No. - - - [[ o.work_phone or '' ]] - - - E-mail Address - - - [[o.work_email or '' ]] - - - - - - -
- [[ repeatIn(get_periods(data['form']),'m') ]] [[ get_employee_detail(o) ]] - - - - Title - - - [[ m[0] != 'None' and m[0] or '' ]] - - - [[ m[1] != 'None' and m[1] or '' ]] - - - [[ m[2] != 'None' and m[2] or '' ]] - - - [[ m[3] != 'None' and m[3] or '' ]] - - - [[ m[4] != 'None' and m[4] or '' ]] - - - [[ m[5] != 'None' and m[5] or '' ]] - - - [[ m[6] != 'None' and m[6] or '' ]] - - - [[ m[7] != 'None' and m[7] or '' ]] - - - [[ m[8] != 'None' and m[8] or '' ]] - - - [[ m[9] != 'None' and m[9] or '' ]] - - - [[ m[10] != 'None' and m[10] or '' ]] - - - [[ m[11] != 'None' and m[11] or '' ]] - - - Total - - - -
- - - - Allowances with Basic: - - - -
- [[ repeatIn(get_allow(),'e1') ]] - - - - [[ e1[0] ]] - - - - [[ (e1[1]!='' and formatLang(e1[1])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[2]!='' and formatLang(e1[2])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[3]!='' and formatLang(e1[3])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[4]!='' and formatLang(e1[4])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[5]!='' and formatLang(e1[5])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[6]!='' and formatLang(e1[6])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[7]!='' and formatLang(e1[7])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[8]!='' and formatLang(e1[8])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[9]!='' and formatLang(e1[9])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[10]!='' and formatLang(e1[10])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[11]!='' and formatLang(e1[11])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e1[12]!='' and formatLang(e1[12])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - [[ formatLang(e1[13]) ]] [[ company.currency_id.symbol ]] - - - -
- - - - Deductions: - - - -
- [[ repeatIn(get_deduct(),'e2') ]] - - - - [[ e2[0] ]] - - - - [[ (e2[1]!='' and formatLang(e2[1])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[2]!='' and formatLang(e2[2])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[3]!='' and formatLang(e2[3])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[4]!='' and formatLang(e2[4])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[5]!='' and formatLang(e2[5])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[6]!='' and formatLang(e2[6])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[7]!='' and formatLang(e2[7])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[8]!='' and formatLang(e2[8])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[9]!='' and formatLang(e2[9])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[10]!='' and formatLang(e2[10])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[11]!='' and formatLang(e2[11])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e2[12]!='' and formatLang(e2[12])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - [[ formatLang(e2[13]) ]] [[ company.currency_id.symbol ]] - - - -
- - - - Others: - - - -
- [[ repeatIn(get_other(),'e3') ]] - - - - [[ e3[0] ]] - - - - [[ (e3[1]!='' and formatLang(e3[1])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[2]!='' and formatLang(e3[2])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[3]!='' and formatLang(e3[3])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[4]!='' and formatLang(e3[4])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[5]!='' and formatLang(e3[5])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[6]!='' and formatLang(e3[6])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[7]!='' and formatLang(e3[7])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[8]!='' and formatLang(e3[8])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[9]!='' and formatLang(e3[9])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[10]!='' and formatLang(e3[10])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[11]!='' and formatLang(e3[11])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e3[12]!='' and formatLang(e3[12])) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - [[ formatLang(e3[13]) ]] [[ company.currency_id.symbol ]] - - - -
-
- - - - [[ get_monthly_total()[0] ]] - - - [[ formatLang(get_monthly_total()[1], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[2], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[3], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[4], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[5], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[6], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[7], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[8], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[9], dp='Account')) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[10], dp='Account']) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[11], dp='Account']) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_monthly_total()[12], dp='Account']) or removeParentNode('para') ]][[ company.currency_id.symbol ]] - - - [[ formatLang(get_total(), dp='Account') ]][[ company.currency_id.symbol ]] - - - -
-
-
-
diff --git a/addons/hr_payroll/report/report_payroll_advice.py b/addons/hr_payroll/report/report_payroll_advice.py deleted file mode 100644 index 5ac20d91d71..00000000000 --- a/addons/hr_payroll/report/report_payroll_advice.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- - -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# d$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time -from datetime import datetime -from report import report_sxw -from tools import amount_to_text_en - -class payroll_advice_report(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(payroll_advice_report, self).__init__(cr, uid, name, context) - - self.total_amount = 0.00 - self.total_bysal = 0.00 - self.localcontext.update({ - 'time': time, - 'get_month': self.get_month, - 'convert': self.convert, - 'get_detail': self.get_detail, - 'get_total': self.get_total, - 'get_bysal_total': self.get_bysal_total, - }) - - def get_month(self,input_date): - res = { - 'mname': '' - } - date = datetime.strptime(input_date, '%Y-%m-%d') - res['mname']= date.strftime('%B')+'-'+date.strftime('%Y') - return res - - def convert(self,amount, cur): - amt_en = amount_to_text_en.amount_to_text(amount,'en',cur); - return amt_en - - def get_bysal_total(self): - return self.total_bysal - - def get_total(self): - return self.total_amount - - def get_detail(self,line_ids): - result =[] - if line_ids: - for l in line_ids: - res = {} - res['name'] = l.employee_id.name - res['acc_no'] = l.name - res['amount'] = l.amount - res['bysal'] = l.bysal - res['flag'] = l.flag - self.total_amount += l.amount - self.total_bysal += l.bysal - result.append(res) - return result - -report_sxw.report_sxw('report.payroll.advice', 'hr.payroll.advice', 'hr_payroll/report/report_payroll_advice.rml', parser=payroll_advice_report) - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_payroll_advice.rml b/addons/hr_payroll/report/report_payroll_advice.rml deleted file mode 100644 index c3c1f9dd50e..00000000000 --- a/addons/hr_payroll/report/report_payroll_advice.rml +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SI. No. - - - Name of the Employee - - - Amount - - - By Salary - - - Bank Account - - - D/C - - - - - [[repeatIn(objects,'o')]] - - - - - - - - - - - - - - - - - - - - - - The Manager - - - - - - - - - - [[ o.bank_id and o.bank_id.name or 'Bank' ]] - - - - - - - - - - - - - Dear Sir/Madam, - - - - - - - - - - - - Payment Advice: [[ o.name ]] for period [[ get_month(o.date)['mname'] ]] - - - - - - - [[ o.note ]] - - - - - - - - - - SI. No. - - - Name of the Employee - - - Amount - - - By Salary - - - Bank Account - - - D/C - - - -
- [[ repeatIn(get_detail(o.line_ids),'line') ]] - - - - - . - - - - - [[ line['name'] ]] - - - [[ formatLang(line['amount'], dp='Account') ]] [[ company.currency_id.symbol ]] - - - [[ formatLang(line['bysal'], dp='Account') ]] [[ company.currency_id.symbol ]] - - - [[ line['acc_no'] ]] - - - [[ line['flag'] ]] - - - -
- - - - - - - - - Total: - - - [[ formatLang(get_total(), dp='Account') ]] [[ company.currency_id.symbol ]] - - - [[ formatLang(get_bysal_total(), dp='Account') ]] [[ company.currency_id.symbol ]] - - - - - - - - - - - - - - - Yours Sincerely - - - - - - - - - - For [[ company.name ]] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Authorised Signature - - - - - - - - - - - - - - -
-
-
diff --git a/addons/hr_payroll/report/report_payroll_register.py b/addons/hr_payroll/report/report_payroll_register.py deleted file mode 100644 index 9410a4eedb2..00000000000 --- a/addons/hr_payroll/report/report_payroll_register.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- - -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# d$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time -from datetime import datetime -from report import report_sxw - -class report_payroll_register(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(report_payroll_register, self).__init__(cr, uid, name, context) - - self.total_amount = 0.00 - self.total_bysal = 0.00 - self.localcontext.update({ - 'time': time, - 'get_month': self.get_month, - 'get_no': self.get_no, - 'get_basic':self.get_basic, - 'get_other':self.get_other, - 'get_allow':self.get_allow, - 'get_grows':self.get_grows, - 'get_deduct':self.get_deduct, - 'get_net':self.get_net, - 'add_line':self.add_line, - }) - self.no = 0 - self.basic = 0.0 - self.other = 0.0 - self.allow = 0.0 - self.grows = 0.0 - self.deduct = 0.0 - self.net = 0.0 - - def add_line(self, line): - self.basic += line.basic - self.other += line.other_pay - self.allow += line.allounce - self.grows += line.grows - self.deduct += line.deduction - self.net += line.net - - def get_basic(self,obj): - for line in obj.line_ids: - self.basic += line.basic - return self.basic - - def get_other(self,obj): - for line in obj.line_ids: - self.other += line.other_pay - return self.other - - def get_allow(self,obj): - for line in obj.line_ids: - self.allow += line.allounce - return self.allow - - def get_grows(self,obj): - for line in obj.line_ids: - self.grows += line.grows - return self.grows - - def get_deduct(self,obj): - for line in obj.line_ids: - self.deduct += line.deduction - return self.deduct - - def get_net(self,obj): - for line in obj.line_ids: - self.net += line.net - return self.net - - def get_month(self, indate): - new_date = datetime.strptime(indate, '%Y-%m-%d') - out_date = new_date.strftime('%B')+'-'+new_date.strftime('%Y') - return out_date - - def get_no(self): - self.no += 1 - return self.no - -report_sxw.report_sxw( - 'report.hr.payroll.register.sheet', - 'hr.payroll.register', - 'hr_payroll/report/payroll_register.rml', - parser=report_payroll_register -) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_year_report.rml b/addons/hr_payroll/report/report_year_report.rml deleted file mode 100644 index 564e87d04ab..00000000000 --- a/addons/hr_payroll/report/report_year_report.rml +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name - - - [[ m[0] != 'None' and m[0] or '' ]] - - - [[ m[1] != 'None' and m[1] or '' ]] - - - [[ m[2] != 'None' and m[2] or '' ]] - - - [[ m[3] != 'None' and m[3] or '' ]] - - - [[ m[4] != 'None' and m[4] or '' ]] - - - [[ m[5] != 'None' and m[5] or '' ]] - - - [[ m[6] != 'None' and m[6] or '' ]] - - - [[ m[7] != 'None' and m[7] or '' ]] - - - [[ m[8] != 'None' and m[8] or '' ]] - - - [[ m[9] != 'None' and m[9] or '' ]] - - - [[ m[10] != 'None' and m[10] or '' ]] - - - [[ m[11] != 'None' and m[11] or '' ]] - - - Total - - - - - Yearly Salary Details - From [[ formatLang(data['form']['date_from'], date=True) ]] To [[ formatLang(data['form']['date_to'], date=True) ]] - - - -
- [[ repeatIn(get_periods(data['form']),'m') ]] - - - - Name - - - [[ m[0] != 'None' and m[0] or '' ]] - - - [[ m[1] != 'None' and m[1] or '' ]] - - - [[ m[2] != 'None' and m[2] or '' ]] - - - [[ m[3] != 'None' and m[3] or '' ]] - - - [[ m[4] != 'None' and m[4] or '' ]] - - - [[ m[5] != 'None' and m[5] or '' ]] - - - [[ m[6] != 'None' and m[6] or '' ]] - - - [[ m[7] != 'None' and m[7] or '' ]] - - - [[ m[8] != 'None' and m[8] or '' ]] - - - [[ m[9] != 'None' and m[9] or '' ]] - - - [[ m[10] != 'None' and m[10] or '' ]] - - - [[ m[11] != 'None' and m[11] or '' ]] - - - Total - - - -
- [[ repeatIn(get_employee(data['form']),'e') ]] - - - - [[ e[0] ]] - - - - [[ (e[1]!='' and formatLang(e[1], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[2]!='' and formatLang(e[2], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[3]!='' and formatLang(e[3], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[4]!='' and formatLang(e[4], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[5]!='' and formatLang(e[5], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[6]!='' and formatLang(e[6], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[7]!='' and formatLang(e[7], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[8]!='' and formatLang(e[8], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[9]!='' and formatLang(e[9], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[10]!='' and formatLang(e[10], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[11]!='' and formatLang(e[11], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - - [[ (e[12]!='' and formatLang(e[12], dp='Account')) or removeParentNode('font') ]] [[company.currency_id.symbol]] - - - - [[ formatLang(e[13], dp='Account') ]] [[company.currency_id.symbol]] - - - -
-
-
- [[ repeatIn(get_months_tol(),'t') ]] - - - - Total - - - [[ formatLang(t[1], dp='Account') or removeParentNode('para') ]] [[company.currency_id.symbol]] - - - [[ formatLang(t[2], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[3], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[4], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[5], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[6], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[7], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[8], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[9], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[10], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[11], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(t[12], dp='Account') or removeParentNode('para')]] [[company.currency_id.symbol]] - - - [[ formatLang(get_total(), dp='Account') ]] [[company.currency_id.symbol]] - - - -
-
-
-
diff --git a/addons/hr_payroll/report/report_year_salary.py b/addons/hr_payroll/report/report_year_salary.py deleted file mode 100644 index bc7ac8fc93a..00000000000 --- a/addons/hr_payroll/report/report_year_salary.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- - -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# d$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import datetime -from report import report_sxw -import time -import pooler - -class year_salary_report(report_sxw.rml_parse): - - def __init__(self, cr, uid, name, context): - super(year_salary_report, self).__init__(cr, uid, name, context) - self.localcontext.update({ - 'time': time, - 'get_employee': self.get_employee, - 'get_periods': self.get_periods, - 'get_months_tol': self.get_months_tol, - 'get_total': self.get_total, - }) - - self.mnths =[] - self.mnths_tol = [] - self.total=0.0 - - def get_periods(self,form): -# Get start year-month-date and end year-month-date - fy = int(form['date_from'][0:4]) - ly = int(form['date_to'][0:4]) - - fm = int(form['date_from'][5:7]) - lm = int(form['date_to'][5:7]) - no_months = (ly-fy)*12+lm-fm + 1 - cm = fm - cy = fy - -# Get name of the months from integer - mnth_name = [] - for count in range(0,no_months): - m = datetime.date(cy, cm, 1).strftime('%b') - mnth_name.append(m) - self.mnths.append(str(cm)+'-'+str(cy)) - if cm == 12: - cm = 0 - cy = ly - cm = cm +1 - for c in range(0,(12-no_months)): - mnth_name.append('None') - self.mnths.append('None') - return [mnth_name] - - def get_employee(self,form): - ls1=[] - ls = [] - tol_mnths=['Total',0,0,0,0,0,0,0,0,0,0,0,0] - emp = pooler.get_pool(self.cr.dbname).get('hr.employee') - emp_ids = form['employee_ids'] - empll = emp.browse(self.cr,self.uid, emp_ids) - cnt = 1 - for emp_id in empll: - ls1.append(emp_id.name) - tol = 0.0 - for mnth in self.mnths: - if mnth <> 'None': - if len(mnth) != 7: - mnth = '0' + str(mnth) - query = "select net from hr_payslip where employee_id = "+str(emp_id.id)+" and to_char(date,'mm-yyyy') like '%"+mnth+"%' and state = 'done' " - self.cr.execute(query) - sal = self.cr.fetchall() - if sal: - ls1.append(sal[0][0]) - tol += sal[0][0] - tol_mnths[cnt] = tol_mnths[cnt] + sal[0][0] - else: - ls1.append(0.00) - tol_mnths[cnt] = 0.0 - else: - ls1.append('') - tol_mnths[cnt] = '' - cnt = cnt + 1 - cnt = 1 - ls1.append(tol) - ls.append(ls1) - ls1 = [] - self.mnths_tol.append(tol_mnths) - return ls - - def get_months_tol(self): - return self.mnths_tol - - def get_total(self): - for item in self.mnths_tol: - for count in range(1,len(item)): - if item[count] == '': - continue - self.total += item[count] - return self.total - -report_sxw.report_sxw('report.year.salary', 'hr.payslip', 'hr_payroll/report/report_year_report.rml', parser=year_salary_report,header='internal landscape') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml index 90866d84cfa..5b86bacf693 100644 --- a/addons/hr_payroll/test/hr_payroll_report.yml +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -1,12 +1,5 @@ - In order to test the PDF reports defined on HR Payroll, we will print Employees' Salary Structure -- - !python {model: hr.employee}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-salary_structure.'+format), 'wb+').write(data) - - Print HR Payslip - @@ -14,28 +7,4 @@ import netsvc, tools, os (data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data) - -- - Print Employee Salary Statement through wizard -- - !python {model: hr.payslip}: | - import time - ctx={} - ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]}) - data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')} - from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_hr_payroll_employees_detail',wiz_data=data_dict, context=ctx, our_module='hr_payroll') - -- - Print Salary Register through wizard -- - !python {model: hr.payslip}: | - import time - ctx={} - ctx.update({'model': 'hr.payslip','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]}) - data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')} - from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_hr_payroll_year_salary',wiz_data=data_dict, context=ctx, our_module='hr_payroll') - - + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_payroll/test/payment_advice.yml b/addons/hr_payroll/test/payment_advice.yml deleted file mode 100644 index ef600670a48..00000000000 --- a/addons/hr_payroll/test/payment_advice.yml +++ /dev/null @@ -1,59 +0,0 @@ -- - I test the 'Payment Advice' in order to check the hr_payroll in OpenERP -- - I create a new employee “Richie” -- - !record {model: hr.employee, id: hr_employee_richie0}: - address_home_id: base.res_partner_address_1 - address_id: base.res_partner_address_9 - birthday: '1984-05-01' - children: 0.0 - contract_ids: - - advantages_gross: 0.0 - advantages_net: 0.0 - date_end: !eval "'%s-%s-%s' %(datetime.now().year+1,datetime.now().month,datetime.now().day)" - date_start: !eval time.strftime('%Y-%m-%d') - name: reference - wage: 5000.0 - wage_type_id: hr_contract.hr_contract_monthly_gross - type_id: hr_contract.hr_contract_type_emp - country_id: base.in - department_id: hr.dep_it - gender: male - marital: hr.hr_employee_marital_status_single - name: Richie - vehicle_distance: 0.0 -- - I create a new payment advice record -- - !record {model: hr.payroll.advice, id: hr_payroll_advice_advice0}: - line_ids: - - amount: 5500.0 - bysal: 5000.0 - employee_id: 'hr_employee_richie0' - flag: C - name: Axis Bank - name: advice1 -- - I confirmed the sheet by click on "Confirm Sheet" button. -- - !python {model: hr.payroll.advice}: | - self.confirm_sheet(cr, uid, [ref("hr_payroll_advice_advice0")], {"lang": "en_US", - "active_model": "ir.ui.menu", "active_ids": [ref("hr_payroll.hr_menu_payment_advice")], - "tz": False, "active_id": ref("hr_payroll.hr_menu_payment_advice")}) -- - I check that a state is "Confirm" -- - !python {model: hr.payroll.advice}: | - from tools.translate import _ - advice_id=self.browse(cr, uid, ref("hr_payroll_advice_advice0")) - assert(advice_id.state == 'confirm'), _('State not changed!') - -- - Print Payroll Advice -- - !python {model: hr.payroll.advice}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('hr_payroll_advice_advice0')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payroll-advice.'+format), 'wb+').write(data) diff --git a/addons/hr_payroll/test/payroll_register.yml b/addons/hr_payroll/test/payroll_register.yml deleted file mode 100644 index 41231e361db..00000000000 --- a/addons/hr_payroll/test/payroll_register.yml +++ /dev/null @@ -1,64 +0,0 @@ -- - I test the 'Payroll Register' in order to check the hr_payroll in OpenERP - I create a new employee “Keith” -- - !record {model: hr.employee, id: hr_employee_keith0}: - address_home_id: base.res_partner_address_3 - address_id: base.res_partner_address_9 - birthday: '1984-05-01' - children: 0.0 - contract_ids: - - advantages_gross: 0.0 - advantages_net: 0.0 - date_end: !eval "'%s-%s-%s' %(datetime.now().year+1,datetime.now().month,datetime.now().day)" - date_start: !eval time.strftime('%Y-%m-%d') - name: reference - wage: 5000.0 - wage_type_id: hr_contract.hr_contract_monthly_gross - type_id: hr_contract.hr_contract_type_emp - country_id: base.in - department_id: hr.dep_it - gender: male - marital: hr.hr_employee_marital_status_single - name: Keith - vehicle_distance: 0.0 -- - I create a payroll register record. -- - !record {model: hr.payroll.register, id: hr_payroll_register_payroll0}: - date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d')" - line_ids: - - employee_id: hr_payroll.hr_employee_keith0 - name: payroll1 -- - I click on Compute button. -- - !python {model: hr.payroll.register}: | - self.compute_sheet(cr, uid, [ref("hr_payroll_register_payroll0")], {"lang": "en_US", - "tz": False, "active_model": "ir.ui.menu", "department_id": False, "active_ids": - [ref("hr_payroll.hr_menu_payroll_register")], "section_id": False, "active_id": - ref("hr_payroll.hr_menu_payroll_register"), }) -- - Then I click on Verify Sheet button. -- - !python {model: hr.payroll.register}: | - self.verify_sheet(cr, uid, [ref("hr_payroll_register_payroll0")], {"lang": "en_US", - "tz": False, "active_model": "ir.ui.menu", "department_id": False, "active_ids": - [ref("hr_payroll.hr_menu_payroll_register")], "section_id": False, "active_id": - ref("hr_payroll.hr_menu_payroll_register"), }) -- - I check that a state has transferred from 'Wating for Verification' to 'Wating for HR Verification'state -- - !python {model: hr.payroll.register}: | - from tools.translate import _ - reg_brw=self.browse(cr, uid, ref("hr_payroll_register_payroll0")) - assert(reg_brw.state == 'hr_check'), _('State not changed!') - -- - Print HR Payroll Register -- - !python {model: hr.payroll.register}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.hr.payroll.register.sheet').create(cr, uid, [ref('hr_payroll_register_payroll0')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-register_report.'+format), 'wb+').write(data) diff --git a/addons/hr_payroll/wizard/__init__.py b/addons/hr_payroll/wizard/__init__.py index 73a1b7ceb9e..039c875ed98 100644 --- a/addons/hr_payroll/wizard/__init__.py +++ b/addons/hr_payroll/wizard/__init__.py @@ -20,10 +20,6 @@ # ############################################################################## - -import hr_payroll_employees_detail -#import hr_payroll_create_analytic -import hr_payroll_year_salary import hr_payroll_payslips_by_employees # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/wizard/hr_payroll_employees_detail.py b/addons/hr_payroll/wizard/hr_payroll_employees_detail.py deleted file mode 100644 index 2cb14a53f82..00000000000 --- a/addons/hr_payroll/wizard/hr_payroll_employees_detail.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time - -from osv import fields, osv - -class hr_payroll_employees_detail(osv.osv_memory): - - _name ='hr.payroll.employees.detail' - _columns = { - 'employee_ids': fields.many2many('hr.employee', 'payroll_emp_rel','payroll_id','emp_id', 'Employees',required=True), - 'date_from': fields.date('Start Date', required=True), - 'date_to': fields.date('End Date', required=True), - #'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True) - } -# def _get_fiscalyear(self, cr, uid, ids, context=None): -# if context is None: -# context = {} -# fiscal_ids = self.pool.get('account.fiscalyear').search(cr,uid,[], context=context) -# if fiscal_ids: -# return fiscal_ids[0] -# return False - - _defaults = { -# 'fiscalyear_id':_get_fiscalyear, - 'date_from': lambda *a: time.strftime('%Y-01-01'), - 'date_to': lambda *a: time.strftime('%Y-%m-%d'), - - } - - def print_report(self, cr, uid, ids, context=None): - """ - To get the date and print the report - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param context: A standard dictionary - @return: return report - """ - if context is None: - context = {} - datas = {'ids': context.get('active_ids', [])} - res = self.read(cr, uid, ids, ['employee_ids', 'date_from', 'date_to'], context=context) - res = res and res[0] or {} - datas['form'] = res - datas['ids'] = res.get('employee_ids',[]) - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'employees.salary', - 'datas': datas, - } - -hr_payroll_employees_detail() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/wizard/hr_payroll_employees_detail.xml b/addons/hr_payroll/wizard/hr_payroll_employees_detail.xml deleted file mode 100644 index e65278e1b94..00000000000 --- a/addons/hr_payroll/wizard/hr_payroll_employees_detail.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Employee Salary Statement - hr.payroll.employees.detail - form - -
- - - - - - - - - - -