Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
14569 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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
Awatar
Odrzuć

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

Najlepsza odpowiedź

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.
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
maj 23
3454
1
mar 18
4369
2
gru 24
2201
0
sty 24
19
0
lis 23
1795