Пример #1
0
 public void CheckBeforeReport()
 {
     if (AvPayCalc == null)
     {
         AvPayCalc = new AvPayCalcInfo(true);
     }
     if (SickDayCalc == null)
     {
         SickDayCalc = new SickDayCalcInfo(true);
     }
     if (VacationCalc == null)
     {
         VacationCalc = new VacationCalcInfo(true, SI._CALC_VER);
     }
     if (WorkPayCalc == null)
     {
         WorkPayCalc = new WorkPayCalcInfo(true);
     }
     if (CalcR == null)
     {
         CalcR = new CalcRInfo(true, SI._CALC_VER);
     }
     if (BonusCalc == null)
     {
         BonusCalc = new BonusCalcInfo(CalcR, (KlonsADataSet.SALARY_PLUSMINUSRow[])null, true);
     }
 }
Пример #2
0
        private void PrepareListT(VacationCalcInfo[] vcs, string[] positions, VacationCalcInfo totalvc)
        {
            if (totalvc.Rows.Count == 0)
            {
                return;
            }

            var Rows2 = new List <VacationCalcRow>();

            Rows2.Add(new VacationCalcRow()
            {
                Caption = "Kopsummas"
            });
            Rows2.AddRange(totalvc.Rows);

            var emptyrow = new VacationCalcRow()
            {
            };

            for (int i = 0; i < vcs.Length; i++)
            {
                Rows2.Add(emptyrow);
                Rows2.Add(new VacationCalcRow()
                {
                    Caption = positions[i]
                });
                Rows2.AddRange(vcs[i].Rows);
            }
            Rows = Rows2;
        }
Пример #3
0
        public ErrorList CalcVacationDays()
        {
            VacationCalc = new VacationCalcInfo(PreparingReport, SI._CALC_VER);

            var err = VacationCalc.CalcVacationDays(this);

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

            return(new ErrorList());
        }
Пример #4
0
        public ErrorList CalcVacationDays()
        {
            VacationCalc = new VacationCalcInfo(PreparingReport, TotalSI._CALC_VER);
            VacationCalc.SetAvPayFrom(this);
            var err = VacationCalc.CalcVacationDaysT(this);

            if (err.HasErrors)
            {
                return(err);
            }
            VacationCalc.SetAvPayTo(this);
            VacationCalc.WriteTo(SRS.TotalPersonPay);
            return(new ErrorList());
        }
Пример #5
0
 public void SetAvPayFrom(VacationCalcInfo vc)
 {
     if (vc.AvPayCalc != null)
     {
         AvPayCalc = vc.AvPayCalc;
     }
     if (IsAvPayCalcDone)
     {
         return;
     }
     IsAvPayCalcDone      = vc.IsAvPayCalcDone;
     AvPayRateHour        = vc.AvPayRateHour;
     AvPayRateDay         = vc.AvPayRateDay;
     AvPayRateCalendarDay = vc.AvPayRateCalendarDay;
 }
Пример #6
0
        public void SumTotals(VacationCalcInfo[] vcs, VacationCalcInfo totalvc)
        {
            VcrPrevCurrent  = new VacationCalcRow("A: izmaksāts iepriekš");
            VcrCurrent      = new VacationCalcRow("B: šajā periodā");
            VcrNext         = new VacationNextCalcRow("C: aprēķināts avansā");
            VcrCompensation = new VacationCalcRow("D: kompensācija");

            foreach (var vc in vcs)
            {
                VcrPrevCurrent.Add(vc.VcrPrevCurrent);
                VcrCurrent.Add(vc.VcrCurrent);
                VcrCompensation.Add(vc.VcrCompensation);
                VcrNext.Add(vc.VcrNext);
            }

            VcrPrevCurrent.Days  = totalvc.VcrPrevCurrent.Days;
            VcrCurrent.Days      = totalvc.VcrCurrent.Days;
            VcrCompensation.Days = totalvc.VcrCompensation.Days;
            VcrNext.Days         = totalvc.VcrNext.Days;
        }
Пример #7
0
        private void PrepareListB(SalarySheetRowInfo sr, VacationCalcInfo totalvc)
        {
            if (totalvc.Rows.Count == 0)
            {
                return;
            }
            var rows2 = new List <VacationCalcRow>();
            var r1    = new VacationCalcRow();

            r1.Caption = "Kopā";
            rows2.Add(r1);
            rows2.AddRange(totalvc.Rows);

            rows2.Add(new VacationCalcRow());

            r1         = new VacationCalcRow();
            r1.Caption = sr.GetPositionTitle();
            rows2.Add(r1);
            rows2.AddRange(Rows);
            Rows = rows2;
        }
Пример #8
0
        public ErrorList CalcVacationDaysT(SalaryCalcTInfo scti)
        {
            ErrorList err;
            var       sr = scti.SRS.TotalRow;

            sr.CheckLinkedRows(sr.Row.IDP);
            SetAvPayFrom(scti);

            if (sr.IsSingleRow())
            {
                var lsci = scti.LinkedSCI[0];

                err = CalcVacationDays(lsci);
                if (err.HasErrors)
                {
                    return(err);
                }

                SetAvPayTo(scti);
                SetAvPayTo(lsci);
                WriteTo(lsci.SI);
                WriteTo(scti.TotalSI);
                if (PreparingReport)
                {
                    scti.LinkedSCI[0].VacationCalc = this;
                }
                return(err);
            }

            if (sr.Row.XType != ESalarySheetRowType.Total)
            {
                throw new Exception("Bad call");
            }

            GetAvPayCalc(scti.SRS.TotalRow);

            var vcs = new VacationCalcInfo[scti.LinkedSCI.Length];

            for (int i = 0; i < scti.LinkedSCI.Length; i++)
            {
                var vc = new VacationCalcInfo(PreparingReport, CalcVer);
                vcs[i] = vc;
                vc.SetAvPayFrom(this);
            }

            err = CalcVacationDays2(scti.SRS.TotalRow, vcs, scti.TotalSI._CALC_VER);
            if (err.HasErrors)
            {
                return(err);
            }

            SetAvPayTo(scti);

            EnsureExactSum(vcs);

            for (int i = 0; i < scti.LinkedSCI.Length; i++)
            {
                var lsci = scti.LinkedSCI[i];
                var lr   = scti.SRS.LinkedRows[i];
                var vc   = vcs[i];
                lsci.VacationCalc = vc;
                vc.WriteTo(lsci.SI);
            }

            WriteTo(scti.TotalSI);

            if (PreparingReport)
            {
                var positions = new string[scti.LinkedSCI.Length];
                for (int i = 0; i < scti.LinkedSCI.Length; i++)
                {
                    var lsci = scti.LinkedSCI[i];
                    positions[i] = lsci.PositionTitle;
                }
                PrepareListT(vcs, positions, this);
            }

            return(err);
        }