Exemple #1
0
        public ErrorList CalcSickDays()
        {
            TotalSI._SICKDAYS     = 0;
            TotalSI._SICKDAYS_PAY = 0.0M;

            var sc = new SickDayCalcInfo(PreparingReport);

            sc.SetAvPayFrom(this);

            var err = sc.CalcSickDaysT(this);

            if (err.HasErrors)
            {
                return(err);
            }

            sc.SetAvPayTo(this);

            if (sc.TotalRow.DaysCount == 0)
            {
                return(err);
            }

            TotalSI._SICKDAYS     = sc.TotalRow.DaysCount;
            TotalSI._SICKDAYS_PAY = sc.TotalRow.SickDayPay;

            if (PreparingReport)
            {
                SickDayCalc = sc;
            }

            return(new ErrorList());
        }
Exemple #2
0
        public ErrorList CalcSickDaysT(SalaryCalcTInfo scti)
        {
            var sr = scti.SRS.TotalRow;

            sr.CheckLinkedRows(sr.Row.IDP);

            var err = new ErrorList();

            scti.TotalSI._SICKDAYS     = 0;
            scti.TotalSI._SICKDAYS_PAY = 0.0M;

            if (sr.IsSingleRow())
            {
                err = CalcSickDaysB(sr, null);
                if (err.HasErrors)
                {
                    return(err);
                }

                scti.TotalSI._SICKDAYS     = TotalRow.DaysCount;
                scti.TotalSI._SICKDAYS_PAY = TotalRow.SickDayPay;

                if (PreparingReport)
                {
                    scti.LinkedSCI[0].SickDayCalc = this;
                }
                return(err);
            }

            TotalSDCI = new SickDayCalcInfo(PreparingReport);
            TotalSDCI.SetAvPayFrom(this);
            err = TotalSDCI.CalcSickDaysA(sr.SalarySheetRowSet);
            if (err.HasErrors)
            {
                return(err);
            }
            SetAvPayFrom(TotalSDCI);

            if (TotalSDCI.TotalRow.DaysCount == 0)
            {
                new ErrorList();
            }


            SickDayCalcInfo[] sdcs      = null;
            string[]          positions = null;

            var srs = sr.SalarySheetRowSet;

            sdcs      = new SickDayCalcInfo[srs.LinkedRows.Length];
            positions = new string[srs.LinkedRows.Length];

            for (int i = 0; i < srs.LinkedRows.Length; i++)
            {
                var lr  = srs.LinkedRows[i];
                var sci = scti.LinkedSCI[i];
                var sdc = new SickDayCalcInfo(PreparingReport);
                positions[i] = lr.GetPositionTitle();
                sdcs[i]      = sdc;
                sdc.SetAvPayFrom(this);

                sci.SI._SICKDAYS     = 0;
                sci.SI._SICKDAYS_PAY = 0.0M;

                err = sdc.CalcSickDaysB(lr, TotalSDCI);
                if (err.HasErrors)
                {
                    return(err);
                }

                sci.SI._SICKDAYS     = sdc.TotalRow.DaysCount;
                sci.SI._SICKDAYS_PAY = sdc.TotalRow.SickDayPay;

                if (PreparingReport)
                {
                    sci.SickDayCalc = sdc;
                }
            }
            SumTotalPay(sdcs, TotalSDCI);

            scti.TotalSI._SICKDAYS     = TotalRow.DaysCount;
            scti.TotalSI._SICKDAYS_PAY = TotalRow.SickDayPay;

            if (PreparingReport)
            {
                PrepareListT(sdcs, positions);
            }

            return(new ErrorList());
        }
Exemple #3
0
        public ErrorList CalcSickDays(SalarySheetRowInfo sr)
        {
            var err = sr.CheckLinkedRows(sr.Row.IDP);

            if (err.HasErrors)
            {
                return(err);
            }

            if (sr.IsSingleRow())
            {
                err = CalcSickDaysB(sr, null);
                return(err);
            }

            TotalSDCI = new SickDayCalcInfo(PreparingReport);
            err       = TotalSDCI.CalcSickDaysA(sr.SalarySheetRowSet);
            if (err.HasErrors)
            {
                return(err);
            }

            if (TotalSDCI.TotalRow.DaysCount == 0)
            {
                new ErrorList();
            }

            SetAvPayFrom(TotalSDCI);

            SickDayCalcInfo[] sdcs      = null;
            string[]          positions = null;

            if (sr.Row.XType == ESalarySheetRowType.Total)
            {
                var srs = sr.SalarySheetRowSet;

                sdcs      = new SickDayCalcInfo[srs.LinkedRows.Length];
                positions = new string[srs.LinkedRows.Length];

                for (int i = 0; i < srs.LinkedRows.Length; i++)
                {
                    var lr  = srs.LinkedRows[i];
                    var sdc = new SickDayCalcInfo(PreparingReport);
                    positions[i] = lr.GetPositionTitle();
                    sdcs[i]      = sdc;
                    sdc.SetAvPayFrom(this);

                    err = sdc.CalcSickDaysB(lr, TotalSDCI);
                    if (err.HasErrors)
                    {
                        return(err);
                    }
                }
                SumTotalPay(sdcs, TotalSDCI);
                if (PreparingReport)
                {
                    PrepareListT(sdcs, positions);
                }
            }
            else
            {
                if (PreparingReport)
                {
                    PrepareListA(sr.GetPositionTitle());
                }
                err = CalcSickDaysB(sr, TotalSDCI);
                if (err.HasErrors)
                {
                    return(err);
                }
            }

            return(new ErrorList());
        }