github issue https://github.com/frappe/erpnext/issues/18921
I have created a new salary structure applied from 1st Sep. Then on 4th Sep I generate salary slip for employee for Aug (I even set Posting date with a date in Aug). However the new salary structure is still applied although it should use the old salary structure because it is salary slip for Aug.