Esempio n. 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);
     }
 }
Esempio n. 2
0
        public void SetCurrentRates(DateTime dt)
        {
            var dr_persons_r = DataTasks.GetPersonsR(IDP, dt);
            var dr_rates     = DataTasks.GetRates(dt);

            if (dr_persons_r == null || dr_rates == null)
            {
                return;
            }
            var cr = new CalcRRow2();

            CalcRInfo.GetRatesForPerson(cr, dr_persons_r, dr_rates, dt);
            CalcRInfo.GetIINDeductionsForPerson(cr, dr_persons_r, dr_rates, dt);
            ExDependants        = cr.ExDependants;
            ExInvalidity        = cr.ExInvalidity;
            ExNationalMovements = cr.ExNationalMovements;
            ExRetaliation       = cr.ExRetaliation;
            ExUntaxedMinimum    = cr.ExUntaxedMinimum;
            //Ex2Tp = cr.Ex2Tp;
            RateDDSN             = cr.RateDDSN;
            RateDNSN             = cr.RateDNSN;
            RateIIN              = cr.RateIIN;
            RateIIN2             = cr.RateIIN2;
            UseProgresiveIINRate = cr.UseProgresiveIINRate;
        }
Esempio n. 3
0
        public void CalcAndAddSplit(SalarySheetRowInfo sr, VacationCalcRow v, int calcver)
        {
            var pcri = new CalcRInfo(false, calcver);

            pcri.CalcR(sr, v.DateStart, v.DateEnd);
            v.DNS  = KlonsData.RoundA(pcri.RateDNSN * v.Pay / 100.0M, 2);
            v.Cash = v.Pay - v.DNS;
            Add(v);
        }
Esempio n. 4
0
 public virtual void SetFrom(CalcRInfo from)
 {
     Ir                = from.RateIIN / 100.0M;
     Ir2               = from.RateIIN2 / 100.0M;
     Sr                = from.RateDNSN / 100.0M;
     IM                = from.IINMargin;
     HasTaxDoc         = from.HasTaxDoc;
     HasProgressiveIIN = from.UseProgresiveIINRate;
     IinEx             = from.ExDivided.SumIINExemptsAll();
 }
Esempio n. 5
0
 public void CalcRR(DateTime dt1, DateTime dt2, int calcver)
 {
     CalcR = new CalcRInfo(PreparingReport, calcver);
     CalcR.CalcR(SR, dt1, dt2);
     CalcR.ExMax2.ApplyTo0(SI);
     CalcR.ExMax2.ApplyTo(SI);
     SI._RATE_DDSN = CalcR.RateDDSN;
     SI._RATE_DNSN = CalcR.RateDNSN;
     SI._RATE_IIN  = CalcR.RateIIN;
     SI._RATE_IIN2 = CalcR.RateIIN2;
 }
Esempio n. 6
0
 public BonusCalcInfo(CalcRInfo cri, KlonsADataSet.SALARY_PLUSMINUSRow[] rows, bool fillist = false)
 {
     CalcR    = cri;
     DataRows = rows;
     MakePfx();
     PreparingReport = fillist;
     if (PreparingReport)
     {
         ReportRows = new List <BonusCalcRow>();
     }
 }
Esempio n. 7
0
        public void CalcAndAdd(SalarySheetRowInfo sr, VacationCalcRow v,
                               decimal AvPayRateDay, int calcver)
        {
            v.AvPayRate = AvPayRateDay;
            v.Pay       = KlonsData.RoundA(AvPayRateDay * (decimal)v.Days, 2);
            var pcri = new CalcRInfo(false, calcver);

            pcri.CalcR(sr, v.DateStart, v.DateEnd);
            v.DNS  = KlonsData.RoundA(pcri.RateDNSN * v.Pay / 100.0M, 2);
            v.Cash = v.Pay - v.DNS;
            Add(v);
        }
Esempio n. 8
0
        public PayFx CalcAll(SalarySheetRowInfo sr, VacationCalcRow v, int calcver)
        {
            var cri = new CalcRInfo(false, calcver);

            cri.CalcR(sr, v.DateStart, v.DateEnd);
            var pfx = new PayFx(cri);

            if (cri.UseProgresiveIINRate)
            {
                pfx.IinEx = 0.0M;
            }
            else
            {
                pfx.IinEx = cri.ExMax2.SumIINExempts();
            }
            pfx.Pay = v.Pay;
            pfx.CalcAllAndRound();
            v.DNS   = pfx.DNS;
            v.IINEX = pfx.UsedIinEx;
            v.IIN   = pfx.IIN;
            v.Cash  = pfx.Cash;
            return(pfx);
        }
Esempio n. 9
0
 public PayFx(CalcRInfo cri)
 {
     SetFrom(cri);
 }
Esempio n. 10
0
        public List <KeyValuePair <DateTime, CalcRRow2> > GetDatesAndRates(DateTime dte)
        {
            var table_persons    = MyData.DataSetKlons.PERSONS;
            var table_persons_r  = MyData.DataSetKlons.PERSONS_R;
            var table_events     = MyData.DataSetKlons.EVENTS;
            var table_rates      = MyData.DataSetKlons.RATES;
            var table_untaxedmin = MyData.DataSetKlons.UNTAXED_MIN;

            var dr_person     = table_persons.FindByID(IDP);
            var drs_persons_r = dr_person.GetPERSONS_RRows()
                                .OrderBy(d => d.EDIT_DATE)
                                .ToArray();

            var drs_events = dr_person.GetEVENTSRows();

            var drsn_hirefire = drs_events
                                .Where(d =>
                                       Utils.IN(d.IDN, (int)EEventId.Pieņemts, (int)EEventId.Atlaists))
                                .OrderBy(d => d.DATE1)
                                .ToArray();

            if (drsn_hirefire.Length == 0)
            {
                return(null);
            }

            DateTime dt1, dt2;

            var dd = new DateList();

            for (int i = 0; i < drsn_hirefire.Length; i += 2)
            {
                dt1 = drsn_hirefire[i].DATE1;
                dt2 = i + 1 == drsn_hirefire.Length ?
                      dte :
                      drsn_hirefire[i].DATE1;
                dd.List.Add(new DatesFromTo(dt1, dt2));
            }

            dt1 = dd.List[0].DateFrom;
            dt2 = dd.List[dd.List.Count - 1].DateTo;

            var drsn_hire = drsn_hirefire
                            .Where(d =>
                                   d.IDN == (int)EEventId.Pieņemts)
                            .OrderBy(d => d.DATE1)
                            .ToArray();

            var drs_rates_ordered = table_rates
                                    .WhereX(d =>
                                            d.ONDATE <= dte)
                                    .OrderBy(d => d.ONDATE)
                                    .ToArray();

            var drs_rates = drs_rates_ordered
                            .Where(d =>
                                   dd.HasDate(d.ONDATE))
                            .ToArray();

            var drs_untaxedmin = table_untaxedmin
                                 .WhereX(d => d.ONDATE <= dte)
                                 .OrderBy(d => d.ONDATE)
                                 .ToArray();

            var l_dates = new List <DateTime>();

            l_dates.AddRange(drsn_hire.Select(d => d.DATE1));
            l_dates.AddRange(drs_persons_r.Select(d => d.EDIT_DATE));
            l_dates.AddRange(drs_rates.Select(d => d.ONDATE));
            l_dates.AddRange(drs_untaxedmin.Select(d => d.ONDATE));
            l_dates.Sort();
            var a_dates = l_dates.DistinctForOrdered().ToArray();

            var list_ret = new List <KeyValuePair <DateTime, CalcRRow2> >();

            foreach (var dti in a_dates)
            {
                var dr_pr = drs_persons_r
                            .Where(d => d.EDIT_DATE <= dti)
                            .LastOrDefault();
                var dr_rt = drs_rates_ordered
                            .Where(d => d.ONDATE <= dti)
                            .LastOrDefault();
                if (dr_pr == null || dr_rt == null)
                {
                    continue;
                }
                var cr = new CalcRRow2();
                CalcRInfo.GetRatesForPerson(cr, dr_pr, dr_rt, dti);
                CalcRInfo.GetIINDeductionsForPerson(cr, dr_pr, dr_rt, dti);
                if (list_ret.Count > 0 && list_ret[list_ret.Count - 1].Value.Equals(cr))
                {
                    continue;
                }
                list_ret.Add(new KeyValuePair <DateTime, CalcRRow2>(dti, cr));
            }

            return(list_ret);
        }
Esempio n. 11
0
 public PayFxA(CalcRInfo cri) : base(cri)
 {
 }
Esempio n. 12
0
 public PayFxB(CalcRInfo cri) : base(cri)
 {
     Position = "KOPĀ";
 }