Ejemplo n.º 1
0
 private void RecomputeEmployeeHours(DateTime clockin, DateTime clockout, int employeeId)
 {
     //recompute employee hours
     _employeeHoursService.GenerateEmployeeHours(clockin.Date, clockout.Date, employeeId);
     //if (clockin.Date != clockout.Date)
     //     _employeeHoursService.ComputeEmployeeHours(clockout, employeeId);
 }
Ejemplo n.º 2
0
        private void GeneratePayroll(DateTime payrollStartDate, DateTime payrollEndDate)
        {
            //Generate Attendance
            Console.WriteLine("Generating Attendance...");
            _attendanceService.CreateWorkSchedules();

            //Compute employee hours
            Console.WriteLine("Computing daily employee hours for date " + payrollStartDate + " to " +
                              payrollEndDate);
            _employeeHoursService.GenerateEmployeeHours(payrollStartDate, payrollEndDate);

            //Compute total employee hours
            Console.WriteLine("Computing total employee hours for date " + payrollStartDate + " to " +
                              payrollEndDate);
            _totalEmployeeHoursService.GenerateTotalByDateRange(payrollStartDate, payrollEndDate);

            //Compute daily payroll

            /*Console.WriteLine("Computing daily payroll for date " + payrollStartDate + " to " + payrollEndDate);
             * _employeeDailyPayrollService.GenerateEmployeeDailySalaryByDateRange(payrollStartDate, payrollEndDate);*/

            //Generate payroll items
            Console.WriteLine("Computing payroll items for date " + payrollStartDate + " to " + payrollEndDate);
            var payrollDate = _employeePayrollService.GetNextPayrollReleaseDate(payrollEndDate);

            _employeePayrollItemservice.GenerateEmployeePayrollItemByDateRange(payrollDate, payrollStartDate, payrollEndDate);

            //Generate Payroll
            Console.WriteLine("Computing payroll for date " + payrollStartDate + " to " + payrollEndDate);
            _employeePayrollService.GeneratePayroll(payrollStartDate, payrollEndDate);
        }
Ejemplo n.º 3
0
        public void Execute()
        {
            //Get payroll date range
            try
            {
                var payrollStartDate = _employeePayrollService
                                       .GetLatestPayrollStartDate().TruncateTime();
                var payrollEndDate = _employeePayrollService
                                     .GetNextPayrollEndDate(payrollStartDate).TruncateTime();

                //Compute employee hours
                Console.WriteLine("Computing daily employee hours for date " + payrollStartDate + " to " +
                                  payrollEndDate);
                _employeeHoursService.GenerateEmployeeHours(payrollStartDate, payrollEndDate);
                LogSchedule(SchedulerLogType.Success);
            }
            catch (Exception ex)
            {
                LogSchedule(SchedulerLogType.Exception, ex.InnerException.Message);
            }
        }