Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
14512 Vistas

Hello all,

I read that rules object can be used inside python calculation of salary rules . If I undestand correctly, with that object I can get any rule value (i.e. its total ) already calculated for the employee during the calculation process in execution, and use it in current salary rule calculation for the same employee. If thas is correct, can anybody indicate the way rules object should be? ( I already know how to get a category current value that has been calculated for an employee during the process, but my point is wheter it is possible to get a specific previosly calculated value for a salary rule of the employee)

I appreciate your response.

Avatar
Descartar
Mejor respuesta

use the code of the rule, for example of the rule name is 'pension contribution' and code is 'PENS' then you can simply put it as shown in example below:


result = categories.BASIC - PENS
Avatar
Descartar

@Bernard Kipkorir Too: Great! directly rule code can able to access. Tried rule.PENS not working PENS is working. (Not clear in document)

Life saver! There is no documentation for this kind of information.

Mejor respuesta

You can get the previously calculated salary rule by using the salary code.

For Example,

If you salary rule name is Basic Salary and its code is BA then, you will get this data of this salary rule in another salary rule.

Lets Provident fund is another salary rule and its code is PF. Provident fund is 12% of the Basic Salary + Driving Allowance. (Assume that there is another salary rule called Driving Allowance with code DA)Then the PF is calculated as shown below.

result = (BA + DA) * 12 /100
By the above python code you can calculate the PF.
Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
may 23
3418
1
mar 18
4332
2
dic 24
2160
0
ene 24
19
0
nov 23
1775