public bool IsInPayPeriod(DateTime theDate, Paycheck paycheck)
        {
            DateTime payPeriodEndDate   = paycheck.PayPeriodEndDate;
            DateTime payPeriodStartDate = paycheck.PayPeriodStartDate;

            return((theDate >= payPeriodStartDate) && (theDate <= payPeriodEndDate));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public override double CalculatePay(Paycheck paycheck)
        {
            double totalPay = 0.0;

            foreach (SalesReceipt sales in salesReceipt.Values)
            {
                if (IsInPayPeriod(sales.Date, paycheck))
                {
                    totalPay += sales.Amount / 100.0 * commission;
                }
            }
            return(totalPay + salary);
        }
        public override double CalculatePay(Paycheck paycheck)
        {
            double totalPay = 0.0;

            foreach (TimeCard timeCard in timeCards.Values)
            {
                if (IsInPayPeriod(timeCard.Date, paycheck))
                {
                    totalPay += CalculatePayForTimeCard(timeCard);
                }
            }
            return(totalPay);
        }
Ejemplo n.º 5
0
        public double CalculateDeductions(Paycheck paycheck)
        {
            double totalDues = 0;
            int    friday    = NumberOfFridaysInPayPeriod(paycheck.PayPeriodStartDate, paycheck.PayPeriodEndDate);

            totalDues = charge * friday;
            foreach (ServiceCharge ch in charges.Values)
            {
                if (DateUtil.IsInPayPeriod(ch.Date, paycheck.PayPeriodStartDate, paycheck.PayPeriodEndDate))
                {
                    totalDues += ch.Charge;
                }
            }
            return(totalDues);
        }
Ejemplo n.º 6
0
        public void Execute()
        {
            ArrayList empids = new ArrayList();

            empids.AddRange(PayrollDatabase.GetAllEmployeeIds());
            foreach (int empid in empids)
            {
                Employee employee = PayrollDatabase.instance.GetEmployee(empid);
                if (employee.IsPayDate(payDate))
                {
                    DateTime startDate = employee.GetPayPeriodStartDate(payDate);
                    Paycheck pc        = new Paycheck(startDate, payDate);
                    paychecks[empid] = pc;
                    employee.PayDay(pc);
                }
            }
        }
 public abstract double CalculatePay(Paycheck paycheck);
Ejemplo n.º 8
0
 public override double CalculatePay(Paycheck paycheck)
 {
     return(salary);
 }
Ejemplo n.º 9
0
 public void Pay(Paycheck paycheck)
 {
     paycheck.SetField("Disposition", "HOLD");
 }
Ejemplo n.º 10
0
 public double CalculateDeductions(Paycheck paycheck)
 {
     return(0);
 }
Ejemplo n.º 11
0
 public void Pay(Paycheck paycheck)
 {
 }