Merge lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_hr_payroll into lp:openerp-costa-rica

Proposed by Glen Sojo on 2014-05-30
Status: Merged
Merged at revision: 285
Proposed branch: lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_hr_payroll
Merge into: lp:openerp-costa-rica
Diff against target: 400 lines (+113/-49)
8 files modified
l10n_cr_hr_payroll/i18n/es_CR.po (+7/-0)
l10n_cr_hr_payroll/i18n/l10n_cr_hr_payroll.pot (+7/-0)
l10n_cr_hr_payroll/report/payroll_report.mako (+26/-17)
l10n_cr_hr_payroll/report/payroll_report.py (+9/-0)
l10n_cr_hr_payroll/report/payroll_report_for_month.mako (+25/-16)
l10n_cr_hr_payroll/report/payroll_report_for_month.py (+9/-0)
l10n_cr_hr_payroll/report/report_employee_by_periods.mako (+22/-16)
l10n_cr_hr_payroll/report/report_employee_by_periods.py (+8/-0)
To merge this branch: bzr merge lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_hr_payroll
Reviewer Review Type Date Requested Status
ClearCorp drivers 2014-05-30 Pending
Review via email: mp+221589@code.launchpad.net

Description of the change

[ADD] - l10n_cr_hr_payroll: Added bonifications in payroll reports

To post a comment you must log in.
285. By Ronald Rubi on 2014-05-30

[MRG] - l10n_cr_hr_payroll: Added bonifications in payroll reports

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_cr_hr_payroll/i18n/es_CR.po'
2--- l10n_cr_hr_payroll/i18n/es_CR.po 2013-08-27 14:41:48 +0000
3+++ l10n_cr_hr_payroll/i18n/es_CR.po 2014-05-30 20:26:18 +0000
4@@ -16,6 +16,13 @@
5 "Plural-Forms: \n"
6
7 #. module: l10n_cr_hr_payroll
8+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:64
9+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:66
10+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:48
11+msgid "Bonuses"
12+msgstr "Bonificaciones"
13+
14+#. module: l10n_cr_hr_payroll
15 #: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:60
16 #: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:62
17 #: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:45
18
19=== modified file 'l10n_cr_hr_payroll/i18n/l10n_cr_hr_payroll.pot'
20--- l10n_cr_hr_payroll/i18n/l10n_cr_hr_payroll.pot 2012-04-26 21:16:29 +0000
21+++ l10n_cr_hr_payroll/i18n/l10n_cr_hr_payroll.pot 2014-05-30 20:26:18 +0000
22@@ -16,6 +16,13 @@
23 "Plural-Forms: \n"
24
25 #. module: l10n_cr_hr_payroll
26+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:64
27+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:66
28+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:48
29+msgid "Bonuses"
30+msgstr ""
31+
32+#. module: l10n_cr_hr_payroll
33 #: constraint:hr.contract:0
34 msgid "Error! contract start-date must be lower then contract end-date."
35 msgstr "¡Error! La fecha de inicio de contrato debe ser menor que la fecha de finalización."
36
37=== modified file 'l10n_cr_hr_payroll/report/payroll_report.mako'
38--- l10n_cr_hr_payroll/report/payroll_report.mako 2014-03-06 21:04:06 +0000
39+++ l10n_cr_hr_payroll/report/payroll_report.mako 2014-05-30 20:26:18 +0000
40@@ -22,6 +22,7 @@
41 total_basic = 0.0
42 total_rent = 0.0
43 total_ccss = 0.0
44+ total_bon = 0.0
45 total_net = 0.0
46 total_emp = 0
47 %>
48@@ -43,6 +44,7 @@
49 total_basic_dep = 0.0
50 total_rent_dep = 0.0
51 total_ccss_dep = 0.0
52+ total_bon_dep = 0.0
53 total_net_dep = 0.0
54 total_emp_dep = 0
55 %>
56@@ -53,14 +55,15 @@
57 <div class="table-cell" style="width:14%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Id card')}</div>
58 <div class="table-cell" style="width:17%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Name')}</div>
59 <div class="table-cell" style="width:13%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Bank account')}</div>
60- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Nor')}</div>
61- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Ext')}</div>
62- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Normal')}</div>
63- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Extra')}</div>
64- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Gross')}</div>
65- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
66- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Tax')}<br />${_('Rent')}</div>
67- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Net')}</div>
68+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Nor')}</div>
69+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Ext')}</div>
70+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Normal')}</div>
71+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Extra')}</div>
72+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Gross')}</div>
73+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
74+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Bonuses')}</div>
75+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Tax')}<br />${_('Rent')}</div>
76+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Net')}</div>
77 </div>
78 </div>
79
80@@ -85,6 +88,8 @@
81 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_gross(slip.line_ids)) or '0'}</div>
82 ## ccss
83 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_ccss(slip.line_ids)) or '0'}</div>
84+ ## bon
85+ <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_bon(slip.line_ids)) or '0'}</div>
86 ## RENT
87 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_rent(slip.line_ids)) or '0'}</div>
88 ## NET
89@@ -100,6 +105,7 @@
90 total_gross_dep += get_gross(slip.line_ids)
91 total_rent_dep += get_rent(slip.line_ids)
92 total_ccss_dep += get_ccss(slip.line_ids)
93+ total_bon_dep += get_bon(slip.line_ids)
94 total_net_dep += get_net(slip.line_ids)
95 total_emp_dep += 1
96
97@@ -113,6 +119,7 @@
98 total_gross += get_gross(slip.line_ids)
99 total_rent += get_rent(slip.line_ids)
100 total_ccss += get_ccss(slip.line_ids)
101+ total_bon += get_bon(slip.line_ids)
102 total_net += get_net(slip.line_ids)
103 total_emp += 1
104 %>
105@@ -130,26 +137,28 @@
106 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_ext_dep)}</div>
107 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_gross_dep)}</div>
108 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_ccss_dep)}</div>
109+ <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_bon_dep)}</div>
110 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_rent_dep)}</div>
111 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_net_dep)}</div>
112 </div>
113 </div>
114 </div>
115- %endfor
116+ %endfor
117 <div class="table list">
118 <div class="table-header">
119 <div class="table-row ${row_even and 'even' or 'odd'}">
120 <div class="table-cell" style="width:14%; text-align:left; border:silver 1px solid;">${_('TOTAL')}</div>
121 <div class="table-cell" style="width:17%; text-align:left; border:silver 1px solid;">${total_emp} ${_('Employees')}</div>
122 <div class="table-cell" style="width:13%; text-align:left; border:silver 1px solid;"> </div>
123- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${total_hn}</div>
124- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${total_he}</div>
125- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_basic)}</div>
126- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_ext)}</div>
127- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_gross)}</div>
128- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_ccss)}</div>
129- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_rent)}</div>
130- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_net)}</div>
131+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${total_hn}</div>
132+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${total_he}</div>
133+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_basic)}</div>
134+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_ext)}</div>
135+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_gross)}</div>
136+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_ccss)}</div>
137+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_bon)}</div>
138+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_rent)}</div>
139+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_net)}</div>
140 </div>
141 </div>
142 <div class="table-body">
143
144=== modified file 'l10n_cr_hr_payroll/report/payroll_report.py'
145--- l10n_cr_hr_payroll/report/payroll_report.py 2014-03-18 16:20:24 +0000
146+++ l10n_cr_hr_payroll/report/payroll_report.py 2014-05-30 20:26:18 +0000
147@@ -46,6 +46,7 @@
148 'get_RETM':self.get_RETM,
149 'get_RETS':self.get_RETS,
150 'get_retroactive':self.get_retroactive,
151+ 'get_bon': self.get_bon,
152 })
153
154 def get_prefix(self,currency,company_id):
155@@ -198,6 +199,14 @@
156 res = self.get_RETS(line_ids) + self.get_RETM(line_ids)
157 return res
158
159+ def get_bon(self,line_ids):
160+ code = 'BON'
161+ res = 0
162+ for line in line_ids:
163+ if line.code == code:
164+ res += line.total
165+ return res
166+
167 def get_obj_by_dep(self,run):
168 obj_by_dep = []
169 dep_list = []
170
171=== modified file 'l10n_cr_hr_payroll/report/payroll_report_for_month.mako'
172--- l10n_cr_hr_payroll/report/payroll_report_for_month.mako 2014-03-06 21:04:06 +0000
173+++ l10n_cr_hr_payroll/report/payroll_report_for_month.mako 2014-05-30 20:26:18 +0000
174@@ -30,6 +30,7 @@
175 total_basic = 0.0
176 total_rent = 0.0
177 total_ccss = 0.0
178+ total_bon = 0.0
179 total_net = 0.0
180 total_emp = 0
181 %>
182@@ -43,6 +44,7 @@
183 total_basic_struct = 0.0
184 total_rent_struct = 0.0
185 total_ccss_struct = 0.0
186+ total_bon_struct = 0.0
187 total_net_struct = 0.0
188 total_emp_struct = 0
189
190@@ -55,14 +57,15 @@
191 <div class="table-cell" style="width:14%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Id card')}</div>
192 <div class="table-cell" style="width:17%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Name')}</div>
193 <div class="table-cell" style="width:13%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Bank account')}</div>
194- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Nor')}</div>
195- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Ext')}</div>
196- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Normal')}</div>
197- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Extra')}</div>
198- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Gross')}</div>
199- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
200- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Tax')}<br />${_('Rent')}</div>
201- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Net')}</div>
202+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Nor')}</div>
203+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Ext')}</div>
204+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Normal')}</div>
205+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Extra')}</div>
206+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Gross')}</div>
207+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
208+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Bonuses')}</div>
209+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Tax')}<br />${_('Rent')}</div>
210+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Net')}</div>
211 </div>
212 </div>
213
214@@ -92,6 +95,8 @@
215 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_gross(cr, uid, payslips[1])) or '0'}</div>
216 ## ccss
217 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_ccss(cr, uid, payslips[1])) or '0'}</div>
218+ ## bon
219+ <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_bon(cr, uid, payslips[1])) or '0'}</div>
220 ## RENT
221 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_rent(cr, uid, payslips[1])) or '0'}</div>
222 ## NET
223@@ -105,6 +110,7 @@
224 total_gross_struct += get_gross(cr, uid, payslips[1])
225 total_rent_struct += get_rent(cr, uid, payslips[1])
226 total_ccss_struct += get_ccss(cr, uid, payslips[1])
227+ total_bon_struct += get_bon(cr, uid, payslips[1])
228 total_net_struct += get_net(cr, uid, payslips[1])
229 total_emp_struct += 1
230
231@@ -116,6 +122,7 @@
232 total_gross += get_gross(cr, uid, payslips[1])
233 total_rent += get_rent(cr, uid, payslips[1])
234 total_ccss += get_ccss(cr, uid, payslips[1])
235+ total_bon += get_bon(cr, uid, payslips[1])
236 total_net += get_net(cr, uid, payslips[1])
237 total_emp += 1
238 %>
239@@ -133,6 +140,7 @@
240 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_ext_struct)}</div>
241 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_gross_struct)}</div>
242 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_ccss_struct)}</div>
243+ <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_bon_struct)}</div>
244 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_rent_struct)}</div>
245 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(total_net_struct)}</div>
246 </div>
247@@ -145,14 +153,15 @@
248 <div class="table-cell" style="width:14%; text-align:left; border:silver 1px solid;">${_('TOTAL')}</div>
249 <div class="table-cell" style="width:17%; text-align:left; border:silver 1px solid;">${total_emp} ${_('Employees')}</div>
250 <div class="table-cell" style="width:13%; text-align:left; border:silver 1px solid;"> </div>
251- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${total_hn}</div>
252- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${total_he}</div>
253- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_basic)}</div>
254- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_ext)}</div>
255- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_gross)}</div>
256- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_ccss)}</div>
257- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_rent)}</div>
258- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_net)}</div>
259+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${total_hn}</div>
260+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${total_he}</div>
261+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_basic)}</div>
262+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_ext)}</div>
263+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_gross)}</div>
264+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_ccss)}</div>
265+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_bon)}</div>
266+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_rent)}</div>
267+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_net)}</div>
268 </div>
269 </div>
270 </div>
271
272=== modified file 'l10n_cr_hr_payroll/report/payroll_report_for_month.py'
273--- l10n_cr_hr_payroll/report/payroll_report_for_month.py 2014-03-18 16:20:24 +0000
274+++ l10n_cr_hr_payroll/report/payroll_report_for_month.py 2014-05-30 20:26:18 +0000
275@@ -44,6 +44,7 @@
276 'get_ext': self.get_ext,
277 'get_gross': self.get_gross,
278 'get_ccss': self.get_ccss,
279+ 'get_bon': self.get_bon,
280 'get_rent': self.get_rent,
281 'get_net': self.get_net,
282 'get_RETM':self.get_RETM,
283@@ -201,6 +202,14 @@
284 res += line.total
285 return res
286
287+ def get_bon(self, cr, uid, payslips):
288+ code = 'BON'
289+ res = 0.00
290+ for payslip in payslips:
291+ for line in payslip.line_ids:
292+ if line.code == code:
293+ res += line.total
294+ return res
295
296 def get_net(self, cr, uid, payslips):
297 code = 'NETO'
298
299=== modified file 'l10n_cr_hr_payroll/report/report_employee_by_periods.mako'
300--- l10n_cr_hr_payroll/report/report_employee_by_periods.mako 2014-03-06 21:04:06 +0000
301+++ l10n_cr_hr_payroll/report/report_employee_by_periods.mako 2014-05-30 20:26:18 +0000
302@@ -28,6 +28,7 @@
303 total_basic = 0.0
304 total_rent = 0.0
305 total_ccss = 0.0
306+ total_bon = 0.0
307 total_net = 0.0
308 total_emp = 0
309 %>
310@@ -38,14 +39,15 @@
311 <div class="table-cell" style="width:14%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Id card')}</div>
312 <div class="table-cell" style="width:17%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Name')}</div>
313 <div class="table-cell" style="width:13%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Bank account')}</div>
314- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Nor')}</div>
315- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Ext')}</div>
316- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Normal')}</div>
317- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Extra')}</div>
318- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Gross')}</div>
319- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
320- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Tax')}<br />${_('Rent')}</div>
321- <div class="table-cell" style="width:7%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Net')}</div>
322+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Nor')}</div>
323+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Hrs.')}<br />${_('Ext')}</div>
324+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Normal')}</div>
325+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Ingr.')}<br />${_('Extra')}</div>
326+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Gross')}</div>
327+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
328+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Bonuses')}</div>
329+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Tax')}<br />${_('Rent')}</div>
330+ <div class="table-cell" style="width:6.22%; background-color:silver; font-weight: bold; text-align:center; border:silver 1px solid;">${_('Salary')}<br />${_('Net')}</div>
331 </div>
332 </div>
333
334@@ -75,6 +77,8 @@
335 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_gross(cr, uid, payslip)) or '0'}</div>
336 ## ccss
337 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_ccss(cr, uid, payslip)) or '0'}</div>
338+ ## bon
339+ <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_bon(cr, uid, payslip)) or '0'}</div>
340 ## RENT
341 <div class="table-cell" style="text-align:left; border:silver 1px solid;">${formatLang(get_rent(cr, uid, payslip)) or '0'}</div>
342 ## NET
343@@ -89,6 +93,7 @@
344 total_gross += get_gross(cr, uid, payslip)
345 total_rent += get_rent(cr, uid, payslip)
346 total_ccss += get_ccss(cr, uid, payslip)
347+ total_bon += get_bon(cr, uid, payslip)
348 total_net += get_net(cr, uid, payslip)
349 %>
350 </div>
351@@ -101,14 +106,15 @@
352 <div class="table-cell" style="width:14%; text-align:left; border:silver 1px solid;">${_('TOTAL')}</div>
353 <div class="table-cell" style="width:17%; text-align:left; border:silver 1px solid;">${total_emp} ${_('Employees')}</div>
354 <div class="table-cell" style="width:13%; text-align:left; border:silver 1px solid;"> </div>
355- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${total_hn}</div>
356- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${total_he}</div>
357- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_basic)}</div>
358- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_ext)}</div>
359- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_gross)}</div>
360- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_ccss)}</div>
361- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_rent)}</div>
362- <div class="table-cell" style="width:7%; text-align:left; border:silver 1px solid;">${formatLang(total_net)}</div>
363+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${total_hn}</div>
364+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${total_he}</div>
365+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_basic)}</div>
366+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_ext)}</div>
367+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_gross)}</div>
368+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_ccss)}</div>
369+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_bon)}</div>
370+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_rent)}</div>
371+ <div class="table-cell" style="width:6.22%; text-align:left; border:silver 1px solid;">${formatLang(total_net)}</div>
372 </div>
373 </div>
374 </div>
375
376=== modified file 'l10n_cr_hr_payroll/report/report_employee_by_periods.py'
377--- l10n_cr_hr_payroll/report/report_employee_by_periods.py 2014-03-18 16:20:24 +0000
378+++ l10n_cr_hr_payroll/report/report_employee_by_periods.py 2014-05-30 20:26:18 +0000
379@@ -40,6 +40,7 @@
380 'get_ext': self.get_ext,
381 'get_gross': self.get_gross,
382 'get_ccss': self.get_ccss,
383+ 'get_bon': self.get_bon,
384 'get_rent': self.get_rent,
385 'get_net': self.get_net,
386 'get_RETM':self.get_RETM,
387@@ -128,6 +129,13 @@
388 res += line.total
389 return res
390
391+ def get_bon(self, cr, uid, payslip):
392+ code = 'BON'
393+ res = 0.00
394+ for line in payslip.line_ids:
395+ if line.code == code:
396+ res += line.total
397+ return res
398
399 def get_net(self, cr, uid, payslip):
400 code = 'NETO'

Subscribers

People subscribed via source and target branches

to all changes: