github issue https://github.com/frappe/erpnext/issues/18618
This happens in 2 cases
A staff joins the company in middle of a month for example, the salary do not get calculated correctly, it gives whole monthly salary when you create salary slip. I think this case should be handled specially even “Depend on payment days” option is enabled or not
We define a new salary structure assignment for a staff and start date is in middle of a month then when we create the salary slip, the new salary structure assignment affect for whole month which we apply new structure in middle.