public AbsenceEvaluateSource()
 {
     AbsenceCode   = 0;
     DayPeriodFrom = 0;
     DayPeriodStop = 0;
     ScheduleMonth = new TSeconds[0];
 }
        public TAnmount SalaryAmountScheduleWork(Period period, TAnmount amountMonthly,
                                                 TSeconds fulltimeHour, TSeconds workingsHours)
        {
            decimal coeffSalary = 1.0m;

            decimal salaryValue = RoundingPay.MonthlyAmountWithWorkingHours(amountMonthly, coeffSalary, fulltimeHour, workingsHours);

            return(salaryValue);
        }
 public EvaluateSource()
 {
     AbsenceCode   = 0;
     DayFrom       = 0;
     DayStop       = 0;
     SchedulePiece = new WorkDayPieceType[0];
     ScheduleHours = new TSeconds[0];
     ScheduleMonth = new TSeconds[0];
 }
        public override string Description()
        {
            TSeconds hoursSummary  = HoursMonth.Aggregate(0, (agr, x) => (agr + x));
            string   formatedValue = FormatUtils.HoursFormat(hoursSummary);

            return(string.Format("{0}: Day FROM: {1}, Day STOP: {2}, Hours in month: {3}",
                                 Code.ToEnum <ArticleResultCode>().GetSymbol(),
                                 PeriodDayFrom.ToString(), PeriodDayStop.ToString(), formatedValue));
        }
        public override string Description()
        {
            TSeconds hoursSummary  = HoursMonth.Aggregate(0, (agr, x) => (agr + x));
            string   formatedMonth = string.Join("; ", HoursMonth.Take(7).Select((h) => (FormatUtils.HoursFormat(h))));
            string   formatedValue = FormatUtils.HoursFormat(hoursSummary);

            return(string.Format("{0}: Hours in month: {1}; First Week: {2}",
                                 Code.ToEnum <ArticleResultCode>().GetSymbol(),
                                 formatedValue, formatedMonth));
        }
        public static TSeconds TotalTimesheetHours(TSeconds[] monthTimesheet)
        {
            if (monthTimesheet == null)
            {
                return(0);
            }
            TSeconds timesheetHours = monthTimesheet.Aggregate(0, (agr, dh) => (agr + dh));

            return(timesheetHours);
        }
예제 #7
0
 public PositionScheduleEvalDetail()
 {
     PositionPart  = 0;
     DateFrom      = null;
     DayPeriodFrom = 0;
     DateStop      = null;
     DayPeriodStop = 0;
     PositionType  = WorkPositionType.POSITION_EXCLUSIVE;
     ScheduleWorks = new TSeconds[0];
 }
        public static TSeconds[] WeekSchedule(Period period, TSeconds secondsWeekly, TDays workdaysWeekly)
        {
            TSeconds secondsDaily = (secondsWeekly / Math.Min(workdaysWeekly, WEEKDAYS_COUNT));

            TSeconds secRemainder = secondsWeekly - (secondsDaily * workdaysWeekly);

            TSeconds[] weekSchedule = Enumerable.Range(1, 7).
                                      Select((x) => (WeekDaySeconds(x, workdaysWeekly, secondsDaily, secRemainder))).ToArray();

            return(weekSchedule);
        }
 public PositionEvaluateSource()
 {
     PositionPart  = 0;
     DateFrom      = null;
     DayPeriodFrom = 0;
     DateStop      = null;
     DayPeriodStop = 0;
     PositionType  = WorkPositionType.POSITION_EXCLUSIVE;
     ScheduleMonth = new TSeconds[0];
     ScheduleLimit = new TSeconds[0];
 }
예제 #10
0
 private static TSeconds WeekDaySeconds(int dayOrdinal, int daysOfWork, TSeconds secondsDaily, TSeconds secRemainder)
 {
     if (dayOrdinal < daysOfWork)
     {
         return(secondsDaily);
     }
     else if (dayOrdinal == daysOfWork)
     {
         return(secondsDaily + secRemainder);
     }
     return(0);
 }
        public override string ToResultExport(string targetSymbol)
        {
            TSeconds hoursSummary = HoursMonth.Aggregate(0, (agr, x) => (agr + x));

            string hoursFormated = FormatUtils.HoursFormat(hoursSummary);
            string dayesFormated = "";
            string moneyFormated = "";
            string basisFormated = "";
            string payeeFormated = "";

            return(string.Format("{0}\t{1}\tHours\t{2}\tDays\t{3}\tIncome Amount\t{4}\tBasis Amount\t{5}\tPayment\t{6}",
                                 targetSymbol, Code.ToEnum <ArticleResultCode>().GetSymbol(),
                                 hoursFormated, dayesFormated, moneyFormated, basisFormated, payeeFormated));
        }
예제 #12
0
        private static int HoursFromCalendar(TDay dayOrdFrom, TDay dayOrdEnds, TDay dayIndex, TSeconds workSeconds)
        {
            TDay dayOrdinal = (TDay)(dayIndex + 1);

            TSeconds workingDay = workSeconds;

            if (dayOrdFrom > dayOrdinal)
            {
                workingDay = 0;
            }
            if (dayOrdEnds < dayOrdinal)
            {
                workingDay = 0;
            }
            return(workingDay);
        }
예제 #13
0
        public static IEnumerable <ResultPack> EvaluateConcept(ConfigBase evalConfig, Period evalPeriod, IPeriodProfile evalProfile,
                                                               Result <MasterItem.EvaluateSource, string> prepValues)
        {
            IEmployProfile conceptProfile = evalProfile.Employ();

            if (conceptProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, CONCEPT_PROFILE_NULL_TEXT));
            }

            MasterItem.EvaluateSource conceptValues = prepValues.Value;
            // EVALUATION
            TSeconds[] hoursFullWeeks = new TSeconds[0];
            TSeconds[] hoursRealWeeks = new TSeconds[0];
            TSeconds[] hoursFullMonth = new TSeconds[0];
            TSeconds[] hoursRealMonth = new TSeconds[0];

            if (conceptValues.ScheduleType == WorkScheduleType.SCHEDULE_NORMALY_WEEK)
            {
                hoursFullWeeks = conceptProfile.TimesheetWeekSchedule(evalPeriod, conceptValues.ShiftLiable, 5);
                hoursRealWeeks = conceptProfile.TimesheetWeekSchedule(evalPeriod, conceptValues.ShiftActual, 5);
                hoursFullMonth = conceptProfile.TimesheetFullSchedule(evalPeriod, hoursFullWeeks);
                hoursRealMonth = conceptProfile.TimesheetFullSchedule(evalPeriod, hoursRealWeeks);
            }
            else
            {
                return(EvaluateUtils.DecoratedErrors(CONCEPT_DESCRIPTION_ERROR_FORMAT, SCHEDULE_TYPE_NOTIMPLEMENTED_TEXT));
            }
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddWorkWeeksFullScheduleValue(hoursFullWeeks);
            conceptResult.AddWorkWeeksRealScheduleValue(hoursRealWeeks);
            conceptResult.AddWorkMonthFullScheduleValue(hoursFullMonth);
            conceptResult.AddWorkMonthRealScheduleValue(hoursRealMonth);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }
예제 #14
0
        public static TSeconds[] ScheduleFromTimesheet(TSeconds[] timesheet, WorkDayPieceType[] pieceForDays, TSeconds[] hoursForDays, TDay from, TDay stop)
        {
            TSeconds[] result = EmptyMonthSchedule();
            for (TDay day = from; day <= stop; day++)
            {
                int indexMonth = day - 1;
                int indexDays  = day - from;
                WorkDayPieceType pieceForDay        = pieceForDays[indexDays];
                TSeconds         hoursForDay        = hoursForDays[indexDays];
                TSeconds         fullHoursTimesheet = timesheet[indexMonth];
                TSeconds         halfHoursTimesheet = fullHoursTimesheet / 2;

                switch (pieceForDay)
                {
                case WorkDayPieceType.WORKDAY_NONE:
                    result[indexMonth] = 0;
                    break;

                case WorkDayPieceType.WORKDAY_FULL:
                    result[indexMonth] = (fullHoursTimesheet);
                    break;

                case WorkDayPieceType.WORKDAY_HALF:
                    result[indexMonth] = (halfHoursTimesheet);
                    break;

                case WorkDayPieceType.WORKDAY_TIME:
                    result[indexMonth] = hoursForDay;
                    break;

                default:
                    result[indexMonth] = 0;
                    break;
                }
            }
            return(result);
        }
 public TSeconds[] TimesheetWeekSchedule(Period period, TSeconds secondsWeekly, TDays workdaysWeekly)
 {
     return(OperationsPeriod.WeekSchedule(period, secondsWeekly, workdaysWeekly));
 }
예제 #16
0
        public static TSeconds TotalMonthHours(TSeconds[] template)
        {
            TSeconds result = template.Take(31).Aggregate(0, (agr, x) => (agr + x));

            return(result);
        }
 public PositionTimesheetSource()
 {
     HoursSchedule = new TSeconds[0];
     HoursInPeriod = new TSeconds[0];
 }
예제 #18
0
        public static int WorkingSecondsWeekly(TDays workingDays, THours workingHours)
        {
            TSeconds secondsDaily = WorkingSecondsDaily(workingHours);

            return(workingDays * secondsDaily);
        }
예제 #19
0
        public static int WorkingSecondsDaily(THours workingHours)
        {
            TSeconds secondsInHour = (TIME_MULTIPLY_SIXTY * TIME_MULTIPLY_SIXTY);

            return(workingHours * secondsInHour);
        }
예제 #20
0
 public PositionScheduleSource(TSeconds shiftLiable, TSeconds shiftActual, WorkScheduleType scheduleType)
 {
     ShiftLiable  = shiftLiable;
     ShiftActual  = shiftActual;
     ScheduleType = scheduleType;
 }
 public TSeconds TotalHoursForSalary(Period period, TSeconds fulltimeHour, TSeconds workingHours, TSeconds absenceHours)
 {
     return((TSeconds)0);
 }
 public EvaluateSource()
 {
     ScheduleMonth = new TSeconds[0];
     AbsencesMonth = new TSeconds[0];
 }
예제 #23
0
 public EvaluateSource()
 {
     DayTermFrom    = 0;
     DayTermStop    = 0;
     RealMonthHours = new TSeconds[0];
 }