Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
14572 Tampilan

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
Buang
Jawaban Terbai

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
Buang

@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.

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mei 23
3454
1
Mar 18
4372
2
Des 24
2203
0
Jan 24
19
0
Nov 23
1795