fix(Salary Structure Assignment: Preview Salary Slip): Calculation of earnings whose formula is dependent on deductions and so on (backport #2088) #2131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ticket: https://support.frappe.io/helpdesk/tickets/20134
First of all, let it be known that I do not like working on the payroll codebase.
Now that that is out of the way, if the formula of an earning component is dependent on a deduction component, it does not get updated in the salary slip preview. Consequently, other components that are dependent on the un-updated one do not get updated either, and so on.
Salary Structure:
Salary Slip Preview (Base = 4,58,433):
Special Allowance isn't updated, as it does not get Provident Fund and Gratuity values. It should be 3504 - (1800 + 919) = 785
Solution
This is an automatic backport of pull request fix(Salary Structure Assignment: Preview Salary Slip): Calculation of earnings whose formula is dependent on deductions and so on #2088 done by Mergify.