Gross_pay calculation in Payroll Entry generated salary slips

We need assistance for payroll with payment days when using payroll entry.

The scenario:
We hvae social security fund 10% to be deducted from salary and is based on gross_pay.
So, we have defined a formula

It seems that component formula based on gross_pay is not considering the lwp/payment_days correctly when salary slips are created from Payroll entry. It is giving wierd results that we can’t understand the reason.

It used to work well in v11.1.36 but has stopped behaving like it used to do earlier. I tried to see the difference from github, but can’t figure out what is affecting it.

If we update the salary slip individually then it correctly calculates the components with gross_pay. Even if we do a bulk edit of a field e.g. Letter Head and set the value to the same value, it recalculates the component amounts correctly based on correct gross_pay.

Attached is the sample outcome and the configuration of salary component in the structure.

The salary structure is:

1 Like

Seems problematic to reference gross_pay in the earnings table, because gross_pay is the sum of all earnings, right?

Yes, it does sound problematic for earnings to refer to gross_pay (though it worked to our favour before), but then why would even the Deductions be calculated incorrectly?

I would not list the employer’s contribution as part of the salary – it’s an ordinary expense for the company that can be handled separately (at least in Germany). Instead, only list the employee’s contribution as a deduction from gross_pay.

Noted, neverthless, the gross_pay should be correctly calculated for the deductions to be calculated since it depends on it. As of now as soon as there are leave without pay/payment days, it miscalculates the gross_pay during the time of getting amount for deductions salary components and then sets the gross_pay correctly. The behaviour has surely changed and I need to figure out how to fix it.