public void Payday(Paycheck paycheck) { double grossPay = Classification.CalculatePay(paycheck); double deductions = affiliation.CalculateDeductions(paycheck); double netPay = grossPay - deductions; paycheck.GrossPay = grossPay; paycheck.Deductions = deductions; paycheck.NetPay = netPay; Method.Pay(paycheck); }
public override double CalculatePay(Paycheck paycheck) { double totalPay = 0.0; foreach (TimeCard timeCard in timeCards.Values) { if (DateUtil.IsInPayPeriod(timeCard.Date, paycheck.PayPeriodStartDate, paycheck.PayPeriodEndDate)) { totalPay += CalculatePayForTimeCard(timeCard); } } return(totalPay); }
public override void Execute() { var empIds = database.GetAllEmployeeIds(); foreach (int empId in empIds) { Employee employee = database.GetEmployee(empId); if (employee.IsPayDate(payDate)) { DateTime startDate = employee.GetPayPeriodStartDate(payDate); Paycheck pc = new Paycheck(startDate, payDate); paychecks[empId] = pc; employee.Payday(pc); } } }
public double CalculateDeductions(Paycheck paycheck) { double totalDues = 0; int fridays = NumberOfFridaysInPayPeriod( paycheck.PayPeriodStartDate, paycheck.PayPeriodEndDate); totalDues = dues * fridays; foreach (ServiceCharge charge in charges.Values) { if (DateUtil.IsInPayPeriod(charge.Time, paycheck.PayPeriodStartDate, paycheck.PayPeriodEndDate)) { totalDues += charge.Amount; } } return(totalDues); }
public override double CalculatePay(Paycheck paycheck) { return(salary); }