diff --git a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py index 26e51d3387b..57d7a492a97 100644 --- a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py +++ b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py @@ -104,8 +104,7 @@ hr_employee() class payroll_advice(osv.osv): ''' Bank Advice - ''' - + ''' _name = 'hr.payroll.advice' _description = 'Bank Advice' _columns = { @@ -120,6 +119,7 @@ class payroll_advice(osv.osv): 'number':fields.char('Number', size=16, readonly=True), 'line_ids':fields.one2many('hr.payroll.advice.line', 'advice_id', 'Employee Salary', states={'draft': [('readonly', False)]}, readonly=True), 'chaque_nos':fields.char('Cheque Numbers', size=256), + 'neft': fields.boolean('NEFT Transaction', help="Check this box if your company use online transfer for salary"), 'company_id':fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'bank_id':fields.many2one('res.bank', 'Bank', readonly=True, states={'draft': [('readonly', False)]}, help="Select the Bank from which the salary is going to be paid"), } @@ -206,8 +206,7 @@ class payroll_advice(osv.osv): res.update({'bank': company.partner_id.bank_ids[0].bank.name}) return { 'value':res - } - + } payroll_advice() class hr_payslip_run(osv.osv): @@ -255,16 +254,31 @@ hr_payslip_run() class payroll_advice_line(osv.osv): ''' Bank Advice Lines - ''' + ''' + def onchange_employee_id(self, cr, uid, ids, employee_id=False, context=None): + res = {} + hr_obj = self.pool.get('hr.employee') + if not employee_id: + return {'value': res} + employee = hr_obj.browse(cr, uid, [employee_id], context=context)[0] + res.update({'name': employee.bank_account_id.acc_number ,'ifsc_code': employee.bank_account_id.bank_bic}) + return {'value': res} + _name = 'hr.payroll.advice.line' _description = 'Bank Advice Lines' _columns = { 'advice_id': fields.many2one('hr.payroll.advice', 'Bank Advice'), 'name': fields.char('Bank Account No.', size=32, required=True), + 'ifsc_code': fields.char('IFSC Code', size=32), 'employee_id': fields.many2one('hr.employee', 'Employee', required=True), 'bysal': fields.float('By Salary', digits_compute=dp.get_precision('Payroll')), + 'debit_credit': fields.char('C/D', size=8, required=False), 'company_id': fields.related('advice_id', 'company_id', type='many2one', required=False, relation='res.company', string='Company', store=True), } + _defaults = { + 'debit_credit': 'C', + } + payroll_advice_line() diff --git a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml index aaa6ffc6943..84dc870e512 100644 --- a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml +++ b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml @@ -100,9 +100,11 @@ - + + + @@ -110,6 +112,8 @@ + + diff --git a/addons/l10n_in_hr_payroll/report/report_payroll_advice.py b/addons/l10n_in_hr_payroll/report/report_payroll_advice.py index 86bdfe01998..d4eeaf3d218 100644 --- a/addons/l10n_in_hr_payroll/report/report_payroll_advice.py +++ b/addons/l10n_in_hr_payroll/report/report_payroll_advice.py @@ -60,7 +60,7 @@ class payroll_advice_report(report_sxw.rml_parse): def get_bysal_total(self): return self.total_bysal - + def get_detail(self, line_ids): result = [] self.total_bysal = 0.00 @@ -69,7 +69,9 @@ class payroll_advice_report(report_sxw.rml_parse): res.update({ 'name': l.employee_id.name, 'acc_no': l.name, + 'ifsc_code': l.ifsc_code, 'bysal': l.bysal, + 'debit_credit': l.debit_credit, }) self.total_bysal += l.bysal result.append(res) @@ -77,4 +79,4 @@ class payroll_advice_report(report_sxw.rml_parse): report_sxw.report_sxw('report.payroll.advice', 'hr.payroll.advice', 'l10n_in_hr_payroll/report/report_payroll_advice.rml', parser=payroll_advice_report, header="external") -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in_hr_payroll/report/report_payroll_advice.rml b/addons/l10n_in_hr_payroll/report/report_payroll_advice.rml index 55014e3b1ee..123e856d780 100644 --- a/addons/l10n_in_hr_payroll/report/report_payroll_advice.rml +++ b/addons/l10n_in_hr_payroll/report/report_payroll_advice.rml @@ -33,6 +33,10 @@ + + + + @@ -45,6 +49,10 @@ + + + + @@ -57,6 +65,8 @@ + + @@ -71,10 +81,13 @@ - - - - + + + + + + + @@ -131,23 +144,24 @@ [[repeatIn(objects,'o')]] - + - - - - Payment Advice + [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] + - [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] + + + + To, The Manager @@ -183,7 +197,7 @@ - Payment Advice from [[ o.name ]] A/C no. [[ o.company_id.bank_ids and o.company_id.bank_ids[0].acc_number ]] form period [[ get_month(o.date)['from_name'] ]] to [[ get_month(o.date)['to_name'] ]] + Payment Advice from [[ o.name ]] A/C no. [[ o.company_id.bank_ids and o.company_id.bank_ids[0].acc_number ]] form period [[ get_month(o.date)['from_name'] ]] to [[ get_month(o.date)['to_name'] ]] @@ -197,7 +211,7 @@ - + [[ o.neft == True and removeParentNode('blockTable') ]] SI. No. @@ -211,31 +225,87 @@ By Salary + + C/D +
[[ repeatIn(get_detail(o.line_ids),'line') ]] - + [[ o.neft == True and removeParentNode('blockTable') ]] - - + + . - [[ line['name'] ]] + [[ line['name'] ]] [[ line['acc_no'] ]] - [[formatLang(line['bysal'])]] [[ (company.currency_id and company.currency_id.symbol) or '' ]] + [[formatLang(line['bysal'])]] [[ (company.currency_id and company.currency_id.symbol) or '' ]] + + + [[ line['debit_credit'] ]]
- + [[ o.neft != True and removeParentNode('blockTable') ]] + + + SI. No. + + + Name of the Employe + + + Bank Account No. + + + IFSC Code + + + By Salary + + + C/D + + + +
+ [[ repeatIn(get_detail(o.line_ids),'line') ]] + [[ o.neft !=True and removeParentNode('blockTable') ]] + + + + . + + + + + [[ line['name'] ]] + + + [[ line['acc_no'] ]] + + + [[ line['ifsc_code'] ]] + + + [[formatLang(line['bysal'])]] [[ (company.currency_id and company.currency_id.symbol) or '' ]] + + + [[ line['debit_credit'] ]] + + + +
+ @@ -254,6 +324,11 @@ [[ o.line_ids==[] and removeParentNode('para') ]][[ formatLang(get_bysal_total()) ]] [[ (company.currency_id and company.currency_id.symbol) or '' ]] + + + + + @@ -262,7 +337,7 @@ - Yours Sincerely + Yours Sincerely @@ -272,7 +347,7 @@ - For [[ company.name ]] + For [[ company.name ]] @@ -282,7 +357,7 @@ - + @@ -294,7 +369,7 @@ - + @@ -306,7 +381,7 @@ - Authorized Signature + Authorized Signature