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); } }
// used only for making report public void CalcWorkPay(SalarySheetRowSetInfo sr, SalaryInfo si = null) { var dt1 = sr.SalarySheet.DT1; var dt2 = sr.SalarySheet.DT2; if (si == null) { TotalRow = new SalaryInfo(); } else { TotalRow = si; } TotalRow._CALENDAR_DAYS = sr.SalarySheet.CalendarMonth.DaysInMonth; TotalRow._CALENDAR_DAYS_USE = sr.CountCalendarDays(); var dlrowlist = sr.GetDLRowSetList(); dlrowlist.CountPlanMonth(TotalRow, sr.SalarySheet.MDT1, sr.SalarySheet.MDT2); dlrowlist.CountTotalPlan(TotalRow, sr.SalarySheet.MDT1, sr.SalarySheet.MDT2); dlrowlist.CountTotalFact(TotalRow, sr.SalarySheet.MDT1, sr.SalarySheet.MDT2); LinkedWorkPayCalcs = new WorkPayCalcInfo[sr.LinkedRows.Length]; for (int i = 0; i < sr.LinkedRows.Length; i++) { var lr = sr.LinkedRows[i]; var si2 = new SalaryInfo(); var wpc = new WorkPayCalcInfo(PreparingReport); wpc.CalcWorkPay(lr, si2); TotalRow.AddSalary(si2); if (wpc.AvPayCalcRequired) { AvPayCalcRequired = true; } wpc.PositionTitle = lr.GetPositionTitle(); LinkedWorkPayCalcs[i] = wpc; } TotalRow._SALARY = TotalRow.SumSalary(); TotalRow.SumForAvPay(); if (AvPayCalcRequired) { CalcWorkPayAvPay(sr, TotalRow); } if (PreparingReport) { PrepareListT(); } }
public void MakeWorkTime() { if (SR.Row.XType == ESalarySheetRowType.Total) { throw new Exception("Bad idea."); } WorkPayCalc = new WorkPayCalcInfo(PreparingReport); WorkPayCalc.CalcWorkPay(SR, SI); }
public ErrorList MakeWorkTime2(out AvPayCalcInfo avpaycalc) { avpaycalc = null; var err = WorkPayCalc.CalcPayWithAvPay(SR, null); if (err.HasErrors) { return(err); } if (WorkPayCalc.AvPayCalc != null && WorkPayCalc.AvPayCalc.RateCalendarDay > 0.0M) { avpaycalc = WorkPayCalc.AvPayCalc; } if (!PreparingReport) { WorkPayCalc = null; } return(new ErrorList()); }
public void CalcWorkPayT(SalaryCalcTInfo scti) { TotalRow = scti.TotalSI; var sr = scti.SRS; TotalRow._CALENDAR_DAYS = sr.SalarySheet.CalendarMonth.DaysInMonth; TotalRow._CALENDAR_DAYS_USE = sr.CountCalendarDays(); var dlrowlist = sr.GetDLRowSetList(); dlrowlist.CountPlanMonth(TotalRow, sr.SalarySheet.MDT1, sr.SalarySheet.MDT2); dlrowlist.CountTotalPlan(TotalRow, sr.SalarySheet.MDT1, sr.SalarySheet.MDT2); dlrowlist.CountTotalFact(TotalRow, sr.SalarySheet.MDT1, sr.SalarySheet.MDT2); LinkedWorkPayCalcs = new WorkPayCalcInfo[scti.LinkedSCI.Length]; for (int i = 0; i < scti.LinkedSCI.Length; i++) { var lsci = scti.LinkedSCI[i]; var wpc = new WorkPayCalcInfo(PreparingReport); wpc.CalcWorkPay(lsci.SR, lsci.SI); TotalRow.AddSalary(lsci.SI); if (wpc.AvPayCalcRequired) { AvPayCalcRequired = true; } lsci.WorkPayCalc = wpc; wpc.PositionTitle = lsci.SR.GetPositionTitle(); LinkedWorkPayCalcs[i] = wpc; } TotalRow._SALARY = TotalRow.SumSalary(); TotalRow.SumForAvPay(); if (PreparingReport && !AvPayCalcRequired) { PrepareListT(); } }