예제 #1
0
 /// <summary>
 /// Creates a PayPeriod string
 /// </summary>
 /// <param name="taxCalculator">tax calculator instance</param>
 /// <param name="payDate">pay date</param>
 /// <returns>PayPeriod string</returns>
 public static string PayDateString(this TaxCalculatorService taxCalculator, DateTime payDate)
 {
     return(string.Format("{0} {1} - {2} {3}", payDate.Day.GetPaddedString(2), payDate.Month.GetMonthName(), DateTime.DaysInMonth(payDate.Year, payDate.Month).GetPaddedString(2), payDate.Month.GetMonthName()));
 }
예제 #2
0
 /// <summary>
 /// Calculates Net pay
 /// </summary>
 /// <param name="taxCalculator">tax calculator instance</param>
 /// <param name="grossPay">Gross pay</param>
 /// <param name="tax">income tax</param>
 /// <returns>Net pay</returns>
 public static decimal NetPay(this TaxCalculatorService taxCalculator, decimal grossPay, decimal tax)
 {
     return(grossPay - tax);
 }
예제 #3
0
 /// <summary>
 /// Calculates Super pay amount
 /// </summary>
 /// <param name="taxCalculator">tax calculator instance</param>
 /// <param name="grossPay">Gross pay</param>
 /// <param name="superRate">super rate</param>
 /// <returns>Return super amount</returns>
 public static decimal SuperPay(this TaxCalculatorService taxCalculator, decimal grossPay, decimal superRate)
 {
     return(grossPay * (superRate / 100));
 }
예제 #4
0
 /// <summary>
 /// calculate gross pay from annual pay
 /// </summary>
 /// <param name="taxCalculator">tax calculator instance</param>
 /// <param name="annualPay">annual pay</param>
 /// <returns>Gross pay</returns>
 public static decimal GrossPay(this TaxCalculatorService taxCalculator, decimal annualPay)
 {
     return(annualPay / 12);
 }