Merge lp:~openerp-community/openerp-mexico-localization/6.1-hrpayroll into lp:openerp-mexico-localization/6.1
- 6.1-hrpayroll
- Merge into 6.1
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-community/openerp-mexico-localization/6.1-hrpayroll |
Merge into: | lp:openerp-mexico-localization/6.1 |
Diff against target: |
1668 lines (+1643/-0) 5 files modified
l10n_mx_hr_payroll/__init__.py (+27/-0) l10n_mx_hr_payroll/__openerp__.py (+53/-0) l10n_mx_hr_payroll/hr_payroll.py (+430/-0) l10n_mx_hr_payroll/hr_payroll_data.xml (+977/-0) l10n_mx_hr_payroll/hr_payroll_view.xml (+156/-0) |
To merge this branch: | bzr merge lp:~openerp-community/openerp-mexico-localization/6.1-hrpayroll |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OscarAlca (community) | Needs Fixing | ||
Nhomar - Vauxoo | Needs Fixing | ||
Review via email: mp+134393@code.launchpad.net |
Commit message
Description of the change
Bases minimas para l10n payroll
conceptos
- 208. By Nhomar - Vauxoo
-
[MERGE]
- 209. By Nhomar - Vauxoo
-
[CLEAN] print arreglados
- 210. By Nhomar - Vauxoo
-
[CLEAN] comments
- 211. By Nhomar - Vauxoo
-
[CLEAN] comments
Eduardo Vizcaino Granados (evigra) wrote : | # |
Aun los cambios no estan completos
sigo reparando
- 212. By Eduardo Vizcaino Granados
-
[FIX] Modifield field an amended rules
- 213. By Eduardo Vizcaino Granados
-
[FIX] Modifield field an amended rules
- 214. By Eduardo Vizcaino Granados
-
[FIX] Amended rules
- 215. By Eduardo Vizcaino Granados
-
UPDATE
- 216. By Eduardo Vizcaino Granados
-
UPDATE
- 217. By Eduardo Vizcaino Granados
-
UPDATE
- 218. By Eduardo Vizcaino Granados
-
UPDATE
- 219. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 220. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 221. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 222. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 223. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 224. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 225. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
OscarAlca (oscarolar) wrote : | # |
Aun quedan prints en algunos archivos, hay que quitarlos
- 226. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 227. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 228. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 229. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 230. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 231. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 232. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 233. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 234. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 235. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 236. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 237. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 238. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 239. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 240. By Eduardo Vizcaino Granados
-
[UPDATE] Rules and methods
- 241. By Eduardo Vizcaino Granados
-
[UPDATE] Rules and methods
- 242. By Eduardo Vizcaino Granados
-
[UPDATE] Rules and methods
Unmerged revisions
- 242. By Eduardo Vizcaino Granados
-
[UPDATE] Rules and methods
- 241. By Eduardo Vizcaino Granados
-
[UPDATE] Rules and methods
- 240. By Eduardo Vizcaino Granados
-
[UPDATE] Rules and methods
- 239. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 238. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 237. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 236. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 235. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 234. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
- 233. By Eduardo Vizcaino Granados
-
[UPDATE] Rules
Preview Diff
1 | === added directory 'l10n_mx_hr_payroll' | |||
2 | === added file 'l10n_mx_hr_payroll/__init__.py' | |||
3 | --- l10n_mx_hr_payroll/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ l10n_mx_hr_payroll/__init__.py 2012-12-04 15:42:21 +0000 | |||
5 | @@ -0,0 +1,27 @@ | |||
6 | 1 | # -*- encoding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). | ||
11 | 6 | # | ||
12 | 7 | # This program is free software: you can redistribute it and/or modify | ||
13 | 8 | # it under the terms of the GNU Affero General Public License as | ||
14 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
15 | 10 | # License, or (at your option) any later version. | ||
16 | 11 | # | ||
17 | 12 | # This program is distributed in the hope that it will be useful, | ||
18 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | 15 | # GNU Affero General Public License for more details. | ||
21 | 16 | # | ||
22 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
23 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
24 | 19 | # | ||
25 | 20 | ############################################################################## | ||
26 | 21 | |||
27 | 22 | |||
28 | 23 | import hr_payroll | ||
29 | 24 | |||
30 | 25 | |||
31 | 26 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
32 | 27 | |||
33 | 0 | 28 | ||
34 | === added file 'l10n_mx_hr_payroll/__openerp__.py' | |||
35 | --- l10n_mx_hr_payroll/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
36 | +++ l10n_mx_hr_payroll/__openerp__.py 2012-12-04 15:42:21 +0000 | |||
37 | @@ -0,0 +1,53 @@ | |||
38 | 1 | # -*- encoding: utf-8 -*- | ||
39 | 2 | ########################################################################### | ||
40 | 3 | # Module Writen to OpenERP, Open Source Management Solution | ||
41 | 4 | # | ||
42 | 5 | # Copyright (c) 2012 - Alce Consorsio Imobiliario | ||
43 | 6 | # All Rights Reserved. | ||
44 | 7 | ############################################################################ | ||
45 | 8 | # Coded by: EDUARDO VIZCAINO GRANADOS (evigra@hotmail.com) | ||
46 | 9 | ############################################################################ | ||
47 | 10 | # | ||
48 | 11 | # This program is free software: you can redistribute it and/or modify | ||
49 | 12 | # it under the terms of the GNU Affero General Public License as | ||
50 | 13 | # published by the Free Software Foundation, either version 3 of the | ||
51 | 14 | # License, or (at your option) any later version. | ||
52 | 15 | # | ||
53 | 16 | # This program is distributed in the hope that it will be useful, | ||
54 | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
55 | 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
56 | 19 | # GNU Affero General Public License for more details. | ||
57 | 20 | # | ||
58 | 21 | # You should have received a copy of the GNU Affero General Public License | ||
59 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
60 | 23 | # | ||
61 | 24 | ############################################################################## | ||
62 | 25 | { | ||
63 | 26 | "name" : "l10n_mx_hr_payroll", | ||
64 | 27 | "version": "0.1", | ||
65 | 28 | "author": "Alce Consorsio Inmobiliario", | ||
66 | 29 | "category" : "Localization/Mexico", | ||
67 | 30 | 'complexity': "easy", | ||
68 | 31 | "website": "", | ||
69 | 32 | "depends": [ | ||
70 | 33 | 'hr', | ||
71 | 34 | 'hr_payroll', | ||
72 | 35 | ], | ||
73 | 36 | "data": [ | ||
74 | 37 | 'hr_payroll_view.xml', | ||
75 | 38 | ], | ||
76 | 39 | 'update_xml': [ | ||
77 | 40 | 'hr_payroll_data.xml', | ||
78 | 41 | ], | ||
79 | 42 | "description": """l10n_mx_hr_payroll | ||
80 | 43 | ======================================= | ||
81 | 44 | Este modulo agrega las reglas de salario | ||
82 | 45 | para generar la nomina especifica de la | ||
83 | 46 | empresa Alce COnsorsio Inmobiliario | ||
84 | 47 | """, | ||
85 | 48 | "auto_install": False, | ||
86 | 49 | "installable": True, | ||
87 | 50 | } | ||
88 | 51 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
89 | 52 | |||
90 | 53 | |||
91 | 0 | 54 | ||
92 | === added file 'l10n_mx_hr_payroll/hr_payroll.py' | |||
93 | --- l10n_mx_hr_payroll/hr_payroll.py 1970-01-01 00:00:00 +0000 | |||
94 | +++ l10n_mx_hr_payroll/hr_payroll.py 2012-12-04 15:42:21 +0000 | |||
95 | @@ -0,0 +1,430 @@ | |||
96 | 1 | # -*- encoding: utf-8 -*- | ||
97 | 2 | ############################################################################## | ||
98 | 3 | # | ||
99 | 4 | # OpenERP, Open Source Management Solution | ||
100 | 5 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). | ||
101 | 6 | # | ||
102 | 7 | # This program is free software: you can redistribute it and/or modify | ||
103 | 8 | # it under the terms of the GNU Affero General Public License as | ||
104 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
105 | 10 | # License, or (at your option) any later version. | ||
106 | 11 | # | ||
107 | 12 | # This program is distributed in the hope that it will be useful, | ||
108 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
109 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
110 | 15 | # GNU Affero General Public License for more details. | ||
111 | 16 | # | ||
112 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
113 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
114 | 19 | # sudo easy_install python-dateutil | ||
115 | 20 | ############################################################################## | ||
116 | 21 | |||
117 | 22 | from osv import osv,fields | ||
118 | 23 | from datetime import * | ||
119 | 24 | import time, sys, subprocess,os | ||
120 | 25 | from dateutil.relativedelta import * | ||
121 | 26 | from dateutil.easter import * | ||
122 | 27 | from dateutil.rrule import * | ||
123 | 28 | from dateutil.parser import * | ||
124 | 29 | |||
125 | 30 | import netsvc | ||
126 | 31 | import tools | ||
127 | 32 | from tools.translate import _ | ||
128 | 33 | import decimal_precision as dp | ||
129 | 34 | |||
130 | 35 | from tools.safe_eval import safe_eval as eval | ||
131 | 36 | |||
132 | 37 | class hr_payslip_employees(osv.osv_memory): | ||
133 | 38 | |||
134 | 39 | _inherit ='hr.payslip.employees' | ||
135 | 40 | _description = 'Generate payslips for all selected employees' | ||
136 | 41 | |||
137 | 42 | def compute_sheet(self, cr, uid, ids, context=None): | ||
138 | 43 | print "WIZARD LALO" | ||
139 | 44 | emp_pool = self.pool.get('hr.employee') | ||
140 | 45 | slip_pool = self.pool.get('hr.payslip') | ||
141 | 46 | run_pool = self.pool.get('hr.payslip.run') | ||
142 | 47 | slip_ids = [] | ||
143 | 48 | if context is None: | ||
144 | 49 | context = {} | ||
145 | 50 | data = self.read(cr, uid, ids, context=context)[0] | ||
146 | 51 | run_data = {} | ||
147 | 52 | if context and context.get('active_id', False): | ||
148 | 53 | run_data = run_pool.read(cr, uid, context['active_id'], ['date_start', 'date_end', 'credit_note']) | ||
149 | 54 | from_date = run_data.get('date_start', False) | ||
150 | 55 | to_date = run_data.get('date_end', False) | ||
151 | 56 | credit_note = run_data.get('credit_note', False) | ||
152 | 57 | if not data['employee_ids']: | ||
153 | 58 | raise osv.except_osv(_("Warning !"), _("You must select employee(s) to generate payslip(s)")) | ||
154 | 59 | for emp in emp_pool.browse(cr, uid, data['employee_ids'], context=context): | ||
155 | 60 | |||
156 | 61 | |||
157 | 62 | dayp_from_date = datetime.strptime(from_date,"%Y-%m-%d") | ||
158 | 63 | day_from_date = dayp_from_date.strftime("%Y-%m-%d") | ||
159 | 64 | |||
160 | 65 | dayp_to_date = datetime.strptime(to_date,"%Y-%m-%d") | ||
161 | 66 | day_to_date = dayp_to_date.strftime("%Y-%m-%d") | ||
162 | 67 | |||
163 | 68 | |||
164 | 69 | # '&',('date_from','<=', day_from_date),('date_to','>=', day_from_date) | ||
165 | 70 | # '&',('date_from','<=', day_to_date),('date_to','>=', day_to_date) | ||
166 | 71 | |||
167 | 72 | # '|','&',('date_from','<=', day_from_date),('date_to','>=', day_from_date),'&',('date_from','<=', day_to_date),('date_to','>=', day_to_date) | ||
168 | 73 | # '&',('employee_id','=', emp.id),'|','&',('date_from','<=', day_from_date),('date_to','>=', day_from_date),'&',('date_from','<=', day_to_date),('date_to','>=', day_to_date) | ||
169 | 74 | |||
170 | 75 | payslip_ids = slip_pool.search(cr,uid,['&',('employee_id','=', emp.id),'|','&',('date_from','<=', day_from_date),('date_to','>=', day_from_date),'&',('date_from','<=', day_to_date),('date_to','>=', day_to_date)]) | ||
171 | 76 | |||
172 | 77 | print "IDS",payslip_ids | ||
173 | 78 | print "NAME=",emp.name,emp.id | ||
174 | 79 | print "DATE=",from_date, " DATE=",to_date | ||
175 | 80 | if len(payslip_ids)==0: | ||
176 | 81 | |||
177 | 82 | slip_data = slip_pool.onchange_employee_id(cr, uid, [], from_date, to_date, emp.id, contract_id=False, context=context) | ||
178 | 83 | for x in slip_data['value'].get('worked_days_line_ids', False): | ||
179 | 84 | print "X=====", x | ||
180 | 85 | res = { | ||
181 | 86 | 'employee_id': emp.id, | ||
182 | 87 | 'name': slip_data['value'].get('name', False), | ||
183 | 88 | 'struct_id': slip_data['value'].get('struct_id', False), | ||
184 | 89 | 'contract_id': slip_data['value'].get('contract_id', False), | ||
185 | 90 | 'payslip_run_id': context.get('active_id', False), | ||
186 | 91 | 'input_line_ids': [(0, 0, x) for x in slip_data['value'].get('input_line_ids', False)], | ||
187 | 92 | 'worked_days_line_ids': [(0, 0, x) for x in slip_data['value'].get('worked_days_line_ids', False)], | ||
188 | 93 | 'date_from': from_date, | ||
189 | 94 | 'date_to': to_date, | ||
190 | 95 | 'credit_note': credit_note, | ||
191 | 96 | } | ||
192 | 97 | slip_ids=[slip_pool.create(cr, uid, res, context=context)] | ||
193 | 98 | print "slip_ids=",slip_ids | ||
194 | 99 | slip_pool.compute_sheet(cr, uid, slip_ids, context=context) | ||
195 | 100 | return {'type': 'ir.actions.act_window_close'} | ||
196 | 101 | |||
197 | 102 | hr_payslip_employees() | ||
198 | 103 | |||
199 | 104 | |||
200 | 105 | class hr_payslip(osv.osv): | ||
201 | 106 | _inherit = 'hr.payslip' | ||
202 | 107 | def onchange_employee_id(self, cr, uid, ids, date_from, date_to, employee_id=False, contract_id=False, context=None): | ||
203 | 108 | empolyee_obj = self.pool.get('hr.employee') | ||
204 | 109 | contract_obj = self.pool.get('hr.contract') | ||
205 | 110 | worked_days_obj = self.pool.get('hr.payslip.worked_days') | ||
206 | 111 | input_obj = self.pool.get('hr.payslip.input') | ||
207 | 112 | |||
208 | 113 | if context is None: | ||
209 | 114 | context = {} | ||
210 | 115 | #delete old worked days lines | ||
211 | 116 | old_worked_days_ids = ids and worked_days_obj.search(cr, uid, [('payslip_id', '=', ids[0])], context=context) or False | ||
212 | 117 | if old_worked_days_ids: | ||
213 | 118 | worked_days_obj.unlink(cr, uid, old_worked_days_ids, context=context) | ||
214 | 119 | |||
215 | 120 | #delete old input lines | ||
216 | 121 | old_input_ids = ids and input_obj.search(cr, uid, [('payslip_id', '=', ids[0])], context=context) or False | ||
217 | 122 | if old_input_ids: | ||
218 | 123 | input_obj.unlink(cr, uid, old_input_ids, context=context) | ||
219 | 124 | |||
220 | 125 | |||
221 | 126 | #defaults | ||
222 | 127 | res = {'value':{ | ||
223 | 128 | 'line_ids':[], | ||
224 | 129 | 'input_line_ids': [], | ||
225 | 130 | 'worked_days_line_ids': [], | ||
226 | 131 | #'details_by_salary_head':[], TODO put me back | ||
227 | 132 | 'name':'', | ||
228 | 133 | 'contract_id': False, | ||
229 | 134 | 'struct_id': False, | ||
230 | 135 | } | ||
231 | 136 | } | ||
232 | 137 | if (not employee_id) or (not date_from) or (not date_to): | ||
233 | 138 | return res | ||
234 | 139 | ttyme = datetime.fromtimestamp(time.mktime(time.strptime(date_from, "%Y-%m-%d"))) | ||
235 | 140 | employee_id = empolyee_obj.browse(cr, uid, employee_id, context=context) | ||
236 | 141 | res['value'].update({ | ||
237 | 142 | 'name': _('Salary Slip of %s for %s') % (employee_id.name, tools.ustr(ttyme.strftime('%B-%Y'))), | ||
238 | 143 | 'company_id': employee_id.company_id.id | ||
239 | 144 | }) | ||
240 | 145 | |||
241 | 146 | if not context.get('contract', False): | ||
242 | 147 | #fill with the first contract of the employee | ||
243 | 148 | contract_ids = self.get_contract(cr, uid, employee_id, date_from, date_to, context=context) | ||
244 | 149 | res['value'].update({ | ||
245 | 150 | 'struct_id': contract_ids and contract_obj.read(cr, uid, contract_ids[0], ['struct_id'], context=context)['struct_id'][0] or False, | ||
246 | 151 | 'contract_id': contract_ids and contract_ids[0] or False, | ||
247 | 152 | }) | ||
248 | 153 | else: | ||
249 | 154 | if contract_id: | ||
250 | 155 | #set the list of contract for which the input have to be filled | ||
251 | 156 | contract_ids = [contract_id] | ||
252 | 157 | #fill the structure with the one on the selected contract | ||
253 | 158 | contract_record = contract_obj.browse(cr, uid, contract_id, context=context) | ||
254 | 159 | res['value'].update({ | ||
255 | 160 | 'struct_id': contract_record.struct_id.id, | ||
256 | 161 | 'contract_id': contract_id | ||
257 | 162 | }) | ||
258 | 163 | else: | ||
259 | 164 | #if we don't give the contract, then the input to fill should be for all current contracts of the employee | ||
260 | 165 | contract_ids = self.get_contract(cr, uid, employee_id, date_from, date_to, context=context) | ||
261 | 166 | if not contract_ids: | ||
262 | 167 | return res | ||
263 | 168 | |||
264 | 169 | #computation of the salary input | ||
265 | 170 | context['lang']="en_US" | ||
266 | 171 | worked_days_line_ids = self.get_worked_day_lines(cr, uid, contract_ids, date_from, date_to, context=context) | ||
267 | 172 | input_line_ids = self.get_inputs(cr, uid, contract_ids, date_from, date_to, context=context) | ||
268 | 173 | res['value'].update({ | ||
269 | 174 | 'worked_days_line_ids': worked_days_line_ids, | ||
270 | 175 | 'input_line_ids': input_line_ids, | ||
271 | 176 | }) | ||
272 | 177 | print "RES=", res | ||
273 | 178 | return res | ||
274 | 179 | |||
275 | 180 | |||
276 | 181 | def get_worked_day_lines(self, cr, uid, contract_ids, date_from, date_to, context=None): | ||
277 | 182 | def was_on_leave(employee_id, datetime_day, context=None): | ||
278 | 183 | res = False | ||
279 | 184 | day = datetime_day.strftime("%Y-%m-%d") | ||
280 | 185 | |||
281 | 186 | holiday_ids = self.pool.get('hr.holidays').search(cr, uid, [('state','=','validate'),('employee_id','=',employee_id),('type','=','remove'),('date_from','<=',day),('date_to','>=',day)]) | ||
282 | 187 | if holiday_ids: | ||
283 | 188 | res = self.pool.get('hr.holidays').browse(cr, uid, holiday_ids, context=context)[0].holiday_status_id.name | ||
284 | 189 | return res | ||
285 | 190 | |||
286 | 191 | res = [] | ||
287 | 192 | print "CONTEXT=========", context | ||
288 | 193 | |||
289 | 194 | for contract in self.pool.get('hr.contract').browse(cr, uid, contract_ids, context=context): | ||
290 | 195 | if not contract.working_hours: | ||
291 | 196 | #fill only if the contract as a working schedule linked | ||
292 | 197 | continue | ||
293 | 198 | attendances = { | ||
294 | 199 | 'name': _("Normal Working Days paid at 100%"), | ||
295 | 200 | 'sequence': 1, | ||
296 | 201 | 'code': 'WORK100', | ||
297 | 202 | 'number_of_days': 0.0, | ||
298 | 203 | 'number_of_hours': 0.0, | ||
299 | 204 | 'contract_id': contract.id, | ||
300 | 205 | } | ||
301 | 206 | leaves = {} | ||
302 | 207 | day_from = datetime.strptime(date_from,"%Y-%m-%d") | ||
303 | 208 | day_to = datetime.strptime(date_to,"%Y-%m-%d") | ||
304 | 209 | nb_of_days = (day_to - day_from).days + 1 | ||
305 | 210 | |||
306 | 211 | |||
307 | 212 | for day in range(0, nb_of_days): | ||
308 | 213 | working_hours_on_day = self.pool.get('resource.calendar').working_hours_on_day(cr, uid, contract.working_hours, day_from + timedelta(days=day), context) | ||
309 | 214 | print "DAY=",day, " HOURS=",contract.working_hours, " working_hours_on_day====", working_hours_on_day | ||
310 | 215 | if working_hours_on_day: | ||
311 | 216 | #the employee had to work | ||
312 | 217 | |||
313 | 218 | leave_type = was_on_leave(contract.employee_id.id, day_from + timedelta(days=day), context=context) | ||
314 | 219 | print "leave_type=",leave_type | ||
315 | 220 | if leave_type: | ||
316 | 221 | #if he was on leave, fill the leaves dict | ||
317 | 222 | if leave_type in leaves: | ||
318 | 223 | leaves[leave_type]['number_of_days'] += 1.0 | ||
319 | 224 | leaves[leave_type]['number_of_hours'] += working_hours_on_day | ||
320 | 225 | else: | ||
321 | 226 | code=leave_type.replace(" ","_").upper() | ||
322 | 227 | leaves[leave_type] = { | ||
323 | 228 | 'name': leave_type, | ||
324 | 229 | 'sequence': 5, | ||
325 | 230 | 'code': code, | ||
326 | 231 | 'number_of_days': 1.0, | ||
327 | 232 | 'number_of_hours': working_hours_on_day, | ||
328 | 233 | 'contract_id': contract.id, | ||
329 | 234 | } | ||
330 | 235 | else: | ||
331 | 236 | #add the input vals to tmp (increment if existing) | ||
332 | 237 | attendances['number_of_days'] += 1.0 | ||
333 | 238 | attendances['number_of_hours'] += working_hours_on_day | ||
334 | 239 | holidays_obj = self.pool.get('hr.holidays.status') | ||
335 | 240 | holidays_ids=holidays_obj.search(cr, uid, []) | ||
336 | 241 | for holiday in holidays_obj.browse(cr, uid, holidays_ids, context=context): | ||
337 | 242 | if holiday.name not in leaves: | ||
338 | 243 | code=holiday.name.replace(" ","_").upper() | ||
339 | 244 | leaves[holiday.name] = { | ||
340 | 245 | 'name': holiday.name, | ||
341 | 246 | 'sequence': 5, | ||
342 | 247 | 'code': code, | ||
343 | 248 | 'number_of_days': 0.0, | ||
344 | 249 | 'number_of_hours': 0, | ||
345 | 250 | 'contract_id': contract.id, | ||
346 | 251 | } | ||
347 | 252 | |||
348 | 253 | leaves = [value for key,value in leaves.items()] | ||
349 | 254 | res += [attendances] + leaves | ||
350 | 255 | return res | ||
351 | 256 | |||
352 | 257 | def compute_sheet(self, cr, uid, ids, context=None): | ||
353 | 258 | print "IDS===========", ids | ||
354 | 259 | slip_line_pool = self.pool.get('hr.payslip.line') | ||
355 | 260 | sequence_obj = self.pool.get('ir.sequence') | ||
356 | 261 | for payslip in self.browse(cr, uid, ids, context=context): | ||
357 | 262 | number = payslip.number or sequence_obj.get(cr, uid, 'salary.slip') | ||
358 | 263 | |||
359 | 264 | #delete old payslip lines | ||
360 | 265 | old_slipline_ids = slip_line_pool.search(cr, uid, [('slip_id', '=', payslip.id)], context=context) | ||
361 | 266 | # old_slipline_ids | ||
362 | 267 | |||
363 | 268 | if old_slipline_ids: | ||
364 | 269 | slip_line_pool.unlink(cr, uid, old_slipline_ids, context=context) | ||
365 | 270 | print "ANTES" | ||
366 | 271 | if payslip.contract_id: | ||
367 | 272 | #set the list of contract for which the rules have to be applied | ||
368 | 273 | contract_ids = [payslip.contract_id.id] | ||
369 | 274 | else: | ||
370 | 275 | |||
371 | 276 | #if we don't give the contract, then the rules to apply should be for all current contracts of the employee | ||
372 | 277 | contract_ids = self.get_contract(cr, uid, payslip.employee_id, payslip.date_from, payslip.date_to, context=context) | ||
373 | 278 | print "DESPUES" | ||
374 | 279 | lines = [(0,0,line) for line in self.pool.get('hr.payslip').get_payslip_lines(cr, uid, contract_ids, payslip.id, context=context)] | ||
375 | 280 | print "lines=",lines | ||
376 | 281 | self.write(cr, uid, [payslip.id], {'line_ids': lines, 'number': number,}, context=context) | ||
377 | 282 | return True | ||
378 | 283 | |||
379 | 284 | def get_inputs(self, cr, uid, contract_ids, date_from, date_to, context=None): | ||
380 | 285 | res = [] | ||
381 | 286 | contract_obj = self.pool.get('hr.contract') | ||
382 | 287 | concept_obj = self.pool.get('hr.contract.concept') | ||
383 | 288 | rule_obj = self.pool.get('hr.salary.rule') | ||
384 | 289 | |||
385 | 290 | structure_ids = contract_obj.get_all_structures(cr, uid, contract_ids, context=context) | ||
386 | 291 | rule_ids = self.pool.get('hr.payroll.structure').get_all_rules(cr, uid, structure_ids, context=context) | ||
387 | 292 | sorted_rule_ids = [id for id, sequence in sorted(rule_ids, key=lambda x:x[1])] | ||
388 | 293 | for contract in contract_obj.browse(cr, uid, contract_ids, context=context): | ||
389 | 294 | ########################### | ||
390 | 295 | today=datetime.today().date() | ||
391 | 296 | |||
392 | 297 | concept_id=concept_obj.search(cr, uid, [('contract_id','=',contract.id),('code','=','ANTIG')]) | ||
393 | 298 | inicio=datetime(int(str(contract.date_start)[:4]),int(str(contract.date_start)[5:7]),int(str(contract.date_start)[8:10])) | ||
394 | 299 | days=today - inicio.date() | ||
395 | 300 | str_days=str(days) | ||
396 | 301 | antiguedad = float(int(str_days.replace(str_days[-14:],"")))/365 | ||
397 | 302 | |||
398 | 303 | vals_contract={"amount":antiguedad} | ||
399 | 304 | concept_obj.write(cr, uid, concept_id, vals_contract) | ||
400 | 305 | |||
401 | 306 | inicio2= datetime(int(today.strftime("%Y")),01,01) | ||
402 | 307 | |||
403 | 308 | if inicio2 > inicio: | ||
404 | 309 | fecha=inicio2 | ||
405 | 310 | else: | ||
406 | 311 | fecha=inicio | ||
407 | 312 | |||
408 | 313 | concept_id=concept_obj.search(cr, uid, [('contract_id','=',contract.id),('code','=','DLANU')]) | ||
409 | 314 | days=today - fecha.date() | ||
410 | 315 | str_days=str(days) | ||
411 | 316 | DLANU = float(int(str_days.replace(str_days[-14:],"")))/365 | ||
412 | 317 | vals_contract={"amount":DLANU} | ||
413 | 318 | concept_obj.write(cr, uid, concept_id, vals_contract) | ||
414 | 319 | |||
415 | 320 | |||
416 | 321 | |||
417 | 322 | |||
418 | 323 | |||
419 | 324 | ########################### | ||
420 | 325 | for rule in rule_obj.browse(cr, uid, sorted_rule_ids, context=context): | ||
421 | 326 | if rule.input_ids: | ||
422 | 327 | for input in rule.input_ids: | ||
423 | 328 | inputs = { | ||
424 | 329 | 'name': input.name, | ||
425 | 330 | 'code': input.code, | ||
426 | 331 | 'amount': 0.0, | ||
427 | 332 | 'contract_id': contract.id, | ||
428 | 333 | } | ||
429 | 334 | res += [inputs] | ||
430 | 335 | return res | ||
431 | 336 | |||
432 | 337 | hr_payslip() | ||
433 | 338 | class hr_contract(osv.osv): | ||
434 | 339 | _inherit = 'hr.contract' | ||
435 | 340 | _columns = { | ||
436 | 341 | 'concept_ids': fields.one2many('hr.contract.concept','contract_id','Concept') | ||
437 | 342 | } | ||
438 | 343 | def create(self, cr, uid, vals, context=False): | ||
439 | 344 | ids=False | ||
440 | 345 | res=self.save(cr, uid, vals, ids) | ||
441 | 346 | return res | ||
442 | 347 | def write(self, cr, uid, ids, vals, context=None, update=True): | ||
443 | 348 | res=self.save(cr, uid, vals, ids) | ||
444 | 349 | return res | ||
445 | 350 | def save(self, cr, uid, vals, ids, context=False): | ||
446 | 351 | obj_concept = self.pool.get('hr.contract.concept') | ||
447 | 352 | if (type(ids) is list and len(ids)>0) or ids==False: | ||
448 | 353 | if(ids==0 or ids==False): | ||
449 | 354 | ids=[] | ||
450 | 355 | res = super(hr_contract, self).create(cr, uid, vals, context=context) | ||
451 | 356 | ids.append(res) | ||
452 | 357 | data_before = self.browse(cr, uid, ids)[0] | ||
453 | 358 | before_name = data_before.name | ||
454 | 359 | data = self.browse(cr, uid, ids)[0] | ||
455 | 360 | else: | ||
456 | 361 | data_before = self.browse(cr, uid, ids)[0] | ||
457 | 362 | res = super(hr_contract, self).write(cr, uid, ids, vals) | ||
458 | 363 | data = self.browse(cr, uid, ids)[0] | ||
459 | 364 | if len(data.concept_ids)==0: | ||
460 | 365 | vals_concept={"contract_id":ids[0],"code":"DAGUI", "name":"Dias de aguinaldo","description":"Son los dias otorgados por la empresa", "amount":15} | ||
461 | 366 | obj_concept.create(cr, uid, vals_concept, context=context) | ||
462 | 367 | vals_concept={"contract_id":ids[0],"code":"ANTIG", "name":"Antiguedad","description":"Son los años de servicio laborandos en este contrato", "amount":0} | ||
463 | 368 | obj_concept.create(cr, uid, vals_concept, context=context) | ||
464 | 369 | vals_concept={"contract_id":ids[0],"code":"CINFO", "name":"Prestamo Infonavit","description":"Es la retencion al empleado para el pago de su credito", "amount":0} | ||
465 | 370 | obj_concept.create(cr, uid, vals_concept, context=context) | ||
466 | 371 | vals_concept={"contract_id":ids[0],"code":"DLANU", "name":"Dias Laborados en el año","description":"Son los dias laborados durante el año, para determinar proporciones", "amount":0} | ||
467 | 372 | obj_concept.create(cr, uid, vals_concept, context=context) | ||
468 | 373 | |||
469 | 374 | return res | ||
470 | 375 | hr_contract() | ||
471 | 376 | |||
472 | 377 | class hr_payslip_run(osv.osv): | ||
473 | 378 | _inherit = 'hr.payslip.run' | ||
474 | 379 | _columns = { | ||
475 | 380 | 'date': fields.date('Date'), | ||
476 | 381 | 'type': fields.selection((('nor','Normal'), ('agu','Aguinaldo'), ('ptu','PTU')), 'Type'), | ||
477 | 382 | 'schedule_pay': fields.selection([ | ||
478 | 383 | ('monthly', 'Monthly'), | ||
479 | 384 | ('quarterly', 'Quarterly'), | ||
480 | 385 | ('semi-annually', 'Semi-annually'), | ||
481 | 386 | ('annually', 'Annually'), | ||
482 | 387 | ('weekly', 'Weekly'), | ||
483 | 388 | ('bi-weekly', 'Bi-weekly'), | ||
484 | 389 | ('bi-monthly', 'Bi-monthly'), | ||
485 | 390 | ], 'Scheduled Pay', select=True), | ||
486 | 391 | } | ||
487 | 392 | _defaults = { | ||
488 | 393 | 'type': 'nor', | ||
489 | 394 | } | ||
490 | 395 | hr_payslip_run() | ||
491 | 396 | """ | ||
492 | 397 | class hr_holidays_status(osv.osv): | ||
493 | 398 | _name = 'hr.holidays.status' | ||
494 | 399 | _columns = { | ||
495 | 400 | 'code': fields.char('Code', size=20, required=True, readonly=False), | ||
496 | 401 | } | ||
497 | 402 | hr_holidays_status() | ||
498 | 403 | """ | ||
499 | 404 | |||
500 | 405 | class hr_contract_concept(osv.osv): | ||
501 | 406 | _name = 'hr.contract.concept' | ||
502 | 407 | _columns = { | ||
503 | 408 | 'contract_id': fields.many2one('hr.contract', 'Contract',), | ||
504 | 409 | 'history_ids': fields.one2many('hr.concept.history','concept_id','History'), | ||
505 | 410 | 'name': fields.char('Concept', size=75, required=True, readonly=False), | ||
506 | 411 | 'code': fields.char('Code', size=20, required=True, readonly=False), | ||
507 | 412 | 'description': fields.char('Description', size=250, required=False, readonly=False), | ||
508 | 413 | 'concept_type': fields.selection((('rec','Recursive'), ('val','Value')), 'Amount Type'), | ||
509 | 414 | 'amount': fields.float('Amount'), | ||
510 | 415 | 'amount_type': fields.selection((('per','Percentage'), ('val','Value')), 'Amount Type'), | ||
511 | 416 | } | ||
512 | 417 | hr_contract_concept() | ||
513 | 418 | |||
514 | 419 | class hr_concept_history(osv.osv): | ||
515 | 420 | _name = 'hr.concept.history' | ||
516 | 421 | _columns = { | ||
517 | 422 | 'concept_id': fields.many2one('hr.contract.concept', 'Concept',), | ||
518 | 423 | 'date': fields.date('Date'), | ||
519 | 424 | 'amount_initial':fields.float('Amount Initial'), | ||
520 | 425 | 'amount_final':fields.float('Amount Final'), | ||
521 | 426 | 'amount':fields.float('Amount'), | ||
522 | 427 | } | ||
523 | 428 | hr_concept_history() | ||
524 | 429 | |||
525 | 430 | |||
526 | 0 | 431 | ||
527 | === added file 'l10n_mx_hr_payroll/hr_payroll_data.xml' | |||
528 | --- l10n_mx_hr_payroll/hr_payroll_data.xml 1970-01-01 00:00:00 +0000 | |||
529 | +++ l10n_mx_hr_payroll/hr_payroll_data.xml 2012-12-04 15:42:21 +0000 | |||
530 | @@ -0,0 +1,977 @@ | |||
531 | 1 | <?xml version="1.0"?> | ||
532 | 2 | <openerp> | ||
533 | 3 | <data> | ||
534 | 4 | <!-- ESTRUCTURA SALARIAL --> | ||
535 | 5 | <record id="nomina" model="hr.payroll.structure"> | ||
536 | 6 | <field name="name">Nomina</field> | ||
537 | 7 | <field name="code">NOM</field> | ||
538 | 8 | </record> | ||
539 | 9 | <!-- FIN ESTRUCTURA SALARIAL --> | ||
540 | 10 | |||
541 | 11 | <!-- CATEGORIAS --> | ||
542 | 12 | <record id="CAT_CONCEPTOS" model="hr.salary.rule.category"> | ||
543 | 13 | <field name="name">CONCEPTOS EMPLEADO</field> | ||
544 | 14 | <field name="code">CONCEP</field> | ||
545 | 15 | </record> | ||
546 | 16 | <record id="CAT_REGLAS" model="hr.salary.rule.category"> | ||
547 | 17 | <field name="name">REGLAS</field> | ||
548 | 18 | <field name="code">REGLAS</field> | ||
549 | 19 | </record> | ||
550 | 20 | |||
551 | 21 | <record id="CAT_CONFIGURACIONES" model="hr.salary.rule.category"> | ||
552 | 22 | <field name="name">CONFIGURACIONES</field> | ||
553 | 23 | <field name="code">CONFIGURACIONES</field> | ||
554 | 24 | </record> | ||
555 | 25 | <record id="CAT_PERCEPCIONES_G" model="hr.salary.rule.category"> | ||
556 | 26 | <field name="name">PRECEPCIONES GRAVADAS</field> | ||
557 | 27 | <field name="code">PGRAVA</field> | ||
558 | 28 | </record> | ||
559 | 29 | <record id="CAT_PERCEPCIONES_E" model="hr.salary.rule.category"> | ||
560 | 30 | <field name="name">PRECEPCIONES EXENTAS</field> | ||
561 | 31 | <field name="code">PEXENT</field> | ||
562 | 32 | </record> | ||
563 | 33 | <record id="CAT_PERCEPCIONES" model="hr.salary.rule.category"> | ||
564 | 34 | <field name="name">PERCEPCIONES</field> | ||
565 | 35 | <field name="code">PERCEPCIONES</field> | ||
566 | 36 | </record> | ||
567 | 37 | <record id="CAT_IMSS_G" model="hr.salary.rule.category"> | ||
568 | 38 | <field name="name">IMSS GRAVADO</field> | ||
569 | 39 | <field name="code">IGRAVA</field> | ||
570 | 40 | </record> | ||
571 | 41 | <record id="CAT_OBLIGACIONES" model="hr.salary.rule.category"> | ||
572 | 42 | <field name="name">IMSS EXENTO</field> | ||
573 | 43 | <field name="code">IEXENT</field> | ||
574 | 44 | </record> | ||
575 | 45 | <record id="CAT_IMSS" model="hr.salary.rule.category"> | ||
576 | 46 | <field name="name">IMSS</field> | ||
577 | 47 | <field name="code">IMSS</field> | ||
578 | 48 | </record> | ||
579 | 49 | |||
580 | 50 | <record id="CAT_DEDUCCIONES" model="hr.salary.rule.category"> | ||
581 | 51 | <field name="name">DEDUCCIONES</field> | ||
582 | 52 | <field name="code">DEDUCCIONES</field> | ||
583 | 53 | </record> | ||
584 | 54 | |||
585 | 55 | <record id="CAT_OBLIGACIONES" model="hr.salary.rule.category"> | ||
586 | 56 | <field name="name">OBLIGACIONES</field> | ||
587 | 57 | <field name="code">OBLIGACIONES</field> | ||
588 | 58 | </record> | ||
589 | 59 | <!-- FIN CATEGORIAS --> | ||
590 | 60 | |||
591 | 61 | |||
592 | 62 | <!-- REGLAS SALARIALES --> | ||
593 | 63 | <record id="REG10" model="hr.salary.rule"> | ||
594 | 64 | <field name="category_id" ref="CAT_CONFIGURACIONES"/> | ||
595 | 65 | <field name="appears_on_payslip" eval="False"/> | ||
596 | 66 | <field name="name">Vacaciones</field> | ||
597 | 67 | <field name="sequence">10</field> | ||
598 | 68 | <field name="code">VACACI</field> | ||
599 | 69 | <field name="condition_select">none</field> | ||
600 | 70 | <field name="amount_select">code</field> | ||
601 | 71 | <field name="amount_python_compute"><![CDATA[antiguedad=ANTIG | ||
602 | 72 | if antiguedad<2: | ||
603 | 73 | vac=6 | ||
604 | 74 | elif antiguedad<3: | ||
605 | 75 | vac=8 | ||
606 | 76 | elif antiguedad<4: | ||
607 | 77 | vac=10 | ||
608 | 78 | elif antiguedad<5: | ||
609 | 79 | vac=12 | ||
610 | 80 | elif antiguedad<10: | ||
611 | 81 | vac=14 | ||
612 | 82 | elif antiguedad<15: | ||
613 | 83 | vac=16 | ||
614 | 84 | elif antiguedad<20: | ||
615 | 85 | vac=18 | ||
616 | 86 | elif antiguedad<25: | ||
617 | 87 | vac=20 | ||
618 | 88 | elif antiguedad<30: | ||
619 | 89 | vac=22 | ||
620 | 90 | elif antiguedad<35: | ||
621 | 91 | vac=24 | ||
622 | 92 | result = vac]]></field> | ||
623 | 93 | </record> | ||
624 | 94 | |||
625 | 95 | |||
626 | 96 | <record id="REG12" model="hr.salary.rule"> | ||
627 | 97 | <field name="category_id" ref="CAT_CONFIGURACIONES"/> | ||
628 | 98 | <field name="name">Salario General Vigente al DF</field> | ||
629 | 99 | <field name="sequence">12</field> | ||
630 | 100 | <field name="code">SGVDF</field> | ||
631 | 101 | <field name="condition_select">none</field> | ||
632 | 102 | <field name="amount_select">code</field> | ||
633 | 103 | <field name="appears_on_payslip" eval="False"/> | ||
634 | 104 | <field name="amount_python_compute">result = 62.33</field> | ||
635 | 105 | </record> | ||
636 | 106 | |||
637 | 107 | |||
638 | 108 | <record id="REG14" model="hr.salary.rule"> | ||
639 | 109 | <field name="category_id" ref="CAT_CONFIGURACIONES"/> | ||
640 | 110 | <field name="name">Zona salarial del empleado</field> | ||
641 | 111 | <field name="sequence">14</field> | ||
642 | 112 | <field name="code">ZSALA</field> | ||
643 | 113 | <field name="condition_select">none</field> | ||
644 | 114 | <field name="amount_select">code</field> | ||
645 | 115 | <field name="appears_on_payslip" eval="False"/> | ||
646 | 116 | <field name="amount_python_compute">result = 59 </field> | ||
647 | 117 | </record> | ||
648 | 118 | |||
649 | 119 | |||
650 | 120 | |||
651 | 121 | <record id="REG9" model="hr.salary.rule"> | ||
652 | 122 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
653 | 123 | <field name="appears_on_payslip" eval="False"/> | ||
654 | 124 | <field name="name">Antiguedad (Años)</field> | ||
655 | 125 | <field name="sequence">9</field> | ||
656 | 126 | <field name="code">ANTIG</field> | ||
657 | 127 | <field name="condition_select">none</field> | ||
658 | 128 | <field name="amount_select">code</field> | ||
659 | 129 | <field name="amount_python_compute"><![CDATA[result=0 | ||
660 | 130 | for concept in contract.concept_ids: | ||
661 | 131 | if concept.code == 'ANTIG': | ||
662 | 132 | result=concept.amount]]></field> | ||
663 | 133 | </record> | ||
664 | 134 | |||
665 | 135 | <record id="REG18" model="hr.salary.rule"> | ||
666 | 136 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
667 | 137 | <field name="appears_on_payslip" eval="False"/> | ||
668 | 138 | <field name="name">Dias de Aguinaldo</field> | ||
669 | 139 | <field name="sequence">18</field> | ||
670 | 140 | <field name="code">DAGUI</field> | ||
671 | 141 | <field name="condition_select">none</field> | ||
672 | 142 | <field name="amount_select">code</field> | ||
673 | 143 | <field name="amount_python_compute"><![CDATA[monto = [c.amount for c in contract.concept_ids if c.code == 'DAGUI'] | ||
674 | 144 | result=monto and monto[0] or 0.0 ]]></field> | ||
675 | 145 | </record> | ||
676 | 146 | |||
677 | 147 | <record id="REG20" model="hr.salary.rule"> | ||
678 | 148 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
679 | 149 | <field name="appears_on_payslip" eval="False"/> | ||
680 | 150 | <field name="name">Salario Diario Integrado</field> | ||
681 | 151 | <field name="sequence">20</field> | ||
682 | 152 | <field name="code">SDI</field> | ||
683 | 153 | <field name="condition_select">none</field> | ||
684 | 154 | <field name="amount_select">code</field> | ||
685 | 155 | <field name="amount_python_compute"><![CDATA[antiguedad=ANTIG | ||
686 | 156 | aguinaldo=DAGUI | ||
687 | 157 | vac =VACACI | ||
688 | 158 | |||
689 | 159 | factor=(vac*.25+aguinaldo)/365+1 | ||
690 | 160 | result = factor * contract.wage]]></field> | ||
691 | 161 | </record> | ||
692 | 162 | <record id="REG21" model="hr.salary.rule"> | ||
693 | 163 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
694 | 164 | <field name="appears_on_payslip" eval="False"/> | ||
695 | 165 | <field name="name">Vacaciones Disfrutadas</field> | ||
696 | 166 | <field name="sequence">20</field> | ||
697 | 167 | <field name="code">VDISFR</field> | ||
698 | 168 | <field name="condition_select">none</field> | ||
699 | 169 | <field name="amount_select">code</field> | ||
700 | 170 | <field name="amount_python_compute"><![CDATA[monto = [c.amount for c in contract.concept_ids if c.code == 'DAGUI'] | ||
701 | 171 | result=monto and monto[0] or 0.0 ]]></field> | ||
702 | 172 | </record> | ||
703 | 173 | |||
704 | 174 | |||
705 | 175 | |||
706 | 176 | |||
707 | 177 | |||
708 | 178 | |||
709 | 179 | |||
710 | 180 | |||
711 | 181 | |||
712 | 182 | |||
713 | 183 | <record id="REG40" model="hr.salary.rule"> | ||
714 | 184 | <field name="category_id" ref="CAT_REGLAS"/> | ||
715 | 185 | <field name="name">PAGO DE AGUINALDO</field> | ||
716 | 186 | <field name="sequence">16</field> | ||
717 | 187 | <field name="code">PAGUI</field> | ||
718 | 188 | <field name="condition_select">python</field> | ||
719 | 189 | <field name="condition_python"><![CDATA[result=0 | ||
720 | 190 | if payslip.payslip_run_id=='agu': | ||
721 | 191 | result=1]]></field> | ||
722 | 192 | <field name="amount_select">code</field> | ||
723 | 193 | <field name="amount_python_compute">result= 1</field> | ||
724 | 194 | |||
725 | 195 | </record> | ||
726 | 196 | |||
727 | 197 | |||
728 | 198 | |||
729 | 199 | |||
730 | 200 | |||
731 | 201 | |||
732 | 202 | |||
733 | 203 | |||
734 | 204 | |||
735 | 205 | |||
736 | 206 | |||
737 | 207 | <!-- ######################################### --> | ||
738 | 208 | <record id="REG100" model="hr.salary.rule"> | ||
739 | 209 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
740 | 210 | <field name="appears_on_payslip" eval="False"/> | ||
741 | 211 | <field name="name">Sueldo (ISR Gravado)</field> | ||
742 | 212 | <field name="sequence">100</field> | ||
743 | 213 | <field name="code">S_ISG</field> | ||
744 | 214 | <field name="condition_select">none</field> | ||
745 | 215 | <field name="amount_select">code</field> | ||
746 | 216 | <field name="amount_python_compute">result = contract.wage * worked_days.WORK100.number_of_days</field> | ||
747 | 217 | </record> | ||
748 | 218 | <record id="REG101" model="hr.salary.rule"> | ||
749 | 219 | <field name="category_id" ref="CAT_IMSS_G"/> | ||
750 | 220 | <field name="appears_on_payslip" eval="False"/> | ||
751 | 221 | <field name="name">Sueldo (IMSS Gravado)</field> | ||
752 | 222 | <field name="sequence">101</field> | ||
753 | 223 | <field name="code">S_IMG</field> | ||
754 | 224 | <field name="condition_select">none</field> | ||
755 | 225 | <field name="amount_select">code</field> | ||
756 | 226 | <field name="amount_python_compute">result = S_ISG</field> | ||
757 | 227 | </record> | ||
758 | 228 | <record id="RE102" model="hr.salary.rule"> | ||
759 | 229 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
760 | 230 | <field name="name">Sueldo</field> | ||
761 | 231 | <field name="sequence">102</field> | ||
762 | 232 | <field name="code">SUELD</field> | ||
763 | 233 | <field name="condition_select">none</field> | ||
764 | 234 | <field name="amount_select">code</field> | ||
765 | 235 | <field name="amount_python_compute">result = S_ISG</field> | ||
766 | 236 | </record> | ||
767 | 237 | |||
768 | 238 | |||
769 | 239 | <!-- | ||
770 | 240 | <record id="REG51-1" model="hr.structure.salary.rule.rel"> | ||
771 | 241 | <field name="struct_id" ref="nomina"/> | ||
772 | 242 | <field name="rule_id" ref="REG51"/> | ||
773 | 243 | </record> | ||
774 | 244 | |||
775 | 245 | <record id="ACCION" model="hr.rule.input"> | ||
776 | 246 | <field name="name">Codigo de accion</field> | ||
777 | 247 | <field name="code">CODE</field> | ||
778 | 248 | <field name="input_id" ref="REG51"/> | ||
779 | 249 | </record> | ||
780 | 250 | <record id="MONTO" model="hr.rule.input"> | ||
781 | 251 | <field name="name">Monto de accion</field> | ||
782 | 252 | <field name="code">AMOUNT</field> | ||
783 | 253 | <field name="input_id" ref="REG51"/> | ||
784 | 254 | </record> | ||
785 | 255 | --> | ||
786 | 256 | |||
787 | 257 | <!-- ######################################### --> | ||
788 | 258 | <record id="REG110" model="hr.salary.rule"> | ||
789 | 259 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
790 | 260 | <field name="appears_on_payslip" eval="False"/> | ||
791 | 261 | <field name="name">Septimo Dia (ISR Gravado)</field> | ||
792 | 262 | <field name="sequence">110</field> | ||
793 | 263 | <field name="code">SD_ISG</field> | ||
794 | 264 | <field name="condition_select">none</field> | ||
795 | 265 | <field name="amount_select">code</field> | ||
796 | 266 | <field name="amount_python_compute">result = contract.wage * worked_days.WORK100.number_of_days / 6</field> | ||
797 | 267 | </record> | ||
798 | 268 | <record id="REG111" model="hr.salary.rule"> | ||
799 | 269 | <field name="category_id" ref="CAT_IMSS_G"/> | ||
800 | 270 | <field name="name">Septimo Dia (IMSS Gravado)</field> | ||
801 | 271 | <field name="appears_on_payslip" eval="False"/> | ||
802 | 272 | <field name="sequence">111</field> | ||
803 | 273 | <field name="code">SD_IMG</field> | ||
804 | 274 | <field name="condition_select">none</field> | ||
805 | 275 | <field name="amount_select">code</field> | ||
806 | 276 | <field name="amount_python_compute">result = SD_ISG</field> | ||
807 | 277 | </record> | ||
808 | 278 | <record id="REG112" model="hr.salary.rule"> | ||
809 | 279 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
810 | 280 | <field name="name">Septimo Dia</field> | ||
811 | 281 | <field name="sequence">112</field> | ||
812 | 282 | <field name="code">SDIA</field> | ||
813 | 283 | <field name="condition_select">none</field> | ||
814 | 284 | <field name="amount_select">code</field> | ||
815 | 285 | <field name="amount_python_compute">result = SD_ISG</field> | ||
816 | 286 | </record> | ||
817 | 287 | |||
818 | 288 | <!-- ######################################### --> | ||
819 | 289 | <record id="REG120" model="hr.salary.rule"> | ||
820 | 290 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
821 | 291 | <field name="appears_on_payslip" eval="False"/> | ||
822 | 292 | <field name="name">Bono de Asistencia (ISR Gravado)</field> | ||
823 | 293 | <field name="sequence">120</field> | ||
824 | 294 | <field name="code">BA_ISG</field> | ||
825 | 295 | <field name="condition_select">none</field> | ||
826 | 296 | <field name="amount_select">code</field> | ||
827 | 297 | <field name="amount_python_compute">result = 0.10 * contract.wage * worked_days.WORK100.number_of_days * 7 /6</field> | ||
828 | 298 | </record> | ||
829 | 299 | <record id="REG121" model="hr.salary.rule"> | ||
830 | 300 | <field name="category_id" ref="CAT_IMSS_G"/> | ||
831 | 301 | <field name="appears_on_payslip" eval="False"/> | ||
832 | 302 | <field name="name">Bono de Asistencia (IMSS Gravado)</field> | ||
833 | 303 | <field name="sequence">121</field> | ||
834 | 304 | <field name="code">BA_IMG</field> | ||
835 | 305 | <field name="condition_select">none</field> | ||
836 | 306 | <field name="amount_select">code</field> | ||
837 | 307 | <field name="amount_python_compute">result = BA_ISG</field> | ||
838 | 308 | </record> | ||
839 | 309 | <record id="REG122" model="hr.salary.rule"> | ||
840 | 310 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
841 | 311 | <field name="name">Bono de Asistencia</field> | ||
842 | 312 | <field name="sequence">122</field> | ||
843 | 313 | <field name="code">BA</field> | ||
844 | 314 | <field name="condition_select">none</field> | ||
845 | 315 | <field name="amount_select">code</field> | ||
846 | 316 | <field name="amount_python_compute">result = BA_ISG</field> | ||
847 | 317 | </record> | ||
848 | 318 | |||
849 | 319 | <!-- ######################################### --> | ||
850 | 320 | <record id="REG130" model="hr.salary.rule"> | ||
851 | 321 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
852 | 322 | <field name="appears_on_payslip" eval="False"/> | ||
853 | 323 | <field name="name">Bono de Puntualidad (ISR Gravado)</field> | ||
854 | 324 | <field name="sequence">130</field> | ||
855 | 325 | <field name="code">BP_ISG</field> | ||
856 | 326 | <field name="condition_select">none</field> | ||
857 | 327 | <field name="amount_select">code</field> | ||
858 | 328 | <field name="amount_python_compute">result = 0.10 * contract.wage * worked_days.WORK100.number_of_days * 7 /6</field> | ||
859 | 329 | </record> | ||
860 | 330 | <record id="REG131" model="hr.salary.rule"> | ||
861 | 331 | <field name="category_id" ref="CAT_IMSS_G"/> | ||
862 | 332 | <field name="name">Bono de Puntualidad (IMSS Gravado)</field> | ||
863 | 333 | <field name="appears_on_payslip" eval="False"/> | ||
864 | 334 | <field name="sequence">131</field> | ||
865 | 335 | <field name="code">BP_IMG</field> | ||
866 | 336 | <field name="condition_select">none</field> | ||
867 | 337 | <field name="amount_select">code</field> | ||
868 | 338 | <field name="amount_python_compute">result = BP_ISG</field> | ||
869 | 339 | </record> | ||
870 | 340 | <record id="REG132" model="hr.salary.rule"> | ||
871 | 341 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
872 | 342 | <field name="name">Bono de Puntualidad</field> | ||
873 | 343 | <field name="sequence">132</field> | ||
874 | 344 | <field name="code">SD</field> | ||
875 | 345 | <field name="condition_select">none</field> | ||
876 | 346 | <field name="amount_select">code</field> | ||
877 | 347 | <field name="amount_python_compute">result = BA_ISG</field> | ||
878 | 348 | </record> | ||
879 | 349 | |||
880 | 350 | |||
881 | 351 | <!-- ######################################### --> | ||
882 | 352 | <record id="REG140" model="hr.salary.rule"> | ||
883 | 353 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
884 | 354 | <field name="name">Despensa (ISR Gravado)</field> | ||
885 | 355 | <field name="appears_on_payslip" eval="False"/> | ||
886 | 356 | <field name="sequence">140</field> | ||
887 | 357 | <field name="code">D_ISG</field> | ||
888 | 358 | <field name="condition_select">none</field> | ||
889 | 359 | <field name="amount_select">code</field> | ||
890 | 360 | <field name="amount_python_compute">result = SGVDF * 0.4 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
891 | 361 | </record> | ||
892 | 362 | <record id="REG141" model="hr.salary.rule"> | ||
893 | 363 | <field name="category_id" ref="CAT_IMSS_G"/> | ||
894 | 364 | <field name="name">Despensa (IMSS Gravado)</field> | ||
895 | 365 | <field name="appears_on_payslip" eval="False"/> | ||
896 | 366 | <field name="sequence">141</field> | ||
897 | 367 | <field name="code">D_IMG</field> | ||
898 | 368 | <field name="condition_select">none</field> | ||
899 | 369 | <field name="amount_select">code</field> | ||
900 | 370 | <field name="amount_python_compute">result = D_ISG</field> | ||
901 | 371 | </record> | ||
902 | 372 | <record id="REG142" model="hr.salary.rule"> | ||
903 | 373 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
904 | 374 | <field name="name">Despensa</field> | ||
905 | 375 | <field name="sequence">142</field> | ||
906 | 376 | <field name="code">D</field> | ||
907 | 377 | <field name="condition_select">none</field> | ||
908 | 378 | <field name="amount_select">code</field> | ||
909 | 379 | <field name="amount_python_compute">result = D_ISG</field> | ||
910 | 380 | </record> | ||
911 | 381 | |||
912 | 382 | |||
913 | 383 | <!-- ######################################### --> | ||
914 | 384 | <record id="REG150" model="hr.salary.rule"> | ||
915 | 385 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
916 | 386 | <field name="name">Aguinaldo (ISR Gravado)</field> | ||
917 | 387 | <field name="appears_on_payslip" eval="False"/> | ||
918 | 388 | <field name="sequence">150</field> | ||
919 | 389 | <field name="code">A_ISG</field> | ||
920 | 390 | <field name="condition_select">python</field> | ||
921 | 391 | <field name="condition_python"><![CDATA[antiguedad=ANTIG | ||
922 | 392 | aguinaldo=DAGUI | ||
923 | 393 | if antiguedad>1: | ||
924 | 394 | proporcional=1 | ||
925 | 395 | else: | ||
926 | 396 | proporcional=antiguedad | ||
927 | 397 | |||
928 | 398 | monto_aguinaldo = proporcional * aguinaldo * contract.wage | ||
929 | 399 | |||
930 | 400 | result=0 | ||
931 | 401 | if payslip.payslip_run_id.type=='agu' and monto_aguinaldo - 30 * ZSALA>0: | ||
932 | 402 | result=1]]></field> | ||
933 | 403 | <field name="amount_select">code</field> | ||
934 | 404 | <field name="amount_python_compute"><![CDATA[antiguedad=ANTIG | ||
935 | 405 | aguinaldo=DAGUI | ||
936 | 406 | if antiguedad>1: | ||
937 | 407 | proporcional=1 | ||
938 | 408 | else: | ||
939 | 409 | proporcional=antiguedad | ||
940 | 410 | monto_aguinaldo = proporcional * aguinaldo * contract.wage | ||
941 | 411 | result= monto_aguinaldo - 30 * ZSALA]]></field> | ||
942 | 412 | </record> | ||
943 | 413 | |||
944 | 414 | <record id="REG151" model="hr.salary.rule"> | ||
945 | 415 | <field name="category_id" ref="CAT_PERCEPCIONES_E"/> | ||
946 | 416 | <field name="name">Aguinaldo (ISR Exento)</field> | ||
947 | 417 | <field name="appears_on_payslip" eval="False"/> | ||
948 | 418 | <field name="sequence">151</field> | ||
949 | 419 | <field name="code">A_ISE</field> | ||
950 | 420 | <field name="condition_select">python</field> | ||
951 | 421 | |||
952 | 422 | <field name="condition_python"><![CDATA[result=0 | ||
953 | 423 | if payslip.payslip_run_id.type=='agu': | ||
954 | 424 | result=1]]></field> | ||
955 | 425 | |||
956 | 426 | <field name="amount_select">code</field> | ||
957 | 427 | <field name="amount_python_compute"><![CDATA[antiguedad=ANTIG | ||
958 | 428 | aguinaldo=DAGUI | ||
959 | 429 | if antiguedad>1: | ||
960 | 430 | proporcional=1 | ||
961 | 431 | else: | ||
962 | 432 | proporcional=antiguedad | ||
963 | 433 | result = proporcional * aguinaldo * contract.wage | ||
964 | 434 | if result> 30 * ZSALA and PAGUI>0: | ||
965 | 435 | result= monto_aguinaldo - 30 * ZSALA]]></field> | ||
966 | 436 | </record> | ||
967 | 437 | |||
968 | 438 | |||
969 | 439 | <record id="REG152" model="hr.salary.rule"> | ||
970 | 440 | <field name="category_id" ref="CAT_IMSS_G"/> | ||
971 | 441 | <field name="name">Aguinaldo (IMSS Gravado)</field> | ||
972 | 442 | <field name="appears_on_payslip" eval="False"/> | ||
973 | 443 | <field name="sequence">152</field> | ||
974 | 444 | <field name="code">A_IMG</field> | ||
975 | 445 | <field name="condition_select">python</field> | ||
976 | 446 | <field name="condition_python"><![CDATA[antiguedad=ANTIG | ||
977 | 447 | aguinaldo=DAGUI | ||
978 | 448 | if antiguedad>1: | ||
979 | 449 | proporcional=1 | ||
980 | 450 | else: | ||
981 | 451 | proporcional=antiguedad | ||
982 | 452 | monto_aguinaldo = proporcional * aguinaldo * contract.wage | ||
983 | 453 | |||
984 | 454 | result=0 | ||
985 | 455 | if payslip.payslip_run_id.type=='agu' and monto_aguinaldo - 30 * ZSALA>0: | ||
986 | 456 | result=1]]></field> | ||
987 | 457 | <field name="amount_select">code</field> | ||
988 | 458 | <field name="amount_python_compute"><![CDATA[antiguedad=ANTIG | ||
989 | 459 | aguinaldo=DAGUI | ||
990 | 460 | if antiguedad>1: | ||
991 | 461 | proporcional=1 | ||
992 | 462 | else: | ||
993 | 463 | proporcional=antiguedad | ||
994 | 464 | monto_aguinaldo = proporcional * aguinaldo * contract.wage | ||
995 | 465 | result= monto_aguinaldo - 30 * ZSALA]]></field> | ||
996 | 466 | </record> | ||
997 | 467 | <record id="REG153" model="hr.salary.rule"> | ||
998 | 468 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
999 | 469 | <field name="name">Aguinaldo</field> | ||
1000 | 470 | <field name="sequence">153</field> | ||
1001 | 471 | <field name="code">A</field> | ||
1002 | 472 | <field name="condition_select">python</field> | ||
1003 | 473 | <field name="condition_python"><![CDATA[result=0 | ||
1004 | 474 | if payslip.payslip_run_id.type=='agu': | ||
1005 | 475 | result=1]]></field> | ||
1006 | 476 | <field name="amount_select">code</field> | ||
1007 | 477 | <field name="amount_python_compute"><![CDATA[antiguedad=ANTIG | ||
1008 | 478 | aguinaldo=DAGUI | ||
1009 | 479 | if antiguedad>1: | ||
1010 | 480 | proporcional=1 | ||
1011 | 481 | else: | ||
1012 | 482 | proporcional=antiguedad | ||
1013 | 483 | result = proporcional * aguinaldo * contract.wage]]></field> | ||
1014 | 484 | </record> | ||
1015 | 485 | |||
1016 | 486 | <record id="REG154" model="hr.salary.rule"> | ||
1017 | 487 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
1018 | 488 | <field name="name">Vacaciones (ISR Gravado)</field> | ||
1019 | 489 | <field name="appears_on_payslip" eval="False"/> | ||
1020 | 490 | <field name="sequence">154</field> | ||
1021 | 491 | <field name="code">V_ISG</field> | ||
1022 | 492 | <field name="condition_select">python</field> | ||
1023 | 493 | <field name="condition_python"><![CDATA[result=worked_days.LEGAL_LEAVES.number_of_days>0]]></field> | ||
1024 | 494 | <field name="amount_select">code</field> | ||
1025 | 495 | <field name="amount_python_compute">result = contract.wage * worked_days.LEGAL_LEAVES.number_of_days </field> | ||
1026 | 496 | </record> | ||
1027 | 497 | |||
1028 | 498 | <record id="REG155" model="hr.salary.rule"> | ||
1029 | 499 | <field name="category_id" ref="CAT_PERCEPCIONES_E"/> | ||
1030 | 500 | <field name="name">Vacaciones (ISR Exento)</field> | ||
1031 | 501 | <field name="appears_on_payslip" eval="False"/> | ||
1032 | 502 | <field name="sequence">155</field> | ||
1033 | 503 | <field name="code">V_ISE</field> | ||
1034 | 504 | <field name="condition_select">python</field> | ||
1035 | 505 | <field name="condition_python"><![CDATA[result=worked_days.LEGAL_LEAVES.number_of_days>0]]></field> | ||
1036 | 506 | <field name="amount_select">code</field> | ||
1037 | 507 | <field name="amount_python_compute">result = 0</field> | ||
1038 | 508 | </record> | ||
1039 | 509 | |||
1040 | 510 | <record id="REG156" model="hr.salary.rule"> | ||
1041 | 511 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
1042 | 512 | <field name="name">Vacaciones</field> | ||
1043 | 513 | <field name="sequence">155</field> | ||
1044 | 514 | <field name="code">VPAGAD</field> | ||
1045 | 515 | <field name="condition_select">python</field> | ||
1046 | 516 | <field name="condition_python"><![CDATA[result=worked_days.LEGAL_LEAVES.number_of_days>0]]></field> | ||
1047 | 517 | <field name="amount_select">code</field> | ||
1048 | 518 | <field name="amount_python_compute">result = contract.wage * worked_days.LEGAL_LEAVES.number_of_days </field> | ||
1049 | 519 | </record> | ||
1050 | 520 | |||
1051 | 521 | |||
1052 | 522 | |||
1053 | 523 | <record id="REG157" model="hr.salary.rule"> | ||
1054 | 524 | <field name="category_id" ref="CAT_PERCEPCIONES_G"/> | ||
1055 | 525 | <field name="name">Prima Vacacional (ISR Gravado)</field> | ||
1056 | 526 | <field name="appears_on_payslip" eval="False"/> | ||
1057 | 527 | <field name="sequence">157</field> | ||
1058 | 528 | <field name="code">PV_ISG</field> | ||
1059 | 529 | <field name="condition_select">python</field> | ||
1060 | 530 | <field name="condition_python"><![CDATA[result=worked_days.LEGAL_LEAVES.number_of_days>0]]></field> | ||
1061 | 531 | <field name="amount_select">code</field> | ||
1062 | 532 | <field name="amount_python_compute">result = contract.wage * worked_days.LEGAL_LEAVES.number_of_days * 0.25</field> | ||
1063 | 533 | </record> | ||
1064 | 534 | |||
1065 | 535 | <record id="REG158" model="hr.salary.rule"> | ||
1066 | 536 | <field name="category_id" ref="CAT_PERCEPCIONES_E"/> | ||
1067 | 537 | <field name="name">Prima Vacacional (ISR Exento)</field> | ||
1068 | 538 | <field name="appears_on_payslip" eval="False"/> | ||
1069 | 539 | <field name="sequence">158</field> | ||
1070 | 540 | <field name="code">PV_ISE</field> | ||
1071 | 541 | <field name="condition_select">python</field> | ||
1072 | 542 | <field name="condition_python"><![CDATA[result=worked_days.LEGAL_LEAVES.number_of_days>0]]></field> | ||
1073 | 543 | <field name="amount_select">code</field> | ||
1074 | 544 | <field name="amount_python_compute">result = 0</field> | ||
1075 | 545 | </record> | ||
1076 | 546 | <record id="REG159" model="hr.salary.rule"> | ||
1077 | 547 | <field name="category_id" ref="CAT_PERCEPCIONES"/> | ||
1078 | 548 | <field name="name">Prima Vacacional</field> | ||
1079 | 549 | <field name="sequence">158</field> | ||
1080 | 550 | <field name="code">PRIVAC</field> | ||
1081 | 551 | <field name="condition_select">python</field> | ||
1082 | 552 | <field name="condition_python"><![CDATA[result=worked_days.LEGAL_LEAVES.number_of_days>0]]></field> | ||
1083 | 553 | <field name="amount_select">code</field> | ||
1084 | 554 | <field name="amount_python_compute">result = contract.wage * worked_days.LEGAL_LEAVES.number_of_days * 0.25</field> | ||
1085 | 555 | </record> | ||
1086 | 556 | |||
1087 | 557 | |||
1088 | 558 | <record id="REG160" model="hr.salary.rule"> | ||
1089 | 559 | <field name="category_id" ref="CAT_PERCEPCIONES_E"/> | ||
1090 | 560 | <field name="name">Incapacidad (por riesgo de trabajo)</field> | ||
1091 | 561 | <field name="sequence">160</field> | ||
1092 | 562 | <field name="code">I_RT</field> | ||
1093 | 563 | <field name="condition_select">python</field> | ||
1094 | 564 | <field name="condition_python"><![CDATA[result=worked_days.OCCUPATIONAL_RISK_LEAVES.number_of_days>0]]></field> | ||
1095 | 565 | <field name="amount_select">code</field> | ||
1096 | 566 | <field name="amount_python_compute">result = 0</field> | ||
1097 | 567 | </record> | ||
1098 | 568 | <record id="REG161" model="hr.salary.rule"> | ||
1099 | 569 | <field name="category_id" ref="CAT_PERCEPCIONES_E"/> | ||
1100 | 570 | <field name="name">Incapacidad (por enfermedad general)</field> | ||
1101 | 571 | <field name="sequence">161</field> | ||
1102 | 572 | <field name="code">I_EG</field> | ||
1103 | 573 | <field name="condition_select">python</field> | ||
1104 | 574 | <field name="condition_python"><![CDATA[result=worked_days.GENERAL_DISEASE_LEAVES.number_of_days>0]]></field> | ||
1105 | 575 | <field name="amount_select">code</field> | ||
1106 | 576 | <field name="amount_python_compute">result = worked_days.GENERAL_DISEASE_LEAVES.number_of_days * contract.wage * 0.4</field> | ||
1107 | 577 | </record> | ||
1108 | 578 | |||
1109 | 579 | |||
1110 | 580 | <record id="REG162" model="hr.salary.rule"> | ||
1111 | 581 | <field name="category_id" ref="CAT_PERCEPCIONES_E"/> | ||
1112 | 582 | <field name="name">Incapacidad (por embarazo y maternidad)</field> | ||
1113 | 583 | <field name="sequence">162</field> | ||
1114 | 584 | <field name="code">I_EM</field> | ||
1115 | 585 | <field name="condition_select">python</field> | ||
1116 | 586 | <field name="condition_python"><![CDATA[result=worked_days.PREGNANCY_LEAVES.number_of_days>0]]></field> | ||
1117 | 587 | <field name="amount_select">code</field> | ||
1118 | 588 | <field name="amount_python_compute">result = 0</field> | ||
1119 | 589 | </record> | ||
1120 | 590 | |||
1121 | 591 | |||
1122 | 592 | |||
1123 | 593 | <!-- | ||
1124 | 594 | <record id="REG160" model="hr.salary.rule"> | ||
1125 | 595 | <field name="category_id" ref="hr_payroll.PEXENT"/> | ||
1126 | 596 | <field name="name">FINIQUITO Vacaciones </field> | ||
1127 | 597 | <field name="sequence">160</field> | ||
1128 | 598 | <field name="code">FAGUI</field> | ||
1129 | 599 | <field name="condition_select">python</field> | ||
1130 | 600 | <field name="condition_python">result = PAGUI</field> | ||
1131 | 601 | <field name="amount_select">code</field> | ||
1132 | 602 | <field name="amount_python_compute"><![CDATA[ | ||
1133 | 603 | antiguedad=ANTIG | ||
1134 | 604 | result = contract.wage * 20 * antiguedad | ||
1135 | 605 | |||
1136 | 606 | ]]></field> | ||
1137 | 607 | </record> | ||
1138 | 608 | --> | ||
1139 | 609 | |||
1140 | 610 | |||
1141 | 611 | <record id="REG190" model="hr.salary.rule"> | ||
1142 | 612 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
1143 | 613 | <field name="appears_on_payslip" eval="False"/> | ||
1144 | 614 | <field name="name">PERCEPCIONES EXENTAS</field> | ||
1145 | 615 | <field name="sequence">190</field> | ||
1146 | 616 | <field name="code">PEXENT</field> | ||
1147 | 617 | <field name="condition_select">none</field> | ||
1148 | 618 | <field name="amount_select">code</field> | ||
1149 | 619 | <field name="amount_python_compute">result = categories.PEXENT</field> | ||
1150 | 620 | </record> | ||
1151 | 621 | <record id="REG191" model="hr.salary.rule"> | ||
1152 | 622 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
1153 | 623 | <field name="appears_on_payslip" eval="False"/> | ||
1154 | 624 | <field name="name">PERCEPCIONES GRAVADAS</field> | ||
1155 | 625 | <field name="sequence">191</field> | ||
1156 | 626 | <field name="code">PGRAVA</field> | ||
1157 | 627 | <field name="condition_select">none</field> | ||
1158 | 628 | <field name="amount_select">code</field> | ||
1159 | 629 | <field name="amount_python_compute">result = categories.PGRAVA</field> | ||
1160 | 630 | </record> | ||
1161 | 631 | <record id="REG195" model="hr.salary.rule"> | ||
1162 | 632 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
1163 | 633 | <field name="name">PERCEPCIONES</field> | ||
1164 | 634 | <field name="sequence">195</field> | ||
1165 | 635 | <field name="code">PERCEPCIONES</field> | ||
1166 | 636 | <field name="condition_select">none</field> | ||
1167 | 637 | <field name="amount_select">code</field> | ||
1168 | 638 | <field name="amount_python_compute">result = categories.PERCEPCIONES</field> | ||
1169 | 639 | </record> | ||
1170 | 640 | |||
1171 | 641 | <record id="REG199" model="hr.salary.rule"> | ||
1172 | 642 | <field name="category_id" ref="CAT_CONFIGURACIONES"/> | ||
1173 | 643 | <field name="appears_on_payslip" eval="False"/> | ||
1174 | 644 | <field name="name">ISPT</field> | ||
1175 | 645 | <field name="sequence">199</field> | ||
1176 | 646 | <field name="code">ISPT</field> | ||
1177 | 647 | <field name="condition_select">none</field> | ||
1178 | 648 | <field name="amount_select">code</field> | ||
1179 | 649 | <field name="amount_python_compute"><![CDATA[LI_aux = 0.01 | ||
1180 | 650 | LS_aux = 114.24 | ||
1181 | 651 | if categories.PGRAVA>LI_aux and categories.PGRAVA<LS_aux: | ||
1182 | 652 | LI = LI_aux | ||
1183 | 653 | CF = 0 | ||
1184 | 654 | Ex = 0.0192 | ||
1185 | 655 | |||
1186 | 656 | LI_aux = LS_aux + 0.01 | ||
1187 | 657 | LS_aux = 969.50 | ||
1188 | 658 | if categories.PGRAVA>LI_aux and categories.PGRAVA<LS_aux: | ||
1189 | 659 | LI = LI_aux | ||
1190 | 660 | CF = 2.17 | ||
1191 | 661 | Ex = 0.064 | ||
1192 | 662 | |||
1193 | 663 | LI_aux = LS_aux + 0.01 | ||
1194 | 664 | LS_aux = 1703.80 | ||
1195 | 665 | if categories.PGRAVA>LI_aux and categories.PGRAVA<LS_aux: | ||
1196 | 666 | LI = LI_aux | ||
1197 | 667 | CF = 56.91 | ||
1198 | 668 | Ex = 0.1088 | ||
1199 | 669 | |||
1200 | 670 | LI_aux = LS_aux + 0.01 | ||
1201 | 671 | LS_aux = 1980.58 | ||
1202 | 672 | if categories.PGRAVA>LI_aux and categories.PGRAVA<LS_aux: | ||
1203 | 673 | LI = LI_aux | ||
1204 | 674 | CF = 136.85 | ||
1205 | 675 | Ex = 0.16 | ||
1206 | 676 | |||
1207 | 677 | LI_aux = LS_aux + 0.01 | ||
1208 | 678 | LS_aux = 2371.32 | ||
1209 | 679 | if categories.PGRAVA>LI_aux and categories.PGRAVA<LS_aux: | ||
1210 | 680 | LI = LI_aux | ||
1211 | 681 | CF = 181.06 | ||
1212 | 682 | Ex = 0.1792 | ||
1213 | 683 | |||
1214 | 684 | LI_aux = LS_aux + 0.01 | ||
1215 | 685 | LS_aux = 4782.61 | ||
1216 | 686 | if categories.PGRAVA>LI_aux and categories.PGRAVA<LS_aux: | ||
1217 | 687 | LI = LI_aux | ||
1218 | 688 | CF = 251.16 | ||
1219 | 689 | Ex = 0.2136 | ||
1220 | 690 | |||
1221 | 691 | LI_aux = LS_aux + 0.01 | ||
1222 | 692 | LS_aux = 7538.09 | ||
1223 | 693 | if categories.PGRAVA>LI_aux and categories.PGRAVA<LS_aux: | ||
1224 | 694 | LI = LI_aux | ||
1225 | 695 | CF = 766.15 | ||
1226 | 696 | Ex = 0.2352 | ||
1227 | 697 | |||
1228 | 698 | LI_aux = LS_aux + 0.01 | ||
1229 | 699 | if categories.PGRAVA>LI_aux: | ||
1230 | 700 | LI = LI_aux | ||
1231 | 701 | CF = 1414.28 | ||
1232 | 702 | Ex = 0.30 | ||
1233 | 703 | result = ((categories.PGRAVA - LI) * Ex + CF)]]></field> | ||
1234 | 704 | </record> | ||
1235 | 705 | |||
1236 | 706 | <!-- ######################################### --> | ||
1237 | 707 | <!-- ######################################### --> | ||
1238 | 708 | <!-- ######################################### --> | ||
1239 | 709 | |||
1240 | 710 | <record id="REG200" model="hr.salary.rule"> | ||
1241 | 711 | <field name="category_id" ref="CAT_CONFIGURACIONES"/> | ||
1242 | 712 | <field name="name">Subsidio al Empleo acreditado</field> | ||
1243 | 713 | <field name="sequence">200</field> | ||
1244 | 714 | <field name="code">SEA</field> | ||
1245 | 715 | <field name="condition_select">none</field> | ||
1246 | 716 | <field name="amount_select">code</field> | ||
1247 | 717 | <field name="amount_python_compute"><![CDATA[if categories.PGRAVA>0.01 and categories.PGRAVA<407.33: | ||
1248 | 718 | result = 93.73 | ||
1249 | 719 | if categories.PGRAVA>407.34 and categories.PGRAVA<610.96: | ||
1250 | 720 | result = 93.66 | ||
1251 | 721 | if categories.PGRAVA>610.97 and categories.PGRAVA<799.68: | ||
1252 | 722 | result = 93.66 | ||
1253 | 723 | if categories.PGRAVA>799.69 and categories.PGRAVA<814.66: | ||
1254 | 724 | result = 90.44 | ||
1255 | 725 | if categories.PGRAVA>814.67 and categories.PGRAVA<1023.75: | ||
1256 | 726 | result = 88.06 | ||
1257 | 727 | if categories.PGRAVA>1023.76 and categories.PGRAVA<1086.16: | ||
1258 | 728 | result = 81.55 | ||
1259 | 729 | if categories.PGRAVA>1086.20 and categories.PGRAVA<1228.57: | ||
1260 | 730 | result = 74.83 | ||
1261 | 731 | if categories.PGRAVA>1228.58 and categories.PGRAVA<1433.32: | ||
1262 | 732 | result = 67.83 | ||
1263 | 733 | if categories.PGRAVA>1433.33 and categories.PGRAVA<1638.07: | ||
1264 | 734 | result = 58.38 | ||
1265 | 735 | if categories.PGRAVA>1638.08 and categories.PGRAVA<1699.88: | ||
1266 | 736 | result = 50.12 | ||
1267 | 737 | if categories.PGRAVA>1699.89: | ||
1268 | 738 | result = 0 | ||
1269 | 739 | result=result*-1]]></field> | ||
1270 | 740 | </record> | ||
1271 | 741 | |||
1272 | 742 | <record id="REG202" model="hr.salary.rule"> | ||
1273 | 743 | <field name="category_id" ref="CAT_DEDUCCIONES"/> | ||
1274 | 744 | <field name="name">Subsidio al empleo (sp) </field> | ||
1275 | 745 | <field name="sequence">202</field> | ||
1276 | 746 | <field name="code">SESP</field> | ||
1277 | 747 | <field name="condition_select">python</field> | ||
1278 | 748 | <field name="condition_python">result = -ISPT > SEA</field> | ||
1279 | 749 | <field name="amount_select">code</field> | ||
1280 | 750 | <field name="amount_python_compute">result =SEA + ISPT</field> | ||
1281 | 751 | </record> | ||
1282 | 752 | |||
1283 | 753 | <record id="REG204" model="hr.salary.rule"> | ||
1284 | 754 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
1285 | 755 | <field name="name">ISPT antes de Sub al Empleo</field> | ||
1286 | 756 | <field name="sequence">204</field> | ||
1287 | 757 | <field name="code">ISPT_SE</field> | ||
1288 | 758 | <field name="condition_select">none</field> | ||
1289 | 759 | <field name="amount_select">code</field> | ||
1290 | 760 | <field name="amount_python_compute">result =ISPT</field> | ||
1291 | 761 | </record> | ||
1292 | 762 | |||
1293 | 763 | <record id="REG206" model="hr.salary.rule"> | ||
1294 | 764 | <field name="category_id" ref="CAT_DEDUCCIONES"/> | ||
1295 | 765 | <field name="name">ISPT (sp)</field> | ||
1296 | 766 | <field name="sequence">206</field> | ||
1297 | 767 | <field name="code">ISPT_SP</field> | ||
1298 | 768 | <field name="condition_select">python</field> | ||
1299 | 769 | <field name="condition_python">result = SEA> - ISPT </field> | ||
1300 | 770 | <field name="amount_select">code</field> | ||
1301 | 771 | <field name="amount_python_compute">result =SEA + ISPT_SE</field> | ||
1302 | 772 | </record> | ||
1303 | 773 | |||
1304 | 774 | <record id="REG207" model="hr.salary.rule"> | ||
1305 | 775 | <field name="category_id" ref="CAT_DEDUCCIONES"/> | ||
1306 | 776 | <field name="name">Prestamo Infonavit</field> | ||
1307 | 777 | <field name="sequence">207</field> | ||
1308 | 778 | <field name="code">CINFO_T</field> | ||
1309 | 779 | <field name="condition_select">python</field> | ||
1310 | 780 | <field name="condition_python"><![CDATA[monto = [c.amount for c in contract.concept_ids if c.code == 'CINFO'] | ||
1311 | 781 | prestamo=monto and monto[0] or 0.0 | ||
1312 | 782 | if prestamo>0: | ||
1313 | 783 | result = 1]]></field> | ||
1314 | 784 | <field name="amount_python_compute"><![CDATA[monto = [c.amount for c in contract.concept_ids if c.code == 'CINFO'] | ||
1315 | 785 | retencion=monto and monto[0] or 0.0 | ||
1316 | 786 | result = retencion]]></field> | ||
1317 | 787 | </record> | ||
1318 | 788 | |||
1319 | 789 | <record id="REG250" model="hr.salary.rule"> | ||
1320 | 790 | <field name="category_id" ref="CAT_IMSS"/> | ||
1321 | 791 | <field name="name">Prestaciones en especie</field> | ||
1322 | 792 | <field name="sequence">250</field> | ||
1323 | 793 | <field name="code">PE_T</field> | ||
1324 | 794 | <field name="condition_select">python</field> | ||
1325 | 795 | <field name="condition_python">result = SDI>3 * SGVDF </field> | ||
1326 | 796 | <field name="amount_select">code</field> | ||
1327 | 797 | <field name="amount_python_compute">result =((SDI * worked_days.WORK100.number_of_days * 7 /6)-(3 * SGVDF))*0.004</field> | ||
1328 | 798 | </record> | ||
1329 | 799 | |||
1330 | 800 | <record id="REG251" model="hr.salary.rule"> | ||
1331 | 801 | <field name="category_id" ref="CAT_IMSS"/> | ||
1332 | 802 | <field name="name">Prestaciones en especie (Pensionados y beneficiarios)</field> | ||
1333 | 803 | <field name="sequence">251</field> | ||
1334 | 804 | <field name="code">PEPB_T</field> | ||
1335 | 805 | <field name="condition_select">none</field> | ||
1336 | 806 | <field name="amount_select">code</field> | ||
1337 | 807 | <field name="amount_python_compute">result = SDI * 0.00375 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1338 | 808 | </record> | ||
1339 | 809 | |||
1340 | 810 | <record id="REG252" model="hr.salary.rule"> | ||
1341 | 811 | <field name="category_id" ref="CAT_IMSS"/> | ||
1342 | 812 | <field name="name">Prestaciones en dinero</field> | ||
1343 | 813 | <field name="sequence">252</field> | ||
1344 | 814 | <field name="code">PD_T</field> | ||
1345 | 815 | <field name="condition_select">none</field> | ||
1346 | 816 | <field name="amount_select">code</field> | ||
1347 | 817 | <field name="amount_python_compute">result = SDI * 0.0025 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1348 | 818 | </record> | ||
1349 | 819 | |||
1350 | 820 | <record id="REG253" model="hr.salary.rule"> | ||
1351 | 821 | <field name="category_id" ref="CAT_IMSS"/> | ||
1352 | 822 | <field name="name">Seguro de invalides y vida</field> | ||
1353 | 823 | <field name="sequence">253</field> | ||
1354 | 824 | <field name="code">SIV_T</field> | ||
1355 | 825 | <field name="condition_select">none</field> | ||
1356 | 826 | <field name="amount_select">code</field> | ||
1357 | 827 | <field name="amount_python_compute">result = SDI * 0.00625 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1358 | 828 | </record> | ||
1359 | 829 | |||
1360 | 830 | <record id="REG254" model="hr.salary.rule"> | ||
1361 | 831 | <field name="category_id" ref="CAT_IMSS"/> | ||
1362 | 832 | <field name="name">Cesantia en edad avanzada y vejes</field> | ||
1363 | 833 | <field name="sequence">254</field> | ||
1364 | 834 | <field name="code">CEAV_T</field> | ||
1365 | 835 | <field name="condition_select">none</field> | ||
1366 | 836 | <field name="amount_select">code</field> | ||
1367 | 837 | <field name="amount_python_compute">result = SDI * 0.01125 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1368 | 838 | </record> | ||
1369 | 839 | |||
1370 | 840 | <record id="REG255" model="hr.salary.rule"> | ||
1371 | 841 | <field name="category_id" ref="CAT_DEDUCCIONES"/> | ||
1372 | 842 | <field name="name">IMSS</field> | ||
1373 | 843 | <field name="sequence">255</field> | ||
1374 | 844 | <field name="code">IMSS_T</field> | ||
1375 | 845 | <field name="condition_select">none</field> | ||
1376 | 846 | <field name="amount_select">code</field> | ||
1377 | 847 | <field name="amount_python_compute">result = categories.IMSS</field> | ||
1378 | 848 | </record> | ||
1379 | 849 | |||
1380 | 850 | <record id="REG259" model="hr.salary.rule"> | ||
1381 | 851 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
1382 | 852 | <field name="name">DEDUCCIONES</field> | ||
1383 | 853 | <field name="sequence">259</field> | ||
1384 | 854 | <field name="code">DEDUCCIONES</field> | ||
1385 | 855 | <field name="condition_select">none</field> | ||
1386 | 856 | <field name="amount_select">code</field> | ||
1387 | 857 | <field name="amount_python_compute">result = categories.DEDUCCIONES</field> | ||
1388 | 858 | </record> | ||
1389 | 859 | |||
1390 | 860 | <!-- ###################################### --> | ||
1391 | 861 | <!-- ###################################### --> | ||
1392 | 862 | <!-- ###################################### --> | ||
1393 | 863 | |||
1394 | 864 | <record id="REG260" model="hr.salary.rule"> | ||
1395 | 865 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1396 | 866 | <field name="name">Prestaciones en especie(Cuota fija)</field> | ||
1397 | 867 | <field name="sequence">260</field> | ||
1398 | 868 | <field name="code">PE_E</field> | ||
1399 | 869 | <field name="condition_select">none</field> | ||
1400 | 870 | <field name="amount_select">code</field> | ||
1401 | 871 | <field name="amount_python_compute">result = SDI * 0.204 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1402 | 872 | </record> | ||
1403 | 873 | |||
1404 | 874 | <record id="REG261" model="hr.salary.rule"> | ||
1405 | 875 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1406 | 876 | <field name="name">Prestaciones en especie(Cuota adicional)</field> | ||
1407 | 877 | <field name="sequence">261</field> | ||
1408 | 878 | <field name="code">PE_E</field> | ||
1409 | 879 | <field name="condition_select">python</field> | ||
1410 | 880 | <field name="condition_python">result = SDI>3 * SGVDF </field> | ||
1411 | 881 | <field name="amount_select">code</field> | ||
1412 | 882 | <field name="amount_python_compute">result =((SDI * worked_days.WORK100.number_of_days * 7 /6)-(3 * SGVDF))*0.011</field> | ||
1413 | 883 | </record> | ||
1414 | 884 | |||
1415 | 885 | <record id="REG262" model="hr.salary.rule"> | ||
1416 | 886 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1417 | 887 | <field name="name">Prestaciones en especie (Pensionados y beneficiarios)</field> | ||
1418 | 888 | <field name="sequence">262</field> | ||
1419 | 889 | <field name="code">PEPB_E</field> | ||
1420 | 890 | <field name="condition_select">none</field> | ||
1421 | 891 | <field name="amount_select">code</field> | ||
1422 | 892 | <field name="amount_python_compute">result = SDI * 0.0105 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1423 | 893 | </record> | ||
1424 | 894 | |||
1425 | 895 | <record id="REG263" model="hr.salary.rule"> | ||
1426 | 896 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1427 | 897 | <field name="name">Prestaciones en dinero</field> | ||
1428 | 898 | <field name="sequence">263</field> | ||
1429 | 899 | <field name="code">PD_E</field> | ||
1430 | 900 | <field name="condition_select">none</field> | ||
1431 | 901 | <field name="amount_select">code</field> | ||
1432 | 902 | <field name="amount_python_compute">result = SDI * 0.007 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1433 | 903 | </record> | ||
1434 | 904 | |||
1435 | 905 | <record id="REG264" model="hr.salary.rule"> | ||
1436 | 906 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1437 | 907 | |||
1438 | 908 | <field name="name">Seguro de invalides y vida</field> | ||
1439 | 909 | <field name="sequence">264</field> | ||
1440 | 910 | <field name="code">SIV_E</field> | ||
1441 | 911 | <field name="condition_select">none</field> | ||
1442 | 912 | <field name="amount_select">code</field> | ||
1443 | 913 | <field name="amount_python_compute">result = SDI * 0.0175 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1444 | 914 | </record> | ||
1445 | 915 | |||
1446 | 916 | <record id="REG265" model="hr.salary.rule"> | ||
1447 | 917 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1448 | 918 | <field name="name">Seguro para el retiro</field> | ||
1449 | 919 | <field name="sequence">265</field> | ||
1450 | 920 | <field name="code">SR_E</field> | ||
1451 | 921 | <field name="condition_select">none</field> | ||
1452 | 922 | <field name="amount_select">code</field> | ||
1453 | 923 | <field name="amount_python_compute">result = SDI * 0.02 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1454 | 924 | </record> | ||
1455 | 925 | |||
1456 | 926 | <record id="REG266" model="hr.salary.rule"> | ||
1457 | 927 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1458 | 928 | <field name="name">Cesantia en edad avanzada y vejes</field> | ||
1459 | 929 | <field name="sequence">266</field> | ||
1460 | 930 | <field name="code">CEAV_E</field> | ||
1461 | 931 | <field name="condition_select">none</field> | ||
1462 | 932 | <field name="amount_select">code</field> | ||
1463 | 933 | <field name="amount_python_compute">result = SDI * 0.0315 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1464 | 934 | </record> | ||
1465 | 935 | |||
1466 | 936 | <record id="REG267" model="hr.salary.rule"> | ||
1467 | 937 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1468 | 938 | <field name="name">Guarderias y Prestaciones Sociales</field> | ||
1469 | 939 | <field name="sequence">267</field> | ||
1470 | 940 | <field name="code">GPS_E</field> | ||
1471 | 941 | <field name="condition_select">none</field> | ||
1472 | 942 | <field name="amount_select">code</field> | ||
1473 | 943 | <field name="amount_python_compute">result = SDI * 0.01 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1474 | 944 | </record> | ||
1475 | 945 | |||
1476 | 946 | <record id="REG268" model="hr.salary.rule"> | ||
1477 | 947 | <field name="category_id" ref="CAT_OBLIGACIONES"/> | ||
1478 | 948 | <field name="name">Infonavit</field> | ||
1479 | 949 | <field name="sequence">268</field> | ||
1480 | 950 | <field name="code">I_E</field> | ||
1481 | 951 | <field name="condition_select">none</field> | ||
1482 | 952 | <field name="amount_select">code</field> | ||
1483 | 953 | <field name="amount_python_compute">result = SDI * 0.05 * worked_days.WORK100.number_of_days * 7 /6</field> | ||
1484 | 954 | </record> | ||
1485 | 955 | |||
1486 | 956 | <record id="REG269" model="hr.salary.rule"> | ||
1487 | 957 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
1488 | 958 | <field name="name">OBLIGACIONES</field> | ||
1489 | 959 | <field name="sequence">269</field> | ||
1490 | 960 | <field name="code">OBLIGACIONES</field> | ||
1491 | 961 | <field name="condition_select">none</field> | ||
1492 | 962 | <field name="amount_select">code</field> | ||
1493 | 963 | <field name="amount_python_compute">result = categories.OBLIGACIONES</field> | ||
1494 | 964 | </record> | ||
1495 | 965 | |||
1496 | 966 | <record id="REG300" model="hr.salary.rule"> | ||
1497 | 967 | <field name="category_id" ref="CAT_CONCEPTOS"/> | ||
1498 | 968 | <field name="name">PAGO</field> | ||
1499 | 969 | <field name="sequence">300</field> | ||
1500 | 970 | <field name="code">PAGO</field> | ||
1501 | 971 | <field name="condition_select">none</field> | ||
1502 | 972 | <field name="amount_select">code</field> | ||
1503 | 973 | <field name="amount_python_compute">result = categories.PEXENT + categories.PGRAVA - categories.DEDUCCIONES </field> | ||
1504 | 974 | </record> | ||
1505 | 975 | |||
1506 | 976 | </data> | ||
1507 | 977 | </openerp> | ||
1508 | 0 | 978 | ||
1509 | === added file 'l10n_mx_hr_payroll/hr_payroll_view.xml' | |||
1510 | --- l10n_mx_hr_payroll/hr_payroll_view.xml 1970-01-01 00:00:00 +0000 | |||
1511 | +++ l10n_mx_hr_payroll/hr_payroll_view.xml 2012-12-04 15:42:21 +0000 | |||
1512 | @@ -0,0 +1,156 @@ | |||
1513 | 1 | <?xml version="1.0"?> | ||
1514 | 2 | <openerp> | ||
1515 | 3 | <data> | ||
1516 | 4 | <record id="view_hr_contract_concept_form" model="ir.ui.view"> | ||
1517 | 5 | <field name="name">hr.contract.concept.form</field> | ||
1518 | 6 | <field name="model">hr.contract.concept</field> | ||
1519 | 7 | <field name="type">form</field> | ||
1520 | 8 | <field name="arch" type="xml"> | ||
1521 | 9 | <form string="Employee Function"> | ||
1522 | 10 | <field name="code"/> | ||
1523 | 11 | <field name="name"/> | ||
1524 | 12 | <field name="description"/> | ||
1525 | 13 | <field name="concept_type"/> | ||
1526 | 14 | <field name="amount"/> | ||
1527 | 15 | <field name="amount_type"/> | ||
1528 | 16 | <field name="history_ids"/> | ||
1529 | 17 | </form> | ||
1530 | 18 | </field> | ||
1531 | 19 | </record> | ||
1532 | 20 | <record id="view_hr_contract_concept_tree" model="ir.ui.view"> | ||
1533 | 21 | <field name="name">hr.contract.concept.tree</field> | ||
1534 | 22 | <field name="model">hr.contract.concept</field> | ||
1535 | 23 | <field name="type">tree</field> | ||
1536 | 24 | <field name="arch" type="xml"> | ||
1537 | 25 | <tree string="Employee Function"> | ||
1538 | 26 | <field name="code"/> | ||
1539 | 27 | <field name="name"/> | ||
1540 | 28 | <field name="description"/> | ||
1541 | 29 | <field name="amount"/> | ||
1542 | 30 | <field name="history_ids"/> | ||
1543 | 31 | </tree> | ||
1544 | 32 | </field> | ||
1545 | 33 | </record> | ||
1546 | 34 | <record id="view_concept_history_tree" model="ir.ui.view"> | ||
1547 | 35 | <field name="name">hr.concept.history.tree</field> | ||
1548 | 36 | <field name="model">hr.concept.history</field> | ||
1549 | 37 | <field name="type">tree</field> | ||
1550 | 38 | <field name="arch" type="xml"> | ||
1551 | 39 | <tree string="Employee Function"> | ||
1552 | 40 | <field name="date"/> | ||
1553 | 41 | <field name="amount_initial"/> | ||
1554 | 42 | <field name="amount_final"/> | ||
1555 | 43 | <field name="amount"/> | ||
1556 | 44 | </tree> | ||
1557 | 45 | </field> | ||
1558 | 46 | </record> | ||
1559 | 47 | <record id="view_hr_contract_form" model="ir.ui.view"> | ||
1560 | 48 | <field name="name">hr.contract</field> | ||
1561 | 49 | <field name="model">hr.contract</field> | ||
1562 | 50 | <field name="type">form</field> | ||
1563 | 51 | <field name="inherit_id" ref="hr_contract.hr_contract_view_form"/> | ||
1564 | 52 | <field name="arch" type="xml"> | ||
1565 | 53 | <xpath expr="/form/notebook/page[@string='Work Permit']" position="after"> | ||
1566 | 54 | <page string="Concept"> | ||
1567 | 55 | <field name="concept_ids" nolabel="1" colspan="4"/> | ||
1568 | 56 | </page> | ||
1569 | 57 | </xpath> | ||
1570 | 58 | </field> | ||
1571 | 59 | </record> | ||
1572 | 60 | <!-- | ||
1573 | 61 | <record id="view_hr_holidays_status_form" model="ir.ui.view"> | ||
1574 | 62 | <field name="name">hr.holidays.status.form</field> | ||
1575 | 63 | <field name="model">hr.holidays.status</field> | ||
1576 | 64 | <field name="type">form</field> | ||
1577 | 65 | <field name="inherit_id" ref="hr_holidays.edit_holiday_status_form"/> | ||
1578 | 66 | <field name="arch" type="xml"> | ||
1579 | 67 | <xpath expr="/form/group/field[@name='name']" position="before"> | ||
1580 | 68 | <field name="code"/> | ||
1581 | 69 | </xpath> | ||
1582 | 70 | </field> | ||
1583 | 71 | </record> | ||
1584 | 72 | --> | ||
1585 | 73 | <record id="view_hr_payroll_payslip_employees_inherit_form" model="ir.ui.view"> | ||
1586 | 74 | <field name="name">hr_payroll.payslip.employees.inherit.form</field> | ||
1587 | 75 | <field name="model">hr.payslip.employees</field> | ||
1588 | 76 | <field name="type">form</field> | ||
1589 | 77 | <field name="inherit_id" ref="hr_payroll.view_hr_payslip_by_employees"/> | ||
1590 | 78 | <field name="arch" type="xml"> | ||
1591 | 79 | <xpath expr="/form/group/field[@name='employee_ids']" position="replace"> | ||
1592 | 80 | <field name="employee_ids" domain="" nolabel="1" colspan="4"/> | ||
1593 | 81 | </xpath> | ||
1594 | 82 | </field> | ||
1595 | 83 | </record> | ||
1596 | 84 | <!-- | ||
1597 | 85 | <record id="view_hr_employee_inherit_search" model="ir.ui.view"> | ||
1598 | 86 | <field name="name">hr.employee.inherit.search</field> | ||
1599 | 87 | <field name="model">hr.employee</field> | ||
1600 | 88 | <field name="type">search</field> | ||
1601 | 89 | <field name="inherit_id" ref="hr.view_employee_filter"/> | ||
1602 | 90 | <field name="arch" type="xml"> | ||
1603 | 91 | <xpath expr="/search/field[@name='name']" position="after"> | ||
1604 | 92 | <field name="name" colspan="4"/> | ||
1605 | 93 | </xpath> | ||
1606 | 94 | </field> | ||
1607 | 95 | </record> | ||
1608 | 96 | --> | ||
1609 | 97 | <record id="view_hr_payslip_run_inherit_form" model="ir.ui.view"> | ||
1610 | 98 | <field name="name">hr.payslip.run.inherit.form</field> | ||
1611 | 99 | <field name="model">hr.payslip.run</field> | ||
1612 | 100 | <field name="type">form</field> | ||
1613 | 101 | <field name="inherit_id" ref="hr_payroll.hr_payslip_run_form"/> | ||
1614 | 102 | <field name="arch" type="xml"> | ||
1615 | 103 | <xpath expr="/form/group/field[@name='credit_note']" position="replace"> | ||
1616 | 104 | <field name="credit_note" invisible="1"/> | ||
1617 | 105 | </xpath> | ||
1618 | 106 | <xpath expr="/form/group/field[@name='date_start']" position="after"> | ||
1619 | 107 | <field name="type"/> | ||
1620 | 108 | <field name="schedule_pay"/> | ||
1621 | 109 | </xpath> | ||
1622 | 110 | </field> | ||
1623 | 111 | </record> | ||
1624 | 112 | |||
1625 | 113 | <record id="view_hr_payslip_form" model="ir.ui.view"> | ||
1626 | 114 | <field name="name">hr.payslip</field> | ||
1627 | 115 | <field name="model">hr.payslip</field> | ||
1628 | 116 | <field name="type">form</field> | ||
1629 | 117 | <field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/> | ||
1630 | 118 | <field name="arch" type="xml"> | ||
1631 | 119 | <xpath expr="/form/group/field[@name='employee_id']" position="replace"> | ||
1632 | 120 | <field name="employee_id"/> | ||
1633 | 121 | </xpath> | ||
1634 | 122 | <xpath expr="/form/notebook/page/field[@name='line_ids']" position="replace"> | ||
1635 | 123 | |||
1636 | 124 | <field name="line_ids" colspan="4" nolabel="1"> | ||
1637 | 125 | <tree string="Salary Structure" editable="bottom" colors="grey:code in ('PEPB_T','PD_T','SIV_T','CEAV_T','PE_E','PEPB_E','PD_E','SIV_E','SR_E','CEAV_E','GPS_E','I_E' );green:code in ('PERCEPCIONES','DEDUCCIONES','OBLIGACIONES')"> | ||
1638 | 126 | <field name="name"/> | ||
1639 | 127 | <field name="code"/> | ||
1640 | 128 | <field name="category_id"/> | ||
1641 | 129 | <field name="sequence" invisible="1"/> | ||
1642 | 130 | <field name="quantity" invisible="1"/> | ||
1643 | 131 | <field name="rate" invisible="1"/> | ||
1644 | 132 | <field name="amount" invisible="1"/> | ||
1645 | 133 | <field name="total"/> | ||
1646 | 134 | </tree> | ||
1647 | 135 | <form string="Payslip Line"> | ||
1648 | 136 | <group> | ||
1649 | 137 | <field name="name" select="1"/> | ||
1650 | 138 | <field name="code" select="1"/> | ||
1651 | 139 | <field name="category_id"/> | ||
1652 | 140 | <field name="sequence" groups="base.group_extended"/> | ||
1653 | 141 | <field name="quantity"/> | ||
1654 | 142 | <field name="rate"/> | ||
1655 | 143 | <field name="amount"/> | ||
1656 | 144 | <field name="total"/> | ||
1657 | 145 | <field name="salary_rule_id" groups="base.group_extended"/> | ||
1658 | 146 | </group> | ||
1659 | 147 | </form> | ||
1660 | 148 | </field> | ||
1661 | 149 | </xpath> | ||
1662 | 150 | |||
1663 | 151 | </field> | ||
1664 | 152 | </record> | ||
1665 | 153 | |||
1666 | 154 | </data> | ||
1667 | 155 | </openerp> | ||
1668 | 156 |
Comentando que debes limpiar los prints.
En las líneas mencionadas