private List <EmployersMonthlyTaxRecord> GetEmployeeMonthlyTax() { try { System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo(); List <EmployersMonthlyTaxRecord> empTax = new List <EmployersMonthlyTaxRecord>(); List <EmployersMonthlyTaxRecord> taxrec = rep.GetEmployerTaxRecord(current, _EmployeeId, _EmpNo, _year); foreach (EmployersMonthlyTaxRecord pm in taxrec) { EmployersMonthlyTaxRecord tr = new EmployersMonthlyTaxRecord(); //populate tr.MonthInt = pm.MonthInt; // all periods = month tr.Month = mfi.GetAbbreviatedMonthName(tr.MonthInt); tr.A = pm.A; tr.B = pm.B; tr.C = pm.C; tr.E2 = pm.E2; tr.E3 = decimal.Parse(rep.SettingLookup("DEFCONTR")); decimal maxSavingsPlan = decimal.Parse(rep.SettingLookup("SPLANMAX")); decimal contrSavingsPlan = rep.SavingsPlan(_EmployeeId, _EmpNo); tr.F = Math.Min(maxSavingsPlan, contrSavingsPlan); tr.H = pm.H; tr.J = pm.J; tr.K = pm.K; tr.K1 = pm.K1; //tr.L = computed //add to list empTax.Add(tr); } return(empTax); } catch (Exception ex) { Utils.ShowError(ex); return(null); } }
private void AddTableRow(int Month, Table aTable, EmployersMonthlyTaxRecord monthRecs) { try { if (monthRecs != null) { //Totals aTable.AddCell(new Phrase(monthRecs.Month, tcFont)); //Col 0 Cell A = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.A), tcFont)); A.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(A);//Col 1 Cell B = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.B), tcFont)); B.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(B);//Col 2 Cell C = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.C), tcFont)); C.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(C);//Col 3 Cell D = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.D), tcFont)); D.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(D);//Col 4 Cell E1 = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.E1), tcFont)); E1.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(E1);//Col 5 Cell E2 = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.E2), tcFont)); E2.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(E2);//Col 6 Cell E3 = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.E3), tcFont)); E3.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(E3);//Col 7 Cell F = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.F), tcFont)); F.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(F);//Col 8 Cell G = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.G), tcFont)); G.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(G);//Col 9 Cell H = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.H), tcFont)); H.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(H);//Col 10 Cell J = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.J), tcFont)); J.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(J);//Col 11 Cell K = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.K), tcFont)); K.Colspan = 2; K.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(K); //Col 12 Cell L = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", monthRecs.L), tcFont)); L.HorizontalAlignment = Cell.ALIGN_RIGHT; aTable.AddCell(L);//Col 13 } } catch (Exception ex) { Utils.ShowError(ex); } }