コード例 #1
0
 public void Add(VSAOIReportRow1 r)
 {
     Income          += r.Income;
     SAI             += r.SAI;
     IncomeCorrected += r.IncomeCorrected;
     SAICorrected    += r.SAICorrected;
     IIN             += r.IIN;
     URVN            += r.URVN;
 }
コード例 #2
0
 public void SplitRows()
 {
     for (int i = 0; i < 6; i++)
     {
         RowsX[i]      = new List <VSAOIReportRow1>(Rows1.Where(d => d.Tp == i + 1));
         TotalRowsX[i] = new VSAOIReportRow1();
         foreach (var r in RowsX[i])
         {
             TotalRowsX[i].Add(r);
         }
     }
 }
コード例 #3
0
        public void MakeReport(DateTime dt1, DateTime dt2)
        {
            Rows1    = new List <VSAOIReportRow1>();
            TotalRow = new VSAOIReportRow1();

            var dr_sheet = MyData.DataSetKlons.SALARY_SHEETS.WhereX(
                d =>
                d.DT1 >= dt1 &&
                d.DT2 <= dt2 &&
                d.IS_TEMP == 0 &&
                d.XKind == ESalarySheetKind.Total
                ).FirstOrDefault();

            if (dr_sheet == null)
            {
                return;
            }
            bool iinsimple = MyData.Params.IINSimple;

            if (!iinsimple)
            {
                DoMaksSar(dt1, dt2);
            }
            var     drs = dr_sheet.GetSALARY_SHEETS_RRowsByFK_SALARY_SHEETS_R_IDST();
            decimal iin;

            for (int i = 0; i < drs.Length; i++)
            {
                var dr = drs[i];
                var rr = new VSAOIReportRow1();
                rr.Nr = i + 1;
                var drp  = dr.PERSONSRow;
                var drpr = GetPersonR(drp, dt2);
                if (drpr == null)
                {
                    MyData.MyMainForm.ShowWarning(string.Format("Darbineikam {0} nav datu.", drp.YNAME));
                    Rows1    = new List <VSAOIReportRow1>();
                    TotalRow = new VSAOIReportRow1();
                    return;
                }
                rr.SetSAIType(drpr);
                rr.PK = PKForRep(drp.PK);
                if (string.IsNullOrEmpty(rr.PK))
                {
                    rr.PK = drp.BIRTH_DATE.ToString("dd.MM.yyyy");
                }
                rr.Name   = drp.FNAME + " " + drp.LNAME;
                rr.Income = dr.AMOUNT_BEFORE_SN;
                rr.SAI    = dr.SN_AMOUNT;

                if (iinsimple)
                {
                    rr.IIN = dr.IIN_AMOUNT;
                }
                else
                {
                    if (IINInPayLists.TryGetValue(dr.IDP, out iin))
                    {
                        rr.IIN = iin;
                    }
                    else
                    {
                        rr.IIN = 0.0M;
                    }
                }

                rr.IncomeCorrected = dr.AMOUNT_BEFORE_SN_REVERSE;
                rr.SAICorrected    = dr.DDSN_AMOUNT_REVERSE + dr.DNSN_AMOUNT_REVERSE;

                rr.Hours   = dr.FACT_HOURS;
                rr.URVN    = dr.URVN_AMAOUNT;
                rr.HasURVN = rr.URVN > 0.0M;
                Rows1.Add(rr);
                TotalRow.Add(rr);
            }
            Rows1 = new List <VSAOIReportRow1>(Rows1.OrderBy(d => d.Name));
            SplitRows();
        }