Salary Structure Overwrites Changes in Salary Slip upon Saving

After creating a salary structure comprising of base rate and HRA in earnings, I was trying to create a salary slip. Now, just for testing, I tried to edit the HRA amount in Salary Slip.

But as we save the edited Salary Slip, the HRA amount goes back to the amount as mentioned in the Salary Structure.

Just wanted to know is this by design or is something wrong?

Akshay

Hi @mehta_akshay

Yes this is by design, if you want to add HRA rate manually then you need remove HRA component from the salary structure.

@rohit_w Thanks, What if we want to change this behavior, where in code should I look for.

Check below code, Don’t make changes in the core code, it will may broke during updation
https://github.com/frappe/erpnext/blob/develop/erpnext/hr/doctype/salary_slip/salary_slip.py#L73-L74