Adding Professional Staff Wages 

For Monthly / Professional Staff, SerendiSys manages some automation of the Wages Entry Process. Staff must still cross check the amounts generated, to ensure the data is all correct.

SalaryDetails

SalaryDetails and Loans data  

The image above shows the People/Staff data for one staff member.

  1. If the Staff record has "SalaryDetails" added an Action "Add Professional Staff Wages" should appear. To create a monthly-wages record, click on this Action.
  2. The Action will use all the data in the SalaryDetails Edit Form to generate wages. The values entered for BasicSalary and MonthlyAllowances will be used to create 2 WageItems records. If the ProvidentFundContribution is set to the correct percentage, this will be used to compute the staff-members contribution.
  3. Staff Loan payments are also automatically created / deducted. When "Add Profesional Staff Wages" is triggered, SerendiSys will check whether the staff member has any Loans records with LoansType "Staff Loan" or "Seedling Loan" an OutstandingAmount greater than zero. If they do, LoanPayments records will be added using the values in the StaffLoanRepayment and Seedling LoanRepayment fields.
 

Professional Staff Pay Slip

Pay Slip with Loan Deduction  

When a Loan Payment is made, the data from the LoanPayments table will be summed up and added to the pay-slip. As shown at 1., in the image above.

SQL Used to Generate the Wage Slip

SELECT
P.ID,
P.FullName as Staff,
W.DateDone,
W.TaxableGross,
W.BonusOTGross,
W.NonTaxableGross,
W.SSEE,
W.SSER,
W.PAYE,
W.PAYEBonus,
W.ProvidentFundDeduction,
W.BalancingSNIIT,
W.UnionDues,
W.NormalDaysWorked,
W.SatHolDaysWorked,
W2.AddedDays,
W.Net,
LP.LoanName,
LP.LoanRepayment,
T.Name + IF(W1.TotalDue < 0 THEN ' REPAYMENT' ELSE '') as WagesType,
W1.Taxable,
W1.UnitValue,
W1.Units,
W1.TotalDue as WageItemValue
FROM
People P
LEFT JOIN Wages W ON (P.ID = W.StaffID)
LEFT JOIN WageItems W1 ON (W.ID = W1.WagesID)
LEFT JOIN Types T ON (W1.WageItemsTypeID = T.ID)
LEFT JOIN (SELECT WagesID, Units as AddedDays
FROM WageItems
WHERE WageItemsTypeID = 22726857) as W2 ON (W2.WagesID = W.ID)
LEFT JOIN (SELECT
PersonID,
DateDone,
CAST(LIST(T.Name + ' ' + COALESCE(L.Name, '')) as VARCHAR(200)) as LoanName,
SUM("Value") as LoanRepayment
FROM LoanPayments L1
LEFT JOIN Loans L ON L.ID = L1.LoansID
LEFT JOIN Types T ON T.ID = L.LoansTypeID
GROUP BY PersonID, DateDone) AS LP ON (LP.PersonID = P.ID AND LP.DateDone = W.DateDone)
WHERE W.ID = %d
ORDER BY WagesType

NOTE: In the above, the LoanPayments data-table is JOINed to the Wages data-table using the PersonID and the DateDone.
If more than 1 LoanPayment is may on a particular date, all will be summed together and totalled onto the Wage Slip.