Example #1
0
        //table details
        private void AddBodyTableDetail(DAL.psuedovwPayrollMaster pay, ref int row, ref int col)
        {
            row++; col = 1;
            string cellrangeaddr1 = document.IntAlpha(col) + row;

            document.createHeaders(row, col, pay.EmpNo, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, pay.Surname, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, pay.OtherNames, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, pay.IDNo, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, pay.PINNo, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, pay.PayeTax.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
        }
Example #2
0
        //table details
        private void AddBodyTableDetails(DAL.psuedovwPayrollMaster nhifRec, Table nhifTable)
        {
            Cell A = new Cell(new Phrase(nhifRec.EmpNo, helv8Font));

            A.HorizontalAlignment = Cell.ALIGN_LEFT;
            nhifTable.AddCell(A);//Col 1

            Cell B = new Cell(new Phrase(nhifRec.Surname, helv8Font));

            B.HorizontalAlignment = Cell.ALIGN_LEFT;
            nhifTable.AddCell(B);//Col 2

            Cell C = new Cell(new Phrase(nhifRec.OtherNames, helv8Font));

            C.HorizontalAlignment = Cell.ALIGN_LEFT;
            nhifTable.AddCell(C);//Col 3

            Cell D = new Cell(new Phrase(nhifRec.IDNo, helv8Font));

            D.HorizontalAlignment = Cell.ALIGN_LEFT;
            nhifTable.AddCell(D);//Col 4

            Cell E1 = new Cell(new Phrase(nhifRec.NHIFNo, helv8Font));

            E1.HorizontalAlignment = Cell.ALIGN_LEFT;
            nhifTable.AddCell(E1);//Col 5

            Cell E2 = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", nhifRec.NHIF), helv8Font));

            E2.HorizontalAlignment = Cell.ALIGN_RIGHT;
            nhifTable.AddCell(E2);//Col 6
        }
        private void BodAddTableDetail(DAL.psuedovwPayrollMaster rec, ref int row, ref int col)
        {
            row++; col = 1;
            string cellrangeaddr1 = document.IntAlpha(col) + row;

            document.createHeaders(row, col, rec.EmpNo, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.Surname.Trim() + ",  " + rec.OtherNames.Trim(), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.BankName + " - " + rec.BranchName, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.Department, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.BasicPay.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");


            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.GrossTaxableEarnings.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.PayeTax.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.NSSF.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.NHIF.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.OtherDeductions.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            decimal tDeductions = rec.PayeTax + rec.NHIF + rec.NSSF + rec.OtherDeductions;

            document.createHeaders(row, col, tDeductions.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.NetPay.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
        }
Example #4
0
        //table details
        private void AddBodyTableDetails(DAL.psuedovwPayrollMaster nssfRec, Table nssfTable)
        {
            Cell A = new Cell(new Phrase(nssfRec.EmpNo, helv8Font));

            A.HorizontalAlignment = Cell.ALIGN_LEFT;
            nssfTable.AddCell(A);//Col 1

            Cell B = new Cell(new Phrase(nssfRec.Surname, helv8Font));

            B.HorizontalAlignment = Cell.ALIGN_LEFT;
            nssfTable.AddCell(B);//Col 2

            Cell C = new Cell(new Phrase(nssfRec.OtherNames, helv8Font));

            C.HorizontalAlignment = Cell.ALIGN_LEFT;
            nssfTable.AddCell(C);//Col 3

            Cell D = new Cell(new Phrase(nssfRec.IDNo, helv8Font));

            D.HorizontalAlignment = Cell.ALIGN_LEFT;
            nssfTable.AddCell(D);//Col 4

            Cell E1 = new Cell(new Phrase(nssfRec.NSSFNo, helv8Font));

            E1.HorizontalAlignment = Cell.ALIGN_LEFT;
            nssfTable.AddCell(E1);//Col 5

            Cell E2 = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", nssfRec.NSSF), helv8Font));

            E2.HorizontalAlignment = Cell.ALIGN_RIGHT;
            nssfTable.AddCell(E2);//Col 6

            //switch (rep.SettingLookup("NSSFCOMPUTATIONMETHOD").ToUpper())
            //{
            //    case "OLD":
            //        Cell E2 = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", nssfRec.NSSF + nssfRec.EmployerNSSF), helv8Font));
            //        E2.HorizontalAlignment = Cell.ALIGN_RIGHT;
            //        nssfTable.AddCell(E2);//Col 6
            //        break;
            //    case "NEW":
            //        int lowerearninglimit = int.Parse(rep.SettingLookup("NSSFMINLOWEREARNINGLIMIT"));
            //        int upperearninglimit = int.Parse(rep.SettingLookup("NSSFMAXUPPEREARNINGLIMIT"));
            //        decimal _employeecontributionamount = nssfRec.NSSF;
            //        decimal _employercontributionamount = nssfRec.EmployerNSSF;
            //        decimal _employeecontributionpecentage = int.Parse(rep.SettingLookup("NSSFEMPLOYEECONTRIBUTIONPERCENTAGE"));
            //        decimal _employercontributionpercentage = int.Parse(rep.SettingLookup("NSSFEMPLOYERCONTRIBUTIONPERCENTAGE"));
            //        NssfContributionsDTO _NssfContributionsDTO = rep.ComputeNssfContributions(nssfRec.EmpNo);
            //        Cell E3 = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", _NssfContributionsDTO.TotalPensionContribution), helv8Font));
            //        E3.HorizontalAlignment = Cell.ALIGN_RIGHT;
            //        nssfTable.AddCell(E3);//Col 6
            //        break;
            //}
        }
Example #5
0
        private void BodAddTableDetail(DAL.psuedovwPayrollMaster rec, Table payrollMasterTable)
        {
            Cell enoCell = new Cell(new Phrase(rec.EmpNo, helv8Font));

            enoCell.HorizontalAlignment = Cell.ALIGN_LEFT;
            payrollMasterTable.AddCell(enoCell);

            Cell enameCell = new Cell(new Phrase(rec.Surname + ",  " + rec.OtherNames, helv8Font));

            enameCell.HorizontalAlignment = Cell.ALIGN_LEFT;
            payrollMasterTable.AddCell(enameCell);

            Cell c1Cell = new Cell(new Phrase(rec.BankName + " - " + rec.BranchName, helv8Font));

            c1Cell.HorizontalAlignment = Cell.ALIGN_LEFT;
            payrollMasterTable.AddCell(c1Cell);

            Cell c2Cell = new Cell(new Phrase(rec.Department, helv8Font));

            c2Cell.HorizontalAlignment = Cell.ALIGN_LEFT;
            payrollMasterTable.AddCell(c2Cell);

            Cell pCell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.BasicPay), helv8Font));

            pCell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(pCell);


            Cell t1Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.GrossTaxableEarnings), helv8Font));

            t1Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(t1Cell);

            Cell d1Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.PayeTax), helv8Font));

            d1Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d1Cell);

            Cell d2Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.NSSF), helv8Font));

            d2Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d2Cell);

            Cell d3Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.NHIF), helv8Font));

            d3Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d3Cell);

            Cell d4Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.OtherDeductions), helv8Font));

            d4Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d4Cell);

            decimal tDeductions = rec.PayeTax + rec.NHIF + rec.NSSF + rec.OtherDeductions;
            Cell    d5Cell      = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", tDeductions), helv8Font));

            d5Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d5Cell);

            Cell d6Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.NetPay), helv8Font));

            d6Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d6Cell);
        }
        private void BodAddTableDetail(DAL.psuedovwPayrollMaster rec, ref int row, ref int col)
        {
            row++; col = 1;
            string cellrangeaddr1 = document.IntAlpha(col) + row;

            document.createHeaders(row, col, rec.EmpNo, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.Surname.Trim() + ",  " + rec.OtherNames.Trim(), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            foreach (var sub in this._earnings)
            {
                var _rec = rec.GetMainEarnings.Where(s => s.Description == sub).SingleOrDefault();
                if (_rec != null)
                {
                    decimal item = decimal.Parse(_rec.Amount.ToString());

                    col++;
                    cellrangeaddr1 = document.IntAlpha(col) + row;
                    document.createHeaders(row, col, item.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
                }
                else
                {
                    col++;
                    cellrangeaddr1 = document.IntAlpha(col) + row;
                    document.createHeaders(row, col, "0", cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
                }
            }

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.GrossTaxableEarnings.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            foreach (var sub in this._deductions)
            {
                var _rec = rec.GetOtherDeductions.Where(s => s.Description == sub).SingleOrDefault();
                if (_rec != null)
                {
                    decimal item = decimal.Parse(_rec.Amount.ToString());

                    col++;
                    cellrangeaddr1 = document.IntAlpha(col) + row;
                    document.createHeaders(row, col, item.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
                }
                else
                {
                    col++;
                    cellrangeaddr1 = document.IntAlpha(col) + row;
                    document.createHeaders(row, col, "0", cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
                }
            }

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            decimal tDeductions = rec.PayeTax + rec.NHIF + rec.NSSF + rec.OtherDeductions;

            document.createHeaders(row, col, tDeductions.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, rec.NetPay.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
        }
        private void BodAddTableDetail(DAL.psuedovwPayrollMaster rec, Table payrollMasterTable)
        {
            Cell enoCell = new Cell(new Phrase(rec.EmpNo, helv8Font));

            enoCell.HorizontalAlignment = Cell.ALIGN_LEFT;
            payrollMasterTable.AddCell(enoCell);

            Cell enameCell = new Cell(new Phrase(rec.Surname + ",  " + rec.OtherNames, helv8Font));

            enameCell.HorizontalAlignment = Cell.ALIGN_LEFT;
            payrollMasterTable.AddCell(enameCell);


            foreach (var sub in this._earnings)
            {
                var _rec = rec.GetMainEarnings.Where(s => s.Description == sub).SingleOrDefault();
                if (_rec != null)
                {
                    decimal item = decimal.Parse(_rec.Amount.ToString());

                    Cell markCell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", item), helv8Font));
                    markCell.Border = Cell.RECTANGLE;
                    markCell.HorizontalAlignment = Cell.ALIGN_RIGHT;
                    payrollMasterTable.AddCell(markCell);
                }
                else
                {
                    Cell markCell = new Cell(new Phrase("0", helv8Font));
                    markCell.Border = Cell.RECTANGLE;
                    markCell.HorizontalAlignment = Cell.ALIGN_RIGHT;
                    payrollMasterTable.AddCell(markCell);
                }
            }

            Cell t1Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.GrossTaxableEarnings), helv8Font));

            t1Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(t1Cell);

            foreach (var sub in this._deductions)
            {
                var _rec = rec.GetOtherDeductions.Where(s => s.Description == sub).SingleOrDefault();
                if (_rec != null)
                {
                    decimal item = decimal.Parse(_rec.Amount.ToString());

                    //if(sub.Equals("NSSF"))
                    //{
                    //    switch (rep.SettingLookup("NSSFCOMPUTATIONMETHOD").ToUpper())
                    //    {
                    //        case "OLD":
                    //            break;
                    //        case "NEW":
                    //            int lowerearninglimit = int.Parse(rep.SettingLookup("NSSFMINLOWEREARNINGLIMIT"));
                    //            int upperearninglimit = int.Parse(rep.SettingLookup("NSSFMAXUPPEREARNINGLIMIT"));
                    //            decimal _employeecontributionpecentage = int.Parse(rep.SettingLookup("NSSFEMPLOYEECONTRIBUTIONPERCENTAGE"));
                    //            decimal _employercontributionpercentage = int.Parse(rep.SettingLookup("NSSFEMPLOYERCONTRIBUTIONPERCENTAGE"));
                    //            NssfContributionsDTO _NssfContributionsDTO = rep.ComputeNssfContributions(rec.EmpNo);
                    //            item = _NssfContributionsDTO.TotalPensionContribution;
                    //            break;
                    //    }
                    //}

                    Cell markCell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", item), helv8Font));
                    markCell.Border = Cell.RECTANGLE;
                    markCell.HorizontalAlignment = Cell.ALIGN_RIGHT;
                    payrollMasterTable.AddCell(markCell);
                }
                else
                {
                    Cell markCell = new Cell(new Phrase("0", helv8Font));
                    markCell.Border = Cell.RECTANGLE;
                    markCell.HorizontalAlignment = Cell.ALIGN_RIGHT;
                    payrollMasterTable.AddCell(markCell);
                }
            }

            Cell loanCell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.TotalLoansDeductions), helv8Font));

            loanCell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(loanCell);

            Cell saccoCell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.TotalSACCODeductions), helv8Font));

            saccoCell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(saccoCell);

            decimal tDeductions = rec.PayeTax + rec.NHIF + rec.NSSF + rec.OtherDeductions;
            Cell    d5Cell      = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", tDeductions), helv8Font));

            d5Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d5Cell);

            Cell d6Cell = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", rec.NetPay), helv8Font));

            d6Cell.HorizontalAlignment = Cell.ALIGN_RIGHT;
            payrollMasterTable.AddCell(d6Cell);
        }