The purpose of this page is to resolve a complicated issue involving Payroll. My friend already requested me and he faced a lot of issues to implement it in payroll schema as well. So in this document I will share my solution to you. First I would like to mention requirement:
- Daily Rate = Basic Salary / 30 for all month.
- If employee join / retire in middle of month, his salary should be proportioned.
- If absent full month, salary will be 0 (NULL).
After investigation and testing carefully in system, the solution is only PCR as picture below. I don't mention how to modify Payroll Schema and where should new pcr be inserted into. If you are not clear about that, please look at 2 documents: Integrating Negative Time and Payroll & Relationship Time Evaluation and Payroll
Now following my explanation here:
1. Have to check employee absence FULL Month or not:
RTE=TKSOLL => set Planned working time measured in calendar days.
RTE-TKAU** => minus with Unpaid absence measured in calendar days
checking with 0. If it equals 0 (return value is *, because another case is >, so others are = or <, but employee cannot apply more than monthly calendar days, so only = 0 or > 0), assign 0 into wage type /801, so basic salary will equal 0.
2. Next step: retrieve Calendar days again: RTE=TKSOLL (Remind: must re-use : RTE=TKSOLL, not RTE=TKSOLL & RTE-TKAU** in 2 first lines of PCR) and then check current payroll period, it's Feb or not by using CMPER MM02 (it means comparing with Feb).
Note: please clear configuration for payroll period, some countries such as India, Japan its fiscal year start from Apr to next Mar, so 01 means Apr so 11 means Feb. Keep in mind please. (One tip here you can use PA03 to check Payroll area period or run payroll with display log to know it).
3. If it's Feb, comparing with 28, otherwise comparing with 30.
* (= or >)
ADDWT * OT Output table
< (it's lower, happen only 2 cases: joining or retiring in middle of month). Without this condition, join / retire in middle of month, employee's salary cannot be proportioned.
ADDWT * OT Output table
Another steps, only minus Unpaid absence measured in calendar days, next multiply with constant 100000 GENAU in T511K, and then divide with 30 (as we fix 30 days for every month).
That's all. If you need to calculate exactly how many days in Feb or another please refer Calculate Date Total in month