using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using Payroll.BO; using Ease.CoreV35.Model; using Ease.Printing; using System.Drawing; using Payroll.Service; namespace Payroll.Report { public class rptIncomeTax { private ID _TaxParameterID; private double _InvestmentAmount = 0.0; private double _TotalTaxAmount = 0.0; private double _LessExemptedAmount = 0.0; private double _PaidTillDateAmount = 0.0; private double _ThisMonthAmount = 0.0; private double _ProjectedAmount = 0.0; private double _AmountPerAnnum = 0.0; private double _TotalSalaryExempted = 0.0; private double _TotalAnnuaExempted = 0.0; private double _TPaidTillDateAmount = 0.0; private double _TThisMonthAmount = 0.0; private double _TProjectedAmount = 0.0; private double _TAmountPerAnnum = 0.0; private Ease.Printing.EPDoc m_oDoc; private double[] m_nXpos; private double[] m_nCXpos; private double[] m_nCXpos2; private double[] m_nExptXpos; private double[] m_nColWidth; private double[] m_nCColWidth; private double[] m_nCColWidth2; private double m_nYpos; private int m_nCurPage; private double m_nTotalWidth; private double m_nCTotalWidth; private double m_nCTotalWidth2; private double _pfInvestment; private double _otherInvestment; private double _investmentAllowed; private double _20Investment; DataSet _dSet = new DataSet(); DataSet _dITSlabs = new DataSet(); ReportItem _item = null; DataTable _dTable = new DataTable(); string RDLC = string.Empty; private ObjectsTemplate _incometaxes; private TaxParameter _taxParameter; private Employee _employee; private ReportSetup _selectedParameter; private bool _investmentwithoutPF; private bool _IsTaxCertificate; private double _actualInvestment; private bool _isPrvs = false; EPPicture _EPPicture = null; ObjectsTemplate _taxParameters = null; public rptIncomeTax() { _taxParameters = new ObjectsTemplate(); _taxParameters = TaxParameter.Get(); _investmentwithoutPF = ConfigurationManager.GetBoolValue("incometax", "investmentwithoutpf", EnumConfigurationType.Logic); } public void showChallan(DataTable oChallans, TaxParameter oParam) { fReportViewer form = new fReportViewer(); PayrollDataSet.PayrollDataSet.ChallanDataTable dTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.ChallanDataTable(); DataRow dr = null; foreach (DataRow oItem in oChallans.Rows) { dr = dTable.NewRow(); dr["SalaryMonth"] = Convert.ToDateTime(oItem[0].ToString()).ToString("MMM yyyy"); dr["ChallanNo"] = oItem[1].ToString(); dr["TotalEmployee"] = oItem[2].ToString(); dTable.Rows.Add(dr); } dTable.TableName = "PayrollDataSet_Challan"; DataSet ds = new DataSet(); ds.Tables.Add(dTable); RDLC = "Payroll.Report.RDLC.rptTaxChallan.rdlc"; form.ShowDlgForChallan(ds, RDLC, oParam.AssessmentYear, oParam.FiscalYear); } private void InitDoc() { m_oDoc.DocumentName = "Income Tax Computation Sheet"; m_oDoc.Device.ScaleMode = EPScaleMode.EPSCentimeters; m_oDoc.Device.PaperKind = System.Drawing.Printing.PaperKind.A4; m_oDoc.Device.Orientation = EPOrientation.EPOPortrait; m_oDoc.DefaultPage.LeftMargin = 1; m_oDoc.DefaultPage.RightMargin = 0.5; m_oDoc.DefaultPage.TopMargin = 1; m_oDoc.DefaultPage.BottomMargin = 0.5; m_oDoc.DefaultText.Font.Name = "Times New Roman"; m_oDoc.DefaultText.Font.Size = 9; m_oDoc.DefaultText.Margin = 0.07; } private void InitWidths() { m_nColWidth = new double[7]; m_nCColWidth = new double[3]; m_nCColWidth2 = new double[4]; m_nXpos = new double[8]; m_nCXpos = new double[4]; m_nCXpos2 = new double[5]; m_nColWidth[0] = 6; m_nColWidth[1] = 2; m_nColWidth[2] = 2; //Paid Till Date m_nColWidth[3] = 2; //This Month m_nColWidth[4] = 2;//Projected m_nColWidth[5] = 2; //Paid Till Date m_nColWidth[6] = 2;//This Month m_nXpos[0] = 0; m_nXpos[1] = m_nXpos[0] + m_nColWidth[0]; m_nXpos[2] = m_nXpos[1] + m_nColWidth[1]; m_nXpos[3] = m_nXpos[2] + m_nColWidth[2]; m_nXpos[4] = m_nXpos[3] + m_nColWidth[3]; m_nXpos[5] = m_nXpos[4] + m_nColWidth[4]; m_nXpos[6] = m_nXpos[5] + m_nColWidth[5]; m_nXpos[7] = m_nXpos[6] + m_nColWidth[6]; m_nTotalWidth = m_nXpos[7]; m_nCColWidth[0] = 6;//Challan m_nCColWidth[1] = 5; //Date m_nCColWidth[2] = 5;//Amount m_nCColWidth2[0] = 5;//Date m_nCColWidth2[1] = 3.5;//Amount m_nCColWidth2[2] = 3.5; //Amount m_nCColWidth2[3] = 4; //Amount m_nCXpos[0] = 1.5; m_nCXpos[1] = m_nCXpos[0] + m_nCColWidth[0]; m_nCXpos[2] = m_nCXpos[1] + m_nCColWidth[1]; m_nCXpos[3] = m_nCXpos[2] + m_nCColWidth[2]; m_nCTotalWidth = m_nCXpos[3] - m_nCXpos[0]; m_nCXpos2[0] = 1.5; m_nCXpos2[1] = m_nCXpos2[0] + m_nCColWidth2[0]; m_nCXpos2[2] = m_nCXpos2[1] + m_nCColWidth2[1]; m_nCXpos2[3] = m_nCXpos2[2] + m_nCColWidth2[2]; m_nCXpos2[4] = m_nCXpos2[3] + m_nCColWidth2[3]; m_nCTotalWidth2 = m_nCXpos2[4] - m_nCXpos2[0]; } public void InitWidthsforSlab() { m_nColWidth = new double[7]; m_nXpos = new double[8]; m_nColWidth[0] = 4; m_nColWidth[1] = 5; //Paid Till Date m_nColWidth[2] = 5; //This Month m_nColWidth[3] = 4; //Projected m_nXpos[0] = 0; m_nXpos[1] = m_nXpos[0] + m_nColWidth[0]; m_nXpos[2] = m_nXpos[1] + m_nColWidth[1]; m_nXpos[3] = m_nXpos[2] + m_nColWidth[2]; m_nXpos[4] = m_nXpos[3] + m_nColWidth[3]; m_nTotalWidth = m_nXpos[4]; } private void AddPage() { m_nCurPage = m_nCurPage + 1; m_oDoc.AddPage(); m_nYpos = .2; // ReportHeader m_oDoc, m_nYpos, m_nCurPage, m_oReport, m_oDoc.CurrentPage.PrintWidth, False, True PrintCaption(); } private void AddPageForTC() { m_nCurPage = m_nCurPage + 1; m_oDoc.AddPage(); m_nYpos = .2; // ReportHeader m_oDoc, m_nYpos, m_nCurPage, m_oReport, m_oDoc.CurrentPage.PrintWidth, False, True PrintCaptionForTC(); } private void PrintCaption() { double nLineHeight; EPText[] oCaptions = new EPText[7]; EPText oCaption; double m_nYpos1; nLineHeight = 0; InitWidths(); //oCaption = m_oDoc.CreateText(SystemInformation.CurrentSysInfo.name, m_nTotalWidth); //oCaption = m_oDoc.CreateText("", m_nTotalWidth); //oCaption.Style.Font.Size = 12; //oCaption.Style.Font.Bold = true; //oCaption.HAlignment = EPHAlignConstants.EPHAlignCenter; //if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; //m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); nLineHeight = 0; m_nYpos = m_nYpos + 2.20; oCaption = m_oDoc.CreateText("INCOME CERTIFICATE", m_nTotalWidth); oCaption.Style.Font.Size = 12; oCaption.Style.Font.Bold = true; oCaption.HAlignment = EPHAlignConstants.EPHAlignCenter; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); m_nYpos = 2.5 + 1.03128; //m_nYpos = m_nYpos - 0.5; m_nYpos1 = m_nYpos; double nsecond = 3; //Name oCaption = m_oDoc.CreateText("Name :", m_nColWidth[1] + 2); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText(_employee.Name, m_nTotalWidth); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Employee ID:", m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText(_employee.EmployeeNo, m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Designation:", m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText((_employee.Designation == null) ? "" : _employee.DescriptionText, 7); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; //oCaption = m_oDoc.CreateText("RC:", m_nColWidth[1]); //oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; //if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; //m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0] , m_nYpos); //ObjectsTemplate empCrg = EmployeeCostCenter.GetByEmpID(_employee.ID); //string scrg=""; //if (empCrg != null) //{ // foreach (EmployeeCostCenter crg in empCrg) // { // if (crg.Costcenter != null) // { // scrg = crg.Costcenter.Code; // } // } //} //oCaption = m_oDoc.CreateText(scrg, 7); //oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; //if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; //m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; oCaption = m_oDoc.CreateText("Location:", m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText((_employee.Location == null) ? "" : _employee.Location.Name, 7); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("TIN:", m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText(_employee.TinNo, 7); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; m_nYpos = 2.5 + 1.03128; double nthrid = 2.5; oCaption = m_oDoc.CreateText("Division:", m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); string devision = ""; if (_employee.Department != null && _employee.Department.Parent != null && _employee.Department.Parent.Parent != null) { devision = _employee.Department.Parent.Parent.Name; } oCaption = m_oDoc.CreateText(devision, 7); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Gender:", m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); oCaption = m_oDoc.CreateText((_employee.Gender == EnumGender.Female) ? "Female" : "Male", 7); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Income Year:", m_nColWidth[1]); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); oCaption = m_oDoc.CreateText(_taxParameter.FiscalYear, 7); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Assessment Year:", m_nColWidth[1] + 1); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); oCaption = m_oDoc.CreateText(_taxParameter.AssessmentYear, 7); oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight + .5; nLineHeight = 0; //oCaption = m_oDoc.CreateText("TIN:", m_nColWidth[1] + 1); //oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; //if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; //m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); //oCaption = m_oDoc.CreateText(_employee.TinNo, 7); //oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; //if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; //m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); //m_nYpos = m_nYpos + nLineHeight + .5; //nLineHeight = 0; //m_oDoc.CreateLine(0, m_nYpos - m_nYpos1).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos1); //m_oDoc.CreateLine(0, m_nYpos - m_nYpos1).AddToPage(m_oDoc.CurrentPage, m_nXpos[7], m_nYpos1); //m_oDoc.CreateLine(m_nTotalWidth ).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); m_nYpos = m_nYpos + 0.3; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); oCaptions[0] = m_oDoc.CreateText("Income Head", m_nColWidth[0]); oCaptions[0].HAlignment = EPHAlignConstants.EPHAlignLeft; oCaptions[0].Style.Font.Bold = true; if (oCaptions[0].Height > nLineHeight) nLineHeight = oCaptions[0].Height; oCaptions[1] = m_oDoc.CreateText("Paid Till Date", m_nColWidth[1]); oCaptions[1].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[1].Style.Font.Bold = true; if (oCaptions[1].Height > nLineHeight) nLineHeight = oCaptions[1].Height; oCaptions[2] = m_oDoc.CreateText("This Month", m_nColWidth[2]); oCaptions[2].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[2].Style.Font.Bold = true; if (oCaptions[2].Height > nLineHeight) nLineHeight = oCaptions[2].Height; oCaptions[3] = m_oDoc.CreateText("Projected", m_nColWidth[3]); oCaptions[3].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[3].Style.Font.Bold = true; if (oCaptions[3].Height > nLineHeight) nLineHeight = oCaptions[3].Height; oCaptions[4] = m_oDoc.CreateText("Amount Per Annum", m_nColWidth[4]); oCaptions[4].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[4].Style.Font.Bold = true; if (oCaptions[4].Height > nLineHeight) nLineHeight = oCaptions[4].Height; oCaptions[5] = m_oDoc.CreateText("Less Exempted", m_nColWidth[5]); oCaptions[5].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[5].Style.Font.Bold = true; if (oCaptions[5].Height > nLineHeight) nLineHeight = oCaptions[5].Height; oCaptions[6] = m_oDoc.CreateText("Total Taxable Income", m_nColWidth[6]); oCaptions[6].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[6].Style.Font.Bold = true; if (oCaptions[6].Height > nLineHeight) nLineHeight = oCaptions[6].Height; for (int i = 0; i <= 6; i++) { m_oDoc.CurrentPage.AddText(oCaptions[i], m_nXpos[i], m_nYpos); } for (int i = 0; i < 8; i++) { if (i == 0 || i == 1 || i == 4 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); m_nYpos = m_nYpos + 0.02; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } private void PrintCaptionForTC() { double nLineHeight; EPText[] oCaptions = new EPText[7]; EPText oCaption; double m_nYpos1; nLineHeight = 0; InitWidths(); Payroll.BO.SystemInformation _systemInfo = Payroll.BO.SystemInformation.Get(); //oCaption = m_oDoc.CreateText(SystemInformation.CurrentSysInfo.name, m_nTotalWidth); StringBuilder companyInfo = new StringBuilder(); companyInfo.AppendFormat("{0}\n{1}", _systemInfo.name, _systemInfo.corporateAddress); oCaption = m_oDoc.CreateText(companyInfo.ToString(), m_nTotalWidth); oCaption.Style.Font.Size = 8; oCaption.Style.Font.Bold = false; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); nLineHeight = 0; _EPPicture = m_oDoc.CreatePicture(Image.FromFile(System.Windows.Forms.Application.StartupPath + @"\Logo.jpg"), 2.55, 1.5); m_oDoc.CurrentPage.AddPicture(_EPPicture, m_nXpos[0] + 15, m_nYpos); //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); nLineHeight = 0; m_nYpos = m_nYpos + 2.2; oCaption = m_oDoc.CreateText("CALCULATION OF TAX ON SALARIES AND PAYMENT CERTIFICATE", m_nTotalWidth); oCaption.Style.Font.Size = 8; oCaption.Style.Font.UnderLine = true; oCaption.Style.Font.Bold = true; oCaption.HAlignment = EPHAlignConstants.EPHAlignCenter; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); m_nYpos = 2.5 + 1.03128; //m_nYpos = m_nYpos - 0.5; m_nYpos1 = m_nYpos; double nsecond = 3; //Name oCaption = m_oDoc.CreateText("Name :", m_nColWidth[1] + 2); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText(_employee.Name, m_nTotalWidth); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Employee ID:", m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText(_employee.EmployeeNo, m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Designation:", m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText((_employee.Designation == null) ? "" : _employee.DescriptionText, 7); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; //oCaption = m_oDoc.CreateText("RC:", m_nColWidth[1]); //oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; //if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; //m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); //ObjectsTemplate empCrg = EmployeeCostCenter.GetByEmpID(_employee.ID); //string scrg = ""; //if (empCrg != null) //{ // foreach (EmployeeCostCenter crg in empCrg) // { // if (crg.Costcenter != null) // { // scrg = crg.Costcenter.Code; // } // } //} //oCaption = m_oDoc.CreateText(scrg, 7); //oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; //if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; //m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; oCaption = m_oDoc.CreateText("Location:", m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText((_employee.Location == null) ? "" : _employee.Location.Name, 7); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("TIN:", m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[0], m_nYpos); oCaption = m_oDoc.CreateText(_employee.TinNo, 7); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[1] - nsecond, m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; m_nYpos = 2.5 + 1.03128; double nthrid = 2.5; oCaption = m_oDoc.CreateText("Division:", m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); string devision = ""; if (_employee.Department != null && _employee.Department.Parent != null && _employee.Department.Parent.Parent != null) { devision = _employee.Department.Parent.Parent.Name; } oCaption = m_oDoc.CreateText(devision, 7); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Gender:", m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); oCaption = m_oDoc.CreateText((_employee.Gender == EnumGender.Female) ? "Female" : "Male", 7); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Income Year:", m_nColWidth[1]); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); oCaption = m_oDoc.CreateText(_taxParameter.FiscalYear, 7); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; oCaption = m_oDoc.CreateText("Assessment Year:", m_nColWidth[1] + 1); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[2] + nthrid, m_nYpos); oCaption = m_oDoc.CreateText(_taxParameter.AssessmentYear, 7); oCaption.Style.Font.Size = 8; oCaption.HAlignment = EPHAlignConstants.EPHAlignLeft; if (oCaption.Height > nLineHeight) nLineHeight = oCaption.Height; m_oDoc.CurrentPage.AddText(oCaption, m_nXpos[5], m_nYpos); m_nYpos = m_nYpos + nLineHeight + 0.5; nLineHeight = 0; //m_nYpos = m_nYpos + 0.3; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); oCaptions[0] = m_oDoc.CreateText("Income Head", m_nColWidth[0] + m_nColWidth[1] + m_nColWidth[2] + m_nColWidth[3]); oCaptions[0].Style.Font.Size = 8; oCaptions[0].HAlignment = EPHAlignConstants.EPHAlignLeft; oCaptions[0].Style.Font.Bold = true; if (oCaptions[0].Height > nLineHeight) nLineHeight = oCaptions[0].Height; oCaptions[4] = m_oDoc.CreateText("Amount Per Annum", m_nColWidth[4]); oCaptions[4].Style.Font.Size = 8; oCaptions[4].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[4].Style.Font.Bold = true; if (oCaptions[4].Height > nLineHeight) nLineHeight = oCaptions[4].Height; oCaptions[5] = m_oDoc.CreateText("Less Exempted", m_nColWidth[5]); oCaptions[5].Style.Font.Size = 8; oCaptions[5].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[5].Style.Font.Bold = true; if (oCaptions[5].Height > nLineHeight) nLineHeight = oCaptions[5].Height; oCaptions[6] = m_oDoc.CreateText("Total Taxable Income", m_nColWidth[6]); oCaptions[6].Style.Font.Size = 8; oCaptions[6].HAlignment = EPHAlignConstants.EPHAlignCenter; oCaptions[6].Style.Font.Bold = true; if (oCaptions[6].Height > nLineHeight) nLineHeight = oCaptions[6].Height; for (int i = 0; i <= 6; i++) { if (i == 1 || i == 2 || i == 3) { continue; } m_oDoc.CurrentPage.AddText(oCaptions[i], m_nXpos[i], m_nYpos); } for (int i = 0; i < 8; i++) { if (i == 0 || i == 4 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); m_nYpos = m_nYpos + 0.02; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } private void PrintBody() { EPText[] otValues = new EPText[7]; double nLineHeight = 0; double nTotalAmount = 0; foreach (DataRow oItem in _dSet.Tables[0].Rows) { nTotalAmount = 0; otValues[0] = m_oDoc.CreateText(oItem["IncomeHead"].ToString(), m_nColWidth[0]); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[1] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oItem["PaidTillDate"])), m_nColWidth[1]); otValues[1].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[1].Height > nLineHeight) nLineHeight = otValues[1].Height; otValues[2] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oItem["ThisMonth"])), m_nColWidth[2]); otValues[2].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[2].Height > nLineHeight) nLineHeight = otValues[2].Height; otValues[3] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oItem["Projected"])), m_nColWidth[3]); otValues[3].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[3].Height > nLineHeight) nLineHeight = otValues[3].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oItem["AmountPerAnnum"])), m_nColWidth[4]); otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; otValues[5] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oItem["LessExaempted"])), m_nColWidth[5]); otValues[5].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[5].Height > nLineHeight) nLineHeight = otValues[5].Height; nTotalAmount = Convert.ToDouble(oItem["AmountPerAnnum"]) - Convert.ToDouble(oItem["LessExaempted"]); otValues[6] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(nTotalAmount)), m_nColWidth[6]); otValues[6].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[6].Height > nLineHeight) nLineHeight = otValues[6].Height; for (int i = 0; i <= 6; i++) { if (oItem["ItemID"].ToString() == "-216" || oItem["ItemID"].ToString() == "-217") { otValues[i].Style.Font.Bold = true; otValues[i].Style.Font.Size = 8; } m_oDoc.CurrentPage.AddText(otValues[i], m_nXpos[i], m_nYpos); } for (int i = 0; i < 8; i++) { if (i == 0 || i == 1 || i == 4 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); m_nYpos = m_nYpos + .15; } private void PrintBodyForTC() { EPText[] otValues = new EPText[7]; double nLineHeight = 0; double nTotalAmount = 0; foreach (DataRow oItem in _dSet.Tables[0].Rows) { nTotalAmount = 0; otValues[0] = m_oDoc.CreateText(oItem["IncomeHead"].ToString(), m_nColWidth[0] + m_nColWidth[1] + m_nColWidth[2] + m_nColWidth[3]); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oItem["AmountPerAnnum"])), m_nColWidth[4]); otValues[4].Style.Font.Size = 8; otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; otValues[5] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oItem["LessExaempted"])), m_nColWidth[5]); otValues[5].Style.Font.Size = 8; otValues[5].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[5].Height > nLineHeight) nLineHeight = otValues[5].Height; nTotalAmount = Convert.ToDouble(oItem["AmountPerAnnum"]) - Convert.ToDouble(oItem["LessExaempted"]); otValues[6] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(nTotalAmount)), m_nColWidth[6]); otValues[6].Style.Font.Size = 8; otValues[6].HAlignment = EPHAlignConstants.EPHAlignRight; if (otValues[6].Height > nLineHeight) nLineHeight = otValues[6].Height; for (int i = 0; i <= 6; i++) { if (i == 1 || i == 2 || i == 3) { continue; } if (oItem["ItemID"].ToString() == "-216" || oItem["ItemID"].ToString() == "-217") { otValues[i].Style.Font.Bold = true; otValues[i].Style.Font.Size = 8; } m_oDoc.CurrentPage.AddText(otValues[i], m_nXpos[i], m_nYpos); } for (int i = 0; i < 8; i++) { if (i == 0 || i == 4 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); m_nYpos = m_nYpos + .15; } private void PrintSlab() { double nLineHeight = 0; InitWidthsforSlab(); EPText[] otValues = new EPText[7]; m_nYpos = m_nYpos + 0.08; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, 0, m_nYpos); nLineHeight = 0.5; otValues[0] = m_oDoc.CreateText("Current Rate", m_nColWidth[0]); otValues[0].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[0].Style.Font.Bold = true; otValues[1] = m_oDoc.CreateText("Parameter", m_nColWidth[1]); otValues[1].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[1].Style.Font.Bold = true; otValues[2] = m_oDoc.CreateText("Taxable Income", m_nColWidth[2]); otValues[2].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[2].Style.Font.Bold = true; otValues[3] = m_oDoc.CreateText("Individual Tax Liability", m_nColWidth[3]); otValues[3].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[3].Style.Font.Bold = true; for (int i = 0; i < 4; i++) { m_oDoc.CurrentPage.AddText(otValues[i], m_nXpos[i], m_nYpos); } for (int i = 0; i < 6; i++) { m_oDoc.CreateLine(0, 0.5).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); double nTemYPos = 0; nTemYPos = m_nYpos; double nTotalTAx = 0; double nTotalIncome = 0; foreach (DataRow oRow in _dSet.Tables[1].Rows) { otValues[0] = m_oDoc.CreateText(oRow["CurrentRate"].ToString() + "", 5); otValues[0].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); otValues[1] = m_oDoc.CreateText(oRow["Parameter"].ToString(), 5); otValues[1].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[1], m_nXpos[1], m_nYpos); otValues[2] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["TaxableIncome"])), 5); otValues[2].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[2], m_nXpos[2], m_nYpos); nTotalIncome = nTotalIncome + Convert.ToDouble(oRow["TaxableIncome"]); otValues[3] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["IndividualTaxLiability"])), 5); otValues[3].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[3], m_nXpos[3], m_nYpos); nTotalTAx = nTotalTAx + Convert.ToDouble(oRow["IndividualTaxLiability"]); for (int i = 0; i < 5; i++) { m_oDoc.CreateLine(0, 0.5).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } otValues[0] = m_oDoc.CreateText("Total", 5); otValues[0].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[0].Style.Font.Bold = true; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); otValues[1] = m_oDoc.CreateText("", 5); otValues[1].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[1].Style.Font.Bold = true; m_oDoc.CurrentPage.AddText(otValues[1], m_nXpos[1], m_nYpos); otValues[2] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(nTotalIncome)), 5); otValues[2].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[2].Style.Font.Bold = true; m_oDoc.CurrentPage.AddText(otValues[2], m_nXpos[2], m_nYpos); otValues[3] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(nTotalTAx)), 5); otValues[3].Style.Font.Bold = true; otValues[3].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[3], m_nXpos[3], m_nYpos); for (int i = 0; i < 5; i++) { m_oDoc.CreateLine(0, 0.5).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); //m_nYpos = m_nYpos + .5; //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); InitWidths(); double nYPos = m_nYpos; if (_dSet.Tables[2].Rows.Count > 0) { m_nYpos = m_nYpos + .3; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Tax rebate for investment", 5); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[6] = m_oDoc.CreateText("Amount", 2); otValues[6].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[6], m_nXpos[6], m_nYpos); if (otValues[6].Height > nLineHeight) nLineHeight = otValues[6].Height; for (int i = 0; i < 8; i++) { if (i == 0 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); nYPos = m_nYpos; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Investment allowed (" + _taxParameter.MaxInvestPercent.ToString() + "% of annual taxable income) (a)", 10); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_20Investment), 2); otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; //otValues[0] = m_oDoc.CreateText(_taxParameter.MaxInvestPercent.ToString() + "% of annual taxable income ", 5); //otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; //m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); //if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; //otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_20Investment), 5); //otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; //m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); //if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; //otValues[0] = m_oDoc.CreateText("Maximum investment allowed", 5); //otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; //m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); //if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; //otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_taxParameter.MaxInvAmount) , 5); //otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; //m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); //if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; //otValues[0] = m_oDoc.CreateText("Lower one", 5); //otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; //m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); //if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; //// ////m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - .05); ////m_nYpos = m_nYpos + .2; //otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_investmentAllowed), 2); //otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; //m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); //if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("PF contribution by Employee (b)", 5); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 5); otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("PF contribution by Company (c)", 5); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 5); otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; //otValues[0] = m_oDoc.CreateText("PF contribution by Employee (b)", 10); //otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; //m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); //if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; //otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 2); //otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; //m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); //if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; //m_nYpos = m_nYpos + nLineHeight; //nLineHeight = 0; //otValues[0] = m_oDoc.CreateText("PF contribution by Company (c)", 10); //otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; //m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); //if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; //otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 2); //otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; //m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); //if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("PF Investment amount (d=b+c)", 10); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment * 2), 2); otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Other eligible investment except PF (e=a-d)", m_nTotalWidth); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; //otValues[0].Style.BackColor = System.Drawing.Color.Gray; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_20Investment - (_pfInvestment * 2)), 2); otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Actual other investment (f)", m_nTotalWidth); otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; //otValues[0].Style.BackColor = System.Drawing.Color.Gray; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_otherInvestment), 2); otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; for (int i = 0; i < 8; i++) { if (i == 0 || i == 5 || i == 7) m_oDoc.CreateLine(0, m_nYpos - nYPos - .05).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], nYPos); } m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - .05); m_nYpos = m_nYpos + .2; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } int nconut = 1; foreach (DataRow oRow in _dSet.Tables[2].Rows) { nLineHeight = 0; if (nconut == 1) { otValues[0] = m_oDoc.CreateText(oRow["DataColumn1"].ToString() + " ( " + _20Investment.ToString() + " )", 10); } else otValues[0] = m_oDoc.CreateText(oRow["DataColumn1"].ToString(), 5); nconut++; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[1] = m_oDoc.CreateText(oRow["DataColumn2"].ToString(), 5); otValues[1].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[1], m_nXpos[1], m_nYpos); if (otValues[1].Height > nLineHeight) nLineHeight = otValues[1].Height; otValues[6] = m_oDoc.CreateText(oRow["DataColumn3"].ToString(), 2); otValues[6].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[6], m_nXpos[6], m_nYpos); if (otValues[6].Height > nLineHeight) nLineHeight = otValues[6].Height; for (int i = 0; i < 8; i++) { if (i == 0 || i == 5 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } //foreach (DataRow oRow in _dSet.Tables[3].Rows) //{ // nLineHeight = 0; // otValues[0] = m_oDoc.CreateText("Tax Challan", 5); // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // otValues[0].Style.Font.Bold = true; // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // otValues[3] = m_oDoc.CreateText(Convert.ToString(oRow["ChallanNo"]), 5); // otValues[3].HAlignment = EPHAlignConstants.EPHAlignRight; // m_oDoc.CurrentPage.AddText(otValues[3], m_nXpos[3], m_nYpos); // if (otValues[3].Height > nLineHeight) nLineHeight = otValues[3].Height; // for (int i = 0; i < 8; i++) // { // if (i == 0 || i == 2 ||i==7 ) // m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); // } // m_nYpos = m_nYpos + nLineHeight; //} //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); string bottomcaption = "This statement is electronicaly generated on " + DateTime.Today.ToString("dd MMM yyyy") + " and does not require any signature. "; bottomcaption = bottomcaption + " You are resposible for ensuring the confidentility of this statement."; m_nYpos = m_oDoc.CurrentPage.PrintHeight - 2; otValues[0] = m_oDoc.CreateText(bottomcaption, m_nTotalWidth); otValues[0].HAlignment = EPHAlignConstants.EPHAlignJustified; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; } private void PrintSlabForTC() { double nLineHeight = 0; InitWidthsforSlab(); EPText[] otValues = new EPText[7]; //m_nYpos = m_nYpos + 0.08; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, 0, m_nYpos); nLineHeight = 0.5; otValues[0] = m_oDoc.CreateText("Current Rate", m_nColWidth[0]); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[0].Style.Font.Bold = true; otValues[1] = m_oDoc.CreateText("Parameter", m_nColWidth[1]); otValues[1].Style.Font.Size = 8; otValues[1].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[1].Style.Font.Bold = true; otValues[2] = m_oDoc.CreateText("Taxable Income", m_nColWidth[2]); otValues[2].Style.Font.Size = 8; otValues[2].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[2].Style.Font.Bold = true; otValues[3] = m_oDoc.CreateText("Individual Tax Liability", m_nColWidth[3]); otValues[3].Style.Font.Size = 8; otValues[3].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[3].Style.Font.Bold = true; for (int i = 0; i < 4; i++) { m_oDoc.CurrentPage.AddText(otValues[i], m_nXpos[i], m_nYpos); } for (int i = 0; i < 6; i++) { m_oDoc.CreateLine(0, 0.5).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); double nTemYPos = 0; nTemYPos = m_nYpos; double nTotalTAx = 0; double nTotalIncome = 0; foreach (DataRow oRow in _dSet.Tables[1].Rows) { // otValues[0] = m_oDoc.CreateText(oRow["CurrentRate"].ToString() + "%", 5);//previous otValues[0] = m_oDoc.CreateText(oRow["CurrentRate"].ToString(), 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); otValues[1] = m_oDoc.CreateText(oRow["Parameter"].ToString(), 5); otValues[1].Style.Font.Size = 8; otValues[1].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[1], m_nXpos[1], m_nYpos); otValues[2] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["TaxableIncome"])), 5); otValues[2].Style.Font.Size = 8; otValues[2].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[2], m_nXpos[2], m_nYpos); nTotalIncome = nTotalIncome + Convert.ToDouble(oRow["TaxableIncome"]); otValues[3] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["IndividualTaxLiability"])), 5); otValues[3].Style.Font.Size = 8; otValues[3].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[3], m_nXpos[3], m_nYpos); nTotalTAx = nTotalTAx + Convert.ToDouble(oRow["IndividualTaxLiability"]); for (int i = 0; i < 5; i++) { m_oDoc.CreateLine(0, 0.5).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } otValues[0] = m_oDoc.CreateText("Total", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[0].Style.Font.Bold = true; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); otValues[1] = m_oDoc.CreateText("", 5); otValues[1].Style.Font.Size = 8; otValues[1].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[1].Style.Font.Bold = true; m_oDoc.CurrentPage.AddText(otValues[1], m_nXpos[1], m_nYpos); otValues[2] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(nTotalIncome)), 5); otValues[2].Style.Font.Size = 8; otValues[2].HAlignment = EPHAlignConstants.EPHAlignCenter; otValues[2].Style.Font.Bold = true; m_oDoc.CurrentPage.AddText(otValues[2], m_nXpos[2], m_nYpos); otValues[3] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(Convert.ToDouble(nTotalTAx)), 5); otValues[3].Style.Font.Size = 8; otValues[3].Style.Font.Bold = true; otValues[3].HAlignment = EPHAlignConstants.EPHAlignCenter; m_oDoc.CurrentPage.AddText(otValues[3], m_nXpos[3], m_nYpos); for (int i = 0; i < 5; i++) { m_oDoc.CreateLine(0, 0.5).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); //m_nYpos = m_nYpos + .5; //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); InitWidths(); double nYPos = m_nYpos; if (_dSet.Tables[2].Rows.Count > 0) { //m_nYpos = m_nYpos + .3; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Tax rebate for investment", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[6] = m_oDoc.CreateText("Amount", 2); otValues[6].Style.Font.Size = 8; otValues[6].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[6], m_nXpos[6], m_nYpos); if (otValues[6].Height > nLineHeight) nLineHeight = otValues[6].Height; for (int i = 0; i < 8; i++) { if (i == 0 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); nYPos = m_nYpos; #region New Code nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Investment allowed (a)", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText(_taxParameter.MaxInvestPercent.ToString() + "% of annual taxable income ", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_20Investment), 5); otValues[4].Style.Font.Size = 8; otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Maximum investment allowed", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_taxParameter.MaxInvAmount), 5); otValues[4].Style.Font.Size = 8; otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Lower one", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - .05); //m_nYpos = m_nYpos + .2; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_investmentAllowed), 2); otValues[4].Style.Font.Size = 8; otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("PF contribution by Employee (b)", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 2); otValues[4].Style.Font.Size = 8; otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("PF contribution by Company (c)", 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 2); otValues[4].Style.Font.Size = 8; otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Other investment to be made by the employee (d = a-b-c)", m_nTotalWidth); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; otValues[0].Style.BackColor = System.Drawing.Color.Gray; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_otherInvestment), 2); otValues[4].Style.Font.Size = 8; otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; for (int i = 0; i < 8; i++) { if (i == 0 || i == 5 || i == 7) m_oDoc.CreateLine(0, m_nYpos - nYPos - .05).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], nYPos); } m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - .05); //m_nYpos = m_nYpos + .2; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); #endregion #region Old Code // nLineHeight = 0; // otValues[0] = m_oDoc.CreateText("Investment allowed (a)", 5); // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // m_nYpos = m_nYpos + nLineHeight; // nLineHeight = 0; // otValues[0] = m_oDoc.CreateText(_taxParameter.MaxInvestPercent.ToString() + "% of annual taxable income ", 5); // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_20Investment), 5); // otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); // if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; // m_nYpos = m_nYpos + nLineHeight; // nLineHeight = 0; // otValues[0] = m_oDoc.CreateText("Maximum investment allowed", 5); // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_taxParameter.MaxInvAmount), 5); // otValues[4].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[4], m_nYpos); // if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; // m_nYpos = m_nYpos + nLineHeight; // nLineHeight = 0; // otValues[0] = m_oDoc.CreateText("Lower one", 5); // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 2, m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_investmentAllowed), 2); // otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; // m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); // if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; // m_nYpos = m_nYpos + nLineHeight; // nLineHeight = 0; //// // for (int i = 0; i < 8; i++) // { // if (i == 0 || i == 5 || i == 7) // m_oDoc.CreateLine(0, m_nYpos - nYPos - .05).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], nYPos); // } // m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - .05); // m_nYpos = m_nYpos + .2; //// // otValues[0] = m_oDoc.CreateText("PF contribution by Employee (b)", 5); // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 2); // otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; // m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); // if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; // m_nYpos = m_nYpos + nLineHeight; // nLineHeight = 0; // otValues[0] = m_oDoc.CreateText("PF contribution by Company (c)", 5); // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_pfInvestment), 2); // otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; // m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); // if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; // m_nYpos = m_nYpos + nLineHeight; // nLineHeight = 0; //// otValues[0] = m_oDoc.CreateText("Other investment to be made by the employee (d = a-b-c)", m_nTotalWidth); // otValues[0] = m_oDoc.CreateText("Other investment(d)", m_nTotalWidth);//new // otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // //otValues[0].Style.BackColor = System.Drawing.Color.Gray; // otValues[0].Style.BackColor = System.Drawing.Color.Transparent;//new // m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); // if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_actualInvestment), 2); // otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; // m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); // if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; // m_nYpos = m_nYpos + nLineHeight; // nLineHeight = 0; // //otValues[0] = m_oDoc.CreateText("Total investment(b + c + d)", m_nTotalWidth);//new // //otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; // //otValues[0].Style.BackColor = System.Drawing.Color.Gray; // //m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); // //if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; // //otValues[4] = m_oDoc.CreateText(GlobalFunctions.TakaFormat(_actualInvestment + _pfInvestment + _pfInvestment), 2); // //otValues[4].HAlignment = EPHAlignConstants.EPHAlignRight; // //m_oDoc.CurrentPage.AddText(otValues[4], m_nXpos[6], m_nYpos); // //if (otValues[4].Height > nLineHeight) nLineHeight = otValues[4].Height; // //m_nYpos = m_nYpos + nLineHeight; // //nLineHeight = 0; // for (int i = 0; i < 8; i++) // { // if (i == 0 || i == 5 || i == 7) // m_oDoc.CreateLine(0, m_nYpos - nYPos - .05).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], nYPos); // } // m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - .05); // m_nYpos = m_nYpos + .2; // m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); #endregion } foreach (DataRow oRow in _dSet.Tables[2].Rows) { nLineHeight = 0; otValues[0] = m_oDoc.CreateText(oRow["DataColumn1"].ToString(), 5); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; otValues[1] = m_oDoc.CreateText(oRow["DataColumn2"].ToString(), 5); otValues[1].Style.Font.Size = 8; otValues[1].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[1], m_nXpos[1], m_nYpos); if (otValues[1].Height > nLineHeight) nLineHeight = otValues[1].Height; otValues[6] = m_oDoc.CreateText(oRow["DataColumn3"].ToString(), 2); otValues[6].Style.Font.Size = 8; otValues[6].HAlignment = EPHAlignConstants.EPHAlignRight; m_oDoc.CurrentPage.AddText(otValues[6], m_nXpos[6], m_nYpos); if (otValues[6].Height > nLineHeight) nLineHeight = otValues[6].Height; for (int i = 0; i < 8; i++) { if (i == 0 || i == 5 || i == 7) m_oDoc.CreateLine(0, nLineHeight).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); } //m_nYpos = m_nYpos + .3; //m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos); nLineHeight = 0; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; StringBuilder sb = new StringBuilder(); sb.AppendFormat("We hereby certify that the above statement contains SALARY income of the above mentioned employee which has been paid by Grameenphone Ltd. During the Year {0} Corresponding to the Assesment Year {1} Tax has been deducted from his/her salary considering the actual investment under the Income Tax law. We also certify that above mentioned tax liability was duly deducted at source on monthly basis and deposited to Bangladesh Bank through Treasury Challan(s) along with all employees Tax liability which is enumerated below: \nChallan Number:", _taxParameter.FiscalYear, _taxParameter.AssessmentYear); otValues[0] = m_oDoc.CreateText(sb.ToString(), m_nTotalWidth); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos + 0.1); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; for (int i = 0; i < 8; i++) { if (i == 0 || i == 7) m_oDoc.CreateLine(0, nLineHeight + 0.1).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos + 0.1); DataRow drEmp = _dSet.Tables[3].AsEnumerable().FirstOrDefault(); if (Convert.ToString(drEmp["ChallanNo"]) != string.Empty) { nLineHeight = 0; m_nYpos = 21.5; foreach (DataRow oRow in _dSet.Tables[3].Rows) { if (Convert.ToString(oRow["ChallanNo"]) != string.Empty) { //nLineHeight = 0; otValues[0] = m_oDoc.CreateText(Convert.ToString(oRow["ChallanNo"]), 18); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos + 0.2); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; //m_nYpos = m_nYpos + nLineHeight; } } for (int i = 0; i < 8; i++) { if (i == 0 || i == 7) m_oDoc.CreateLine(0, nLineHeight + 0.1).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos + 0.1); } double tempYPos = 0; //m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; _EPPicture = m_oDoc.CreatePicture(Image.FromFile(System.Windows.Forms.Application.StartupPath + @"\AuthSignature.png"), 2.55, 1.2); //m_nYpos = m_nYpos + _EPPicture.Width; //tempYPos = m_oDoc.CurrentPage.PrintHeight - 5.54; tempYPos = m_nYpos + 0.13; m_oDoc.CurrentPage.AddPicture(_EPPicture, m_nXpos[0] + 14, tempYPos); if (_EPPicture.Height > nLineHeight) nLineHeight = _EPPicture.Height; //m_nYpos = m_nYpos + nLineHeight; string bottomcaption = "Authorized Signature"; m_nYpos = tempYPos + 1;//1.5 otValues[0] = m_oDoc.CreateText(bottomcaption, m_nTotalWidth); otValues[0].Style.Font.Size = 8; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; //m_nYpos = m_nYpos + nLineHeight; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0] + 14, m_nYpos); for (int i = 0; i < 8; i++) { if (i == 0 || i == 7) m_oDoc.CreateLine(0, nLineHeight + 0.5).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], tempYPos); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - 0.5); nLineHeight = 0; m_nYpos = m_nYpos + nLineHeight; nLineHeight = 0; otValues[0] = m_oDoc.CreateText("Note: Submission of Tax return of an individual employee to the Tax office is compulsory on or before 30th November, 2017. GP staff is personally held responsible for submission of Tax return.", m_nTotalWidth); otValues[0].Style.Font.Size = 7; otValues[0].HAlignment = EPHAlignConstants.EPHAlignLeft; m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos - 0.4); if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; for (int i = 0; i < 8; i++) { if (i == 0 || i == 7) m_oDoc.CreateLine(0, nLineHeight+0.05).AddToPage(m_oDoc.CurrentPage, m_nXpos[i], m_nYpos - 0.5); } m_nYpos = m_nYpos + nLineHeight; m_oDoc.CreateLine(m_nTotalWidth).AddToPage(m_oDoc.CurrentPage, m_nXpos[0], m_nYpos - 0.45); //string bottomcaption = "This statement is electronicaly generated on " + DateTime.Today.ToString("dd MMM yyyy") + " and does not require any signature. "; //bottomcaption = bottomcaption + " You are resposible for ensuring the confidentility of this statement."; //m_nYpos = m_oDoc.CurrentPage.PrintHeight - 2; //otValues[0] = m_oDoc.CreateText(bottomcaption, m_nTotalWidth); //otValues[0].HAlignment = EPHAlignConstants.EPHAlignJustified; //m_oDoc.CurrentPage.AddText(otValues[0], m_nXpos[0], m_nYpos); //if (otValues[0].Height > nLineHeight) nLineHeight = otValues[0].Height; } public void showTaxCardMultiple() { bool isCurrentYear = false; DataSet orootDataset = new DataSet(); fReportViewer form = new fReportViewer(); IncomeTax oIncomeTax = new IncomeTax(); _TaxParameterID = _selectedParameter.TaxParameters[0].ID; ObjectsTemplate _taxParameters = TaxParameter.Get(); if (Payroll.BO.SystemInformation.CurrentSysInfo.TaxParamID == _TaxParameterID) isCurrentYear = true; else isCurrentYear = false; string sEmpID = _selectedParameter.ReportItem.INSQL; ObjectsTemplate oEMployees = Employee.GetEmpsWithDiscontinue(sEmpID); if (_TaxParameterID == SystemInformation.CurrentSysInfo.TaxParamID) { //SystemInformation.CurrentSysInfo.TaxParamID _taxParameter = TaxParameter.Get(SystemInformation.CurrentSysInfo.TaxParamID); m_oDoc = new EPDoc(); InitDoc(); foreach (Employee oEmp in oEMployees) { _employee = oEmp; _incometaxes = IncomeTax.Get(oIncomeTax.GetEnumForSalaryIT(oEmp.ID), oEmp.ID, SystemInformation.CurrentSysInfo.TaxParamID); //As this method has not been used yet then A Boolean value is used as Parameter _dSet = PrepareDataset(oEmp.ID, isCurrentYear); AddPage(); PrintBody(); PrintSlab(); } } else { ObjectsTemplate oTaxChallans = new ObjectsTemplate(); _taxParameter = TaxParameter.Get(_TaxParameterID); m_oDoc = new EPDoc(); InitDoc(); _isPrvs = true; foreach (Employee oEmp in oEMployees) { _employee = oEmp; //EnumIncomeTaxDataFrom.ProcessedData //oIncomeTax.GetEnumForSalaryIT(oEmp.ID) _incometaxes = IncomeTax.Get(EnumIncomeTaxDataFrom.ProcessedData, oEmp.ID, _TaxParameterID); //As this method has not been used yet then A Boolean value is used as Parameter _dSet = PrepareDataset(oEmp.ID, isCurrentYear); PayrollDataSet.PayrollDataSet.TaxChallanDataTable dTChallan = new Payroll.Report.PayrollDataSet.PayrollDataSet.TaxChallanDataTable(); DataRow dChallan = null; dChallan = dTChallan.NewRow(); oTaxChallans = TaxChallan.Get(oEmp.ID, _TaxParameterID); int count = 1; string sChallanNo = "";// "# 57 dated 06-Sep-2010, # 56/88 dated 05-Oct-2010, # 54 dated 03-Nov-2010, # 58 dated 07-Dec-2010, # 57 dated 06-Jan-2011, # 56 dated 10-Feb-2011, # 58 dated 09-Mar-2011, # 50 dated 13-Apr-2011, # 47 dated 03-May-2011, # 55 dated 09-Jun-2011, # 71/49 dated 21-Jul-2011."; if (oTaxChallans != null && oTaxChallans.Count > 0) { foreach (TaxChallan oItem in oTaxChallans) { if (count == oTaxChallans.Count) { sChallanNo += "Challan: " + oItem.ChallanNo + " Date: " + oItem.DepositDate.ToString("dd-MMM-yyyy"); //sChallanNo += oItem.ChallanNo; } else { sChallanNo += "Challan: " + oItem.ChallanNo + " Date: " + oItem.DepositDate.ToString("dd-MMM-yyyy") + ", "; //sChallanNo += oItem.ChallanNo + ","; count++; } } } dChallan["ChallanNo"] = sChallanNo; dTChallan.Rows.Add(dChallan); dTChallan.TableName = "PayrollDataSet_TaxChallan"; _dSet.Tables.Add(dTChallan); AddPageForTC(); PrintBodyForTC(); PrintSlabForTC(); } } m_oDoc.PreviewDoc(); } public void showTaxCardMultiple(ObjectsTemplate oincometaxes, Employee oEmp, bool ITStatus) { DataSet orootDataset = new DataSet(); fReportViewer form = new fReportViewer(); IncomeTax oIncomeTax = new IncomeTax(); //_TaxParameterID = _selectedParameter.TaxParameters[0].ID; //string sEmpID = _selectedParameter.ReportItem.INSQL; //ObjectsTemplate oEMployees = Employee.GetEmpsWithDiscontinue(sEmpID); //if (_TaxParameterID == SystemInformation.CurrentSysInfo.TaxParamID) //{ //SystemInformation.CurrentSysInfo.TaxParamID _taxParameter = TaxParameter.Get(SystemInformation.CurrentSysInfo.TaxParamID); m_oDoc = new EPDoc(); InitDoc(); _employee = oEmp; _incometaxes = oincometaxes;// IncomeTax.Get(oIncomeTax.GetEnumForSalaryIT(oEmp.ID), oEmp.ID, SystemInformation.CurrentSysInfo.TaxParamID); _dSet = PrepareDataset(oEmp.ID, false); AddPage(); PrintBody(); PrintSlab(); //} //else //{ // ObjectsTemplate oTaxChallans = new ObjectsTemplate(); // _taxParameter = TaxParameter.Get(_TaxParameterID); // m_oDoc = new EPDoc(); // InitDoc(); // _employee = oEmp; // //EnumIncomeTaxDataFrom.ProcessedData // //oIncomeTax.GetEnumForSalaryIT(oEmp.ID) // _incometaxes = oincometaxes;// IncomeTax.Get(EnumIncomeTaxDataFrom.ProcessedData, oEmp.ID, _TaxParameterID); // _dSet = PrepareDataset(oEmp.ID); // PayrollDataSet.PayrollDataSet.TaxChallanDataTable dTChallan = new Payroll.Report.PayrollDataSet.PayrollDataSet.TaxChallanDataTable(); // DataRow dChallan = null; // dChallan = dTChallan.NewRow(); // oTaxChallans = TaxChallan.Get(oEmp.ID, _TaxParameterID); // //int count = 1; // string sChallanNo = "# 57 dated 06-Sep-2010, # 56/88 dated 05-Oct-2010, # 54 dated 03-Nov-2010, # 58 dated 07-Dec-2010, # 57 dated 06-Jan-2011, # 56 dated 10-Feb-2011, # 58 dated 09-Mar-2011, # 50 dated 13-Apr-2011, # 47 dated 03-May-2011, # 55 dated 09-Jun-2011, # 71/49 dated 21-Jul-2011."; // //if (oTaxChallans != null && oTaxChallans.Count > 0) // //{ // // foreach (TaxChallan oItem in oTaxChallans) // // { // // if (count == oTaxChallans.Count) // // { // // sChallanNo += "#" + oItem.ChallanNo + " dated " + oItem.DepositDate.ToString("dd-MMM-yyyy"); // // //sChallanNo += oItem.ChallanNo; // // } // // else // // { // // sChallanNo +="#"+oItem.ChallanNo + " dated " +oItem.DepositDate.ToString("dd-MMM-yyyy") +","; // // //sChallanNo += oItem.ChallanNo + ","; // // count++; // // } // // } // //} // dChallan["ChallanNo"] = sChallanNo; // dTChallan.Rows.Add(dChallan); // dTChallan.TableName = "PayrollDataSet_TaxChallan"; // _dSet.Tables.Add(dTChallan); // AddPageForTC(); // PrintBodyForTC(); // PrintSlabForTC(); //} m_oDoc.PreviewDoc(); } public ReportSetup SelectedParameter { set { _selectedParameter = value; } } private DataRow getARow(DataRow orow, IncomeTax oItem) { if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Annual_Salary_Income) { DataRow dr = orow; dr["EmpID"] = oItem.EmployeeID; dr["ItemCode"] = oItem.ItemGroup; dr["ItemID"] = oItem.ItemID; dr["IncomeHead"] = oItem.Description; dr["AmountPerAnnum"] = GlobalFunctions.TakaFormat(_AmountPerAnnum); //oDRow["AmountPerannum"]; dr["ThisMonth"] = GlobalFunctions.TakaFormat(_ThisMonthAmount); dr["PaidTillDate"] = GlobalFunctions.TakaFormat(_PaidTillDateAmount);//oDRow["PaidTillDate"]; dr["Projected"] = GlobalFunctions.TakaFormat(_ProjectedAmount); dr["Position"] = oItem.Position; dr["Side"] = oItem.Side; dr["LessExaempted"] = "0"; dr["RowSequence"] = oItem.Position; return dr; } else if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Annual_Income) { DataRow dr = orow; dr["EmpID"] = oItem.EmployeeID; dr["ItemCode"] = oItem.ItemGroup; dr["ItemID"] = oItem.ItemID; dr["IncomeHead"] = oItem.Description; dr["AmountPerAnnum"] = GlobalFunctions.TakaFormat(_TAmountPerAnnum); //oDRow["AmountPerannum"]; dr["ThisMonth"] = GlobalFunctions.TakaFormat(_TThisMonthAmount); dr["PaidTillDate"] = GlobalFunctions.TakaFormat(_TPaidTillDateAmount);//oDRow["PaidTillDate"]; dr["Projected"] = GlobalFunctions.TakaFormat(_TProjectedAmount); dr["Position"] = oItem.Position; dr["Side"] = oItem.Side; dr["LessExaempted"] = "0"; dr["RowSequence"] = oItem.Position; return dr; } else { DataRow dr = orow; dr["EmpID"] = oItem.EmployeeID; dr["ItemCode"] = oItem.ItemGroup; dr["ItemID"] = oItem.ItemID; dr["IncomeHead"] = oItem.Description; dr["AmountPerAnnum"] = GlobalFunctions.TakaFormat(oItem.TotalAmount); //oDRow["AmountPerannum"]; dr["ThisMonth"] = GlobalFunctions.TakaFormat(oItem.ThisMonthAmount); dr["PaidTillDate"] = GlobalFunctions.TakaFormat(oItem.PreviousAmount);//oDRow["PaidTillDate"]; dr["Projected"] = GlobalFunctions.TakaFormat(oItem.ProjectedAmount); dr["Position"] = oItem.Position; dr["Side"] = oItem.Side; if (!(oItem.ItemGroup == EnumIncomeTaxItemGroup.Company_Contri_PF)) { _AmountPerAnnum += oItem.TotalAmount; _ThisMonthAmount += oItem.ThisMonthAmount; _PaidTillDateAmount += oItem.PreviousAmount; _ProjectedAmount += oItem.ProjectedAmount; } _TAmountPerAnnum += oItem.TotalAmount; _TThisMonthAmount += oItem.ThisMonthAmount; _TPaidTillDateAmount += oItem.PreviousAmount; _TProjectedAmount += oItem.ProjectedAmount; dr["LessExaempted"] = "0"; dr["RowSequence"] = oItem.Position; return dr; } } private DataSet PrepareDataset(ID nEmpID, bool isCurrentYear) { DataSet orootDataset = new DataSet(); DataRow dr = null; IncomeTax oIncomeTax = new IncomeTax(); PayrollDataSet.PayrollDataSet.IncomeTaxDataTable dTable1 = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxDataTable(); PayrollDataSet.PayrollDataSet.IncomeTaxDataTable dTable2 = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxDataTable(); DataRow houseRent = null; DataRow Conveyance = null; DataRow Medical = null; DataRow lfa = null; DataRow TotalSalaryExepted = null; DataRow TotalAnnualExepted = null; _InvestmentAmount = 0.0; _TotalTaxAmount = 0.0; _LessExemptedAmount = 0.0; _PaidTillDateAmount = 0.0; _ThisMonthAmount = 0.0; _ProjectedAmount = 0.0; _AmountPerAnnum = 0.0; _TotalSalaryExempted = 0.0; _TotalAnnuaExempted = 0.0; _TPaidTillDateAmount = 0.0; _TThisMonthAmount = 0.0; _TProjectedAmount = 0.0; _TAmountPerAnnum = 0.0; _pfInvestment = 0; _otherInvestment = 0; _investmentAllowed = 0; _20Investment = 0; foreach (IncomeTax oItem in _incometaxes) { if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance || oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance || oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Medical_Allowance || oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_LFA_Allowance) continue; if (oItem.Side == EnumIncomeTaxSide.Inc_SalaryIncome || oItem.Side == EnumIncomeTaxSide.Dec_SalaryIncome) { dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, oItem)); if (oItem.ItemGroup == EnumIncomeTaxItemGroup.House_Rent_Allowance) houseRent = dr; if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Medical_Allowance) Medical = dr; if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Conveyance_Allowance) Conveyance = dr; if (oItem.ItemGroup == EnumIncomeTaxItemGroup.LFA_Allowance) lfa = dr; } } if (houseRent != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; houseRent["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } if (Medical != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_Medical_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; Medical["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } if (Conveyance != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; Conveyance["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } if (lfa != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_LFA_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; lfa["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } IncomeTax salaryIncome = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Annual_Salary_Income, (int)EnumIncomeTaxItemGroup.Annual_Salary_Income); if (salaryIncome != null) { dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, salaryIncome)); TotalSalaryExepted = dr; TotalSalaryExepted["LessExaempted"] = _TotalSalaryExempted; } foreach (IncomeTax oItem in _incometaxes) { if (oItem.Side == EnumIncomeTaxSide.Inc_AnnualIncome || oItem.Side == EnumIncomeTaxSide.Dec_AnnualIncome) { if (oItem.Side == EnumIncomeTaxSide.Dec_AnnualIncome) { oItem.ProjectedAmount = -oItem.ProjectedAmount; oItem.TotalAmount = -oItem.TotalAmount; } dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, oItem)); } } IncomeTax totalAnnualIncome = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Annual_Income, (int)EnumIncomeTaxItemGroup.Annual_Income); if (totalAnnualIncome != null) { dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, totalAnnualIncome)); TotalAnnualExepted = dr; TotalAnnualExepted["LessExaempted"] = _TotalSalaryExempted; } dTable1.TableName = "PayrollDataSet_IncomeTax"; orootDataset.Tables.Add(dTable1); // Crate Slab Data double ngrossTax = 0; PayrollDataSet.PayrollDataSet.IncomeTaxSlabDataTable dTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxSlabDataTable(); _InvestmentAmount = _taxParameter.MaxInvAmount; if (totalAnnualIncome != null) { ObjectsTemplate empTaxSlabs = TaxParameter.CalculateTaxOnSlab(_taxParameter, _employee, totalAnnualIncome.TotalAmount); int index = 0; dr = null; foreach (TaxParameterSlab drr in empTaxSlabs) { dr = dTable.NewRow(); dr["CurrentRate"] = drr.TaxPercent.ToString() + "%"; if (index == 0) dr["Parameter"] = "On First BDT-" + drr.IncomeAmount.ToString(); else if (index + 1 == empTaxSlabs.Count) dr["Parameter"] = "On Remaining Balance";// + drr.IncomeAmount.ToString(); else dr["Parameter"] = "On Next BDT-" + drr.IncomeAmount.ToString(); dr["TaxableIncome"] = drr.SlabTaxableAmount.ToString(); dr["IndividualTaxLiability"] = drr.SlabTaxAmount.ToString(); index++; dTable.Rows.Add(dr); ngrossTax = ngrossTax + drr.SlabTaxAmount; } } dTable.TableName = "PayrollDataSet_IncomeTaxSlab"; orootDataset.Tables.Add(dTable); //Create other items PayrollDataSet.PayrollDataSet.IncomeTaxOtherDataTable oDTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxOtherDataTable(); // DataSet oIncomeTaxOth = IncomeTax.GetEmpIDforOthTax(dataFrom, nEmpID); DataRow oDRow = null; //IncomeTax oInvestment = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Tax_Credit_On_Investment, // (int)EnumIncomeTaxItemGroup.Tax_Credit_On_Investment); //if (oInvestment != null) //{ // oDRow = oDTable.NewRow(); // oDRow["DataColumn1"] = oInvestment.Description; // oDRow["DataColumn2"] = ""; // oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oInvestment.TotalAmount); // oDTable.Rows.Add(oDRow); //} IncomeTax investmentCapdo; if (_investmentwithoutPF == false) { investmentCapdo = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Annual_Income, (int)EnumIncomeTaxItemGroup.Annual_Income); if (investmentCapdo != null) _20Investment = (investmentCapdo.TotalAmount * _taxParameter.MaxInvestPercent) / 100; } else { investmentCapdo = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Annual_Income, (int)EnumIncomeTaxItemGroup.Annual_Income); if (investmentCapdo != null) _20Investment = (investmentCapdo.TotalAmount * _taxParameter.MaxInvestPercent) / 100; } IncomeTax acinvestment = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual); if (acinvestment != null) _actualInvestment = acinvestment.TotalAmount; IncomeTax taxRebate = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Investment_Allowed, (int)EnumIncomeTaxItemGroup.Investment_Allowed); if (taxRebate != null) { _investmentAllowed = taxRebate.TotalAmount; string spf = ""; IncomeTax pf = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Company_Contri_PF, (int)EnumIncomeTaxItemGroup.Company_Contri_PF); if (pf != null) { _pfInvestment = pf.TotalAmount; double npfamount = 0; double otherAmount = 0; IncomeTax actualInvestment = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual); npfamount = (pf.TotalAmount * 2 > taxRebate.TotalAmount) ? taxRebate.TotalAmount : pf.TotalAmount * 2; if (actualInvestment == null) { otherAmount = taxRebate.TotalAmount - pf.TotalAmount * 2; if (otherAmount < 0) otherAmount = 0; _otherInvestment = otherAmount; } else { otherAmount = actualInvestment.TotalAmount; _otherInvestment = otherAmount; } if (ngrossTax <= 0) _otherInvestment = 0; // spf = "PF: " + GlobalFunctions.TakaFormat(npfamount) + ", Other: " + GlobalFunctions.TakaFormat(otherAmount); spf = ""; } oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = taxRebate.Description; oDRow["DataColumn2"] = spf; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(taxRebate.TotalAmount); // oDTable.Rows.Add(oDRow); } foreach (IncomeTax oItem in _incometaxes) { if (oItem.Side == EnumIncomeTaxSide.Inc_GrossTax || oItem.Side == EnumIncomeTaxSide.Dec_GrossTax) { oDRow = oDTable.NewRow(); if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Tax_Credit_On_Investment) { oDRow["DataColumn1"] = oItem.Description;// +" @ " + _taxParameter.MaxInvExempPercent.ToString() + "%"; if (ngrossTax > 0) oDRow["DataColumn3"] = "(" + GlobalFunctions.TakaFormat(oItem.TotalAmount) + ")"; else oDRow["DataColumn3"] = "(0)"; } else { oDRow["DataColumn1"] = oItem.Description; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oItem.TotalAmount); } oDRow["DataColumn2"] = ""; oDTable.Rows.Add(oDRow); } } IncomeTax oNetTaxPayable = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Net_Payable, (int)EnumIncomeTaxItemGroup.Net_Payable); if (oNetTaxPayable != null) { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = oNetTaxPayable.Description; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oNetTaxPayable.TotalAmount); oDTable.Rows.Add(oDRow); } IncomeTax oTaxDeducted = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Tax_Deducted, (int)EnumIncomeTaxItemGroup.Tax_Deducted); if (!isCurrentYear) { if (oTaxDeducted != null) { if (oTaxDeducted.PreviousAmount > 0) { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax paid up to previous month"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.PreviousAmount); oDTable.Rows.Add(oDRow); } if (oTaxDeducted.ThisMonthAmount > 0) { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax paid this month"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.ThisMonthAmount); oDTable.Rows.Add(oDRow); } oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Total Tax Deducted"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.TotalAmount); oDTable.Rows.Add(oDRow); } } else { if (oTaxDeducted != null) { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax paid up to previous month"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.PreviousAmount); oDTable.Rows.Add(oDRow); oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax paid this month"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.ThisMonthAmount); oDTable.Rows.Add(oDRow); oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax to be paid upto June"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oNetTaxPayable.TotalAmount - oTaxDeducted.TotalAmount); oDTable.Rows.Add(oDRow); } } oDTable.TableName = "PayrollDataSet_IncomeTaxOther"; orootDataset.Tables.Add(oDTable); //PayrollDataSet.PayrollDataSet.ITHeaderDataTable oMulIT = new Payroll.Report.PayrollDataSet.PayrollDataSet.ITHeaderDataTable(); //Employee oEmp = Employee.Get(nEmpID); //oDRow = oMulIT.NewRow(); //oDRow["EmpNo"] = oEmp.EmployeeNo; //oDRow["EmpName"] = oEmp.Name; //oDRow["TINNo"] = oEmp.TinNo; //oDRow["AssesmentYear"] = _taxParameter.AssessmentYear; //oDRow["FiscalYear"] = _taxParameter.FiscalYear; //oMulIT.Rows.Add(oDRow); //oMulIT.TableName = "PayrollDataSet_ITHeader"; //orootDataset.Tables.Add(oMulIT); return orootDataset; } private DataSet PrepareOldDataset(ID nEmpID, DataRow employee) { DataSet orootDataset = new DataSet(); DataRow dr = null; IncomeTax oIncomeTax = new IncomeTax(); PayrollDataSet.PayrollDataSet.IncomeTaxDataTable dTable1 = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxDataTable(); PayrollDataSet.PayrollDataSet.IncomeTaxDataTable dTable2 = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxDataTable(); DataRow houseRent = null; DataRow Conveyance = null; DataRow Medical = null; DataRow lfa = null; DataRow TotalSalaryExepted = null; DataRow TotalAnnualExepted = null; _InvestmentAmount = 0.0; _TotalTaxAmount = 0.0; _LessExemptedAmount = 0.0; _PaidTillDateAmount = 0.0; _ThisMonthAmount = 0.0; _ProjectedAmount = 0.0; _AmountPerAnnum = 0.0; _TotalSalaryExempted = 0.0; _TotalAnnuaExempted = 0.0; _TPaidTillDateAmount = 0.0; _TThisMonthAmount = 0.0; _TProjectedAmount = 0.0; _TAmountPerAnnum = 0.0; _pfInvestment = 0; _otherInvestment = 0; _investmentAllowed = 0; _20Investment = 0; foreach (IncomeTax oItem in _incometaxes) { if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance || oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance || oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Medical_Allowance || oItem.ItemGroup == EnumIncomeTaxItemGroup.Exemption_LFA_Allowance) continue; if (oItem.Side == EnumIncomeTaxSide.Inc_SalaryIncome || oItem.Side == EnumIncomeTaxSide.Dec_SalaryIncome) { dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, oItem)); if (oItem.ItemGroup == EnumIncomeTaxItemGroup.House_Rent_Allowance) houseRent = dr; if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Medical_Allowance) Medical = dr; if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Conveyance_Allowance) Conveyance = dr; if (oItem.ItemGroup == EnumIncomeTaxItemGroup.LFA_Allowance) lfa = dr; } } if (houseRent != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; houseRent["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } if (Medical != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_Medical_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; Medical["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } if (Conveyance != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; Conveyance["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } if (lfa != null) { IncomeTax taxAmount = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Exemption_LFA_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance); if (taxAmount != null) { _TotalSalaryExempted += taxAmount.TotalAmount; lfa["LessExaempted"] = GlobalFunctions.TakaFormat(taxAmount.TotalAmount); } } IncomeTax salaryIncome = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Annual_Salary_Income, (int)EnumIncomeTaxItemGroup.Annual_Salary_Income); if (salaryIncome != null) { dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, salaryIncome)); TotalSalaryExepted = dr; TotalSalaryExepted["LessExaempted"] = _TotalSalaryExempted; } foreach (IncomeTax oItem in _incometaxes) { if (oItem.Side == EnumIncomeTaxSide.Inc_AnnualIncome || oItem.Side == EnumIncomeTaxSide.Dec_AnnualIncome) { dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, oItem)); //_TotalAnnuaExempted = oItem.TotalAmount; } } IncomeTax totalAnnualIncome = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Annual_Income, 0); if (totalAnnualIncome != null) { dr = dTable1.NewRow(); dTable1.Rows.Add(this.getARow(dr, totalAnnualIncome)); TotalAnnualExepted = dr; TotalAnnualExepted["LessExaempted"] = _TotalSalaryExempted; } dTable1.TableName = "PayrollDataSet_IncomeTax"; orootDataset.Tables.Add(dTable1); // Crate Slab Data double ngrossTax = 0; PayrollDataSet.PayrollDataSet.IncomeTaxSlabDataTable dTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxSlabDataTable(); _InvestmentAmount = _taxParameter.MaxInvAmount; if (totalAnnualIncome != null) { ObjectsTemplate empTaxSlabs = TaxParameter.CalculateOldTaxOnSlab(_taxParameter, employee, totalAnnualIncome.TotalAmount); int index = 0; dr = null; foreach (TaxParameterSlab drr in empTaxSlabs) { dr = dTable.NewRow(); dr["CurrentRate"] = drr.TaxPercent.ToString() + "%"; if (index == 0) dr["Parameter"] = "On First BDT-" + drr.IncomeAmount.ToString(); else if (index + 1 == empTaxSlabs.Count) dr["Parameter"] = "On Remaining Balance";// + drr.IncomeAmount.ToString(); else dr["Parameter"] = "On Next BDT-" + drr.IncomeAmount.ToString(); dr["TaxableIncome"] = drr.SlabTaxableAmount.ToString(); dr["IndividualTaxLiability"] = drr.SlabTaxAmount.ToString(); index++; dTable.Rows.Add(dr); ngrossTax = ngrossTax + drr.SlabTaxAmount; } } dTable.TableName = "PayrollDataSet_IncomeTaxSlab"; orootDataset.Tables.Add(dTable); //Create other items PayrollDataSet.PayrollDataSet.IncomeTaxOtherDataTable oDTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxOtherDataTable(); // DataSet oIncomeTaxOth = IncomeTax.GetEmpIDforOthTax(dataFrom, nEmpID); DataRow oDRow = null; //IncomeTax oInvestment = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Tax_Credit_On_Investment, // (int)EnumIncomeTaxItemGroup.Tax_Credit_On_Investment); //if (oInvestment != null) //{ // oDRow = oDTable.NewRow(); // oDRow["DataColumn1"] = oInvestment.Description; // oDRow["DataColumn2"] = ""; // oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oInvestment.TotalAmount); // oDTable.Rows.Add(oDRow); //} IncomeTax investmentCapdo; if (_investmentwithoutPF == false) { investmentCapdo = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Annual_Income, (int)EnumIncomeTaxItemGroup.Annual_Income); if (investmentCapdo != null) _20Investment = (investmentCapdo.TotalAmount * _taxParameter.MaxInvestPercent) / 100; } else { investmentCapdo = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Annual_Salary_Income, (int)EnumIncomeTaxItemGroup.Annual_Salary_Income); if (investmentCapdo != null) _20Investment = (investmentCapdo.TotalAmount * _taxParameter.MaxInvestPercent) / 100; } IncomeTax acinvestment = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual); if (acinvestment != null) _actualInvestment = acinvestment.TotalAmount; IncomeTax taxRebate = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Investment_Allowed, (int)EnumIncomeTaxItemGroup.Investment_Allowed); if (taxRebate != null) { _investmentAllowed = taxRebate.TotalAmount; string spf = ""; IncomeTax pf = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Company_Contri_PF, (int)EnumIncomeTaxItemGroup.Company_Contri_PF); if (pf != null) { _pfInvestment = pf.TotalAmount; double npfamount = 0; double otherAmount = 0; IncomeTax actualInvestment = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual); npfamount = (pf.TotalAmount * 2 > taxRebate.TotalAmount) ? taxRebate.TotalAmount : pf.TotalAmount * 2; if (actualInvestment == null) { otherAmount = taxRebate.TotalAmount - pf.TotalAmount * 2; if (otherAmount < 0) otherAmount = 0; _otherInvestment = otherAmount; } else { otherAmount = actualInvestment.TotalAmount; _otherInvestment = otherAmount; } if (ngrossTax <= 0) _otherInvestment = 0; // spf = "PF: " + GlobalFunctions.TakaFormat(npfamount) + ", Other: " + GlobalFunctions.TakaFormat(otherAmount); spf = ""; } oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = taxRebate.Description; oDRow["DataColumn2"] = spf; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(taxRebate.TotalAmount); // oDTable.Rows.Add(oDRow); } foreach (IncomeTax oItem in _incometaxes) { if (oItem.Side == EnumIncomeTaxSide.Inc_GrossTax || oItem.Side == EnumIncomeTaxSide.Dec_GrossTax) { oDRow = oDTable.NewRow(); if (oItem.ItemGroup == EnumIncomeTaxItemGroup.Tax_Credit_On_Investment) { oDRow["DataColumn1"] = oItem.Description + " @ " + _taxParameter.MaxInvExempPercent.ToString() + "%"; if (ngrossTax > 0) oDRow["DataColumn3"] = "(" + GlobalFunctions.TakaFormat(oItem.TotalAmount) + ")"; else oDRow["DataColumn3"] = "(0)"; } else { oDRow["DataColumn1"] = oItem.Description; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oItem.TotalAmount); } oDRow["DataColumn2"] = ""; oDTable.Rows.Add(oDRow); } } IncomeTax oNetTaxPayable = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Net_Payable, (int)EnumIncomeTaxItemGroup.Net_Payable); if (oNetTaxPayable != null) { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = oNetTaxPayable.Description; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oNetTaxPayable.TotalAmount); oDTable.Rows.Add(oDRow); } IncomeTax oTaxDeducted = IncomeTax.Get(_incometaxes, nEmpID, EnumIncomeTaxItemGroup.Tax_Deducted, (int)EnumIncomeTaxItemGroup.Tax_Deducted); if (_isPrvs) { if (oTaxDeducted != null) { oDRow = oDTable.NewRow(); //oDRow["DataColumn1"] = "Tax deducted from salary"; oDRow["DataColumn1"] = "Total Tax Paid"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.TotalAmount); oDTable.Rows.Add(oDRow); } } else { if (oTaxDeducted != null) { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax paid up to previous month"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.PreviousAmount); oDTable.Rows.Add(oDRow); oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax paid this month"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oTaxDeducted.ThisMonthAmount); oDTable.Rows.Add(oDRow); oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = "Tax to be paid upto June"; oDRow["DataColumn2"] = ""; oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(oNetTaxPayable.TotalAmount - oTaxDeducted.TotalAmount); oDTable.Rows.Add(oDRow); } } oDTable.TableName = "PayrollDataSet_IncomeTaxOther"; orootDataset.Tables.Add(oDTable); //PayrollDataSet.PayrollDataSet.ITHeaderDataTable oMulIT = new Payroll.Report.PayrollDataSet.PayrollDataSet.ITHeaderDataTable(); //Employee oEmp = Employee.Get(nEmpID); //oDRow = oMulIT.NewRow(); //oDRow["EmpNo"] = oEmp.EmployeeNo; //oDRow["EmpName"] = oEmp.Name; //oDRow["TINNo"] = oEmp.TinNo; //oDRow["AssesmentYear"] = _taxParameter.AssessmentYear; //oDRow["FiscalYear"] = _taxParameter.FiscalYear; //oMulIT.Rows.Add(oDRow); //oMulIT.TableName = "PayrollDataSet_ITHeader"; //orootDataset.Tables.Add(oMulIT); return orootDataset; } private DataTable GetIncomeTaxData(EnumIncomeTaxDataFrom dataFrom, ID nEmpID) { DataRow dr = null; IncomeTax oIncomeTax = new IncomeTax(); DataSet oIncomeTaxs = IncomeTax.GetByEmpID(dataFrom, nEmpID); PayrollDataSet.PayrollDataSet.IncomeTaxDataTable dTable1 = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxDataTable(); PayrollDataSet.PayrollDataSet.IncomeTaxDataTable dTable2 = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxDataTable(); foreach (DataRow oDRow in oIncomeTaxs.Tables[0].Rows) { if (Convert.ToInt32(oDRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Basic_Salary)) //-201 { dr = dTable1.NewRow(); dr["EmpID"] = oDRow["EMPLOYEEID"]; dr["ItemCode"] = oDRow["ItemCode"]; dr["ItemID"] = oDRow["ItemID"]; dr["IncomeHead"] = oDRow["IncomeHead"]; dr["AmountPerAnnum"] = oDRow["AmountPerannum"]; dr["ThisMonth"] = oDRow["ThisMonth"]; dr["PaidTillDate"] = oDRow["PaidTillDate"]; dr["Projected"] = oDRow["Projected"]; dr["Position"] = oDRow["Position"]; dr["Side"] = oDRow["Side"]; _AmountPerAnnum += Convert.ToDouble(oDRow["AmountPerannum"]); _ThisMonthAmount += Convert.ToDouble(oDRow["ThisMonth"]); _PaidTillDateAmount += Convert.ToDouble(oDRow["PaidTillDate"]); _ProjectedAmount += Convert.ToDouble(oDRow["Projected"]); if (oDRow["Exempted"].ToString() != string.Empty) { _LessExemptedAmount += Convert.ToDouble(oDRow["Exempted"]); dr["LessExaempted"] = oDRow["Exempted"]; } else { dr["LessExaempted"] = "0"; } dr["RowSequence"] = 1; dTable1.Rows.Add(dr); } else if (Convert.ToInt32(oDRow["Side"]) == Convert.ToInt32(EnumIncomeTaxSide.Inc_SalaryIncome) && Convert.ToInt32(oDRow["ItemCode"]) != Convert.ToInt32(EnumIncomeTaxItemGroup.Basic_Salary)) //Side=6 and -201 { dr = dTable1.NewRow(); dr["EmpID"] = oDRow["EMPLOYEEID"]; dr["ItemCode"] = oDRow["ItemCode"]; dr["ItemID"] = oDRow["ItemID"]; dr["IncomeHead"] = oDRow["IncomeHead"]; dr["AmountPerAnnum"] = oDRow["AmountPerannum"]; dr["ThisMonth"] = oDRow["ThisMonth"]; dr["PaidTillDate"] = oDRow["PaidTillDate"]; dr["Projected"] = oDRow["Projected"]; dr["Position"] = oDRow["Position"]; dr["Side"] = oDRow["Side"]; _AmountPerAnnum += Convert.ToDouble(oDRow["AmountPerannum"]); _ThisMonthAmount += Convert.ToDouble(oDRow["ThisMonth"]); _PaidTillDateAmount += Convert.ToDouble(oDRow["PaidTillDate"]); _ProjectedAmount += Convert.ToDouble(oDRow["Projected"]); if (oDRow["Exempted"].ToString() != string.Empty) { _LessExemptedAmount += Convert.ToDouble(oDRow["Exempted"]); dr["LessExaempted"] = oDRow["Exempted"]; } else { dr["LessExaempted"] = "0"; } dr["RowSequence"] = 2; dTable1.Rows.Add(dr); } else if (Convert.ToInt32(oDRow["Side"]) == Convert.ToInt32(EnumIncomeTaxSide.Tax_fixed_Item) && Convert.ToInt32(oDRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Annual_Salary_Income)) //Side=10 TaxGroup=-216 { dr = dTable1.NewRow(); dr["EmpID"] = oDRow["EMPLOYEEID"]; dr["ItemCode"] = oDRow["ItemCode"]; dr["ItemID"] = oDRow["ItemID"]; dr["IncomeHead"] = oDRow["IncomeHead"]; dr["AmountPerAnnum"] = _AmountPerAnnum;//oDRow["AmountPerannum"]; dr["ThisMonth"] = _ThisMonthAmount;//oDRow["ThisMonth"]; dr["PaidTillDate"] = _PaidTillDateAmount;//oDRow["PaidTillDate"]; dr["Projected"] = _ProjectedAmount;//oDRow["Projected"]; dr["Position"] = oDRow["Position"]; dr["Side"] = oDRow["Side"]; //if (oDRow["Exempted"].ToString() != string.Empty) //{ dr["LessExaempted"] = _LessExemptedAmount;//oDRow["Exempted"]; //} //else //{ // dr["LessExaempted"] = "0"; //} dr["RowSequence"] = 3; dTable1.Rows.Add(dr); } else if (Convert.ToInt32(oDRow["Side"]) == Convert.ToInt32(EnumIncomeTaxSide.Inc_AnnualIncome) || Convert.ToInt32(oDRow["Side"]) == Convert.ToInt32(EnumIncomeTaxSide.Dec_AnnualIncome)) //Side=8 and 9 { dr = dTable1.NewRow(); dr["EmpID"] = oDRow["EMPLOYEEID"]; dr["ItemCode"] = oDRow["ItemCode"]; dr["ItemID"] = oDRow["ItemID"]; dr["IncomeHead"] = oDRow["IncomeHead"]; dr["AmountPerAnnum"] = oDRow["AmountPerannum"]; dr["ThisMonth"] = oDRow["ThisMonth"]; dr["PaidTillDate"] = oDRow["PaidTillDate"]; dr["Projected"] = oDRow["Projected"]; dr["Position"] = oDRow["Position"]; dr["Side"] = oDRow["Side"]; dr["LessExaempted"] = oDRow["Exempted"]; _AmountPerAnnum += Convert.ToDouble(oDRow["AmountPerannum"]); _ThisMonthAmount += Convert.ToDouble(oDRow["ThisMonth"]); _PaidTillDateAmount += Convert.ToDouble(oDRow["PaidTillDate"]); _ProjectedAmount += Convert.ToDouble(oDRow["Projected"]); if (oDRow["Exempted"].ToString() != string.Empty) { _LessExemptedAmount += Convert.ToDouble(oDRow["Exempted"]); dr["LessExaempted"] = oDRow["Exempted"]; } else { dr["LessExaempted"] = "0"; } dr["RowSequence"] = 4; dTable1.Rows.Add(dr); } else if (Convert.ToInt32(oDRow["Side"]) == Convert.ToInt32(EnumIncomeTaxSide.Tax_fixed_Item) && Convert.ToInt32(oDRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Annual_Income)) //Side=10 ItemGroup=-217 { dr = dTable1.NewRow(); dr["EmpID"] = oDRow["EMPLOYEEID"]; dr["ItemCode"] = oDRow["ItemCode"]; dr["ItemID"] = oDRow["ItemID"]; dr["IncomeHead"] = oDRow["IncomeHead"]; dr["AmountPerAnnum"] = _AmountPerAnnum;//oDRow["AmountPerannum"]; dr["ThisMonth"] = _ThisMonthAmount;//oDRow["ThisMonth"]; dr["PaidTillDate"] = _PaidTillDateAmount;//oDRow["PaidTillDate"]; dr["Projected"] = _ProjectedAmount;//oDRow["Projected"]; dr["Position"] = oDRow["Position"]; dr["Side"] = oDRow["Side"]; dr["LessExaempted"] = oDRow["Exempted"]; //if (oDRow["Exempted"].ToString() != string.Empty) //{ dr["LessExaempted"] = _LessExemptedAmount;//oDRow["Exempted"]; //} //else //{ // dr["LessExaempted"] = "0"; //} _TotalTaxAmount = Convert.ToDouble(oDRow["AmountPerannum"]); dr["RowSequence"] = 5; dTable1.Rows.Add(dr); } } return dTable1; } private DataSet GetIncomeTaxSlabs(ID TaxParamID, ID EmpID) { DataSet dSet = new DataSet(); TaxParameter oTaxParameter = new TaxParameter(); Employee emp = Employee.Get(EmpID); TaxParameter parameter = TaxParameter.Get(TaxParamID); _InvestmentAmount = parameter.MaxInvAmount; ObjectsTemplate empTaxSlabs = TaxParameter.CalculateTaxOnSlab(parameter, emp, _TotalTaxAmount); PayrollDataSet.PayrollDataSet.IncomeTaxSlabDataTable dTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxSlabDataTable(); int index = 0; DataRow dr = null; foreach (TaxParameterSlab drr in empTaxSlabs) { dr = dTable.NewRow(); dr["CurrentRate"] = drr.TaxPercent.ToString(); if (index == 0) dr["Parameter"] = "On First BDT-" + drr.IncomeAmount.ToString(); else if (index + 1 == empTaxSlabs.Count) dr["Parameter"] = "On Remaining Balance" + drr.IncomeAmount.ToString(); else dr["Parameter"] = "On Next BDT-" + drr.IncomeAmount.ToString(); dr["TaxableIncome"] = drr.SlabTaxableAmount.ToString(); dr["IndividualTaxLiability"] = drr.SlabTaxAmount.ToString(); index++; dTable.Rows.Add(dr); } dSet.Tables.Add(dTable); return dSet; } private DataTable GetIncomeTaxOthers(EnumIncomeTaxDataFrom dataFrom, ID nEmpID) { PayrollDataSet.PayrollDataSet.IncomeTaxOtherDataTable oDTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.IncomeTaxOtherDataTable(); DataSet oIncomeTaxOth = IncomeTax.GetEmpIDforOthTax(dataFrom, nEmpID); DataRow oDRow = null; double TotalPFInvest = 0.0; double TotalOtherInvest = 0.0; double CPFAmount = 0.0; foreach (DataRow oRow in oIncomeTaxOth.Tables[0].Rows) { //if(Convert.ToInt32(oRow["ItemCode"])==Convert.ToInt32(EnumIncomeTaxItemGroup.Investment_Allowed)) //Item Group=-220 //{ // oDRow=oDTable.NewRow(); // oDRow["DataColumn1"] = oRow["IncomeHead"]; // foreach (DataRow oR in oIncomeTaxOth.Tables[0].Rows) // { // if (Convert.ToInt32(oR["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Company_Contri_PF) && Convert.ToInt32(oR["Side"]) == Convert.ToInt32(EnumIncomeTaxSide.Inc_SalaryIncome)) //Item Group=-207 and Side=8 // { // CPFAmount = Convert.ToDouble(oR["PaidTillDate"]) + Convert.ToDouble(oR["ThisMonth"]) + Convert.ToDouble(oR["Projected"]); // if (CPFAmount > _InvestmentAmount) // { // TotalPFInvest = _InvestmentAmount; // } // else // { // TotalPFInvest = CPFAmount; // } // } // } // TotalOtherInvest = Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"]); // oDRow["DataColumn2"] = "PF Inv." + GlobalFunctions.TakaFormat(TotalPFInvest) + "," + "Others:" + GlobalFunctions.TakaFormat(TotalOtherInvest); // oDRow["DataColumn3"] = "(PF + Other):" + GlobalFunctions.TakaFormat((TotalPFInvest + TotalOtherInvest)); // oDTable.Rows.Add(oDRow); //} if (Convert.ToInt32(oRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Tax_Credit_On_Investment)) //Item Group=-210 { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = oRow["IncomeHead"]; oDRow["DataColumn2"] = "";//"PF Inv.(10%)" + GlobalFunctions.TakaFormat((TotalPFInvest / 10)) + "," + "Others(10%):" + GlobalFunctions.TakaFormat((TotalOtherInvest / 10)); oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"]));//"(" + GlobalFunctions.TakaFormat((TotalPFInvest + TotalOtherInvest) / 10) + ")"; oDTable.Rows.Add(oDRow); } //else if (Convert.ToInt32(oRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Gross_Tax)) //Item Group=-218 //{ // oDRow = oDTable.NewRow(); // oDRow["DataColumn1"] = oRow["IncomeHead"]; // oDRow["DataColumn2"] = ""; // oDRow["DataColumn3"] =GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); // oDTable.Rows.Add(oDRow); //} else if (Convert.ToInt32(oRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Tax_Gross_OtherRebate)) //Item Group=-211 { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = oRow["IncomeHead"]; oDRow["DataColumn2"] = "";//"Prv.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"])) + ", " + "Curr.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["ThisMonth"])); oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); ;//GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); oDTable.Rows.Add(oDRow); } else if (Convert.ToInt32(oRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Tax_Gross_OtherAddable)) //Item Group=-211 { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = oRow["IncomeHead"]; oDRow["DataColumn2"] = "";//"Prv.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"])) + ", " + "Curr.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["ThisMonth"])); oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); ;//GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); oDTable.Rows.Add(oDRow); } else if (Convert.ToInt32(oRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Net_Payable)) //Item Group=-211 { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = oRow["IncomeHead"]; oDRow["DataColumn2"] = "";//"Prv.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"])) + ", " + "Curr.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["ThisMonth"])); oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); ;//GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); oDTable.Rows.Add(oDRow); } else if (Convert.ToInt32(oRow["ItemCode"]) == Convert.ToInt32(EnumIncomeTaxItemGroup.Tax_Deducted)) //Item Group=-212 { oDRow = oDTable.NewRow(); oDRow["DataColumn1"] = oRow["IncomeHead"]; oDRow["DataColumn2"] = "Prv.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"])) + ", " + "Curr.Deduct:" + GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["ThisMonth"])); oDRow["DataColumn3"] = GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); ;//GlobalFunctions.TakaFormat(Convert.ToDouble(oRow["PaidTillDate"]) + Convert.ToDouble(oRow["ThisMonth"]) + Convert.ToDouble(oRow["Projected"])); oDTable.Rows.Add(oDRow); } } return oDTable; } public void showTaxCard(bool IsCurrentYear, Employee oEmp, ID nTaxParamID, string sAssYear, string sFiscalYear) { IncomeTax oIncomeTax = new IncomeTax(); DataTable oDTableOthers = null; DataTable oDTableIncomeTax = null; _dSet = new DataSet(); fReportViewer form = new fReportViewer(); Payroll.Report.rptIncomeTax orptIncomeTax = new Payroll.Report.rptIncomeTax(); _item = ReportItem.GetByReportType(Convert.ToInt32(EnumReportType.ITIndividual)); if (IsCurrentYear) { oDTableIncomeTax = orptIncomeTax.GetIncomeTaxData(oIncomeTax.GetEnumForSalaryIT(oEmp.ID), oEmp.ID); } else { oDTableIncomeTax = orptIncomeTax.GetIncomeTaxData(EnumIncomeTaxDataFrom.ProcessedData, oEmp.ID); } oDTableIncomeTax.TableName = "PayrollDataSet_IncomeTax"; _dSet.Tables.Add(oDTableIncomeTax); _dITSlabs = orptIncomeTax.GetIncomeTaxSlabs(nTaxParamID, oEmp.ID); _dITSlabs.Tables[0].TableName = "PayrollDataSet_IncomeTaxSlab"; _dSet.Tables.Add(_dITSlabs.Tables[0].Copy()); if (IsCurrentYear) { oDTableOthers = orptIncomeTax.GetIncomeTaxOthers(oIncomeTax.GetEnumForSalaryIT(oEmp.ID), oEmp.ID); } else { oDTableOthers = orptIncomeTax.GetIncomeTaxOthers(EnumIncomeTaxDataFrom.ProcessedData, oEmp.ID); } oDTableOthers.TableName = "PayrollDataSet_IncomeTaxOther"; _dSet.Tables.Add(oDTableOthers.Copy()); RDLC = "Payroll.Report.RDLC.IncomeTax.rdlc"; form.ShowDlgForTaxCard(_item, _dSet, RDLC, oEmp.Name, oEmp.EmployeeNo, oEmp.TinNo, sAssYear, sFiscalYear); } //public void showTaxCard() //{ // DataSet orootDataset = new DataSet(); // fReportViewer form = new fReportViewer(); // IncomeTax oIncomeTax = new IncomeTax(); // DateTime salaryMonth = _selectedParameter.FromDate.Value; // string sEmpID = _selectedParameter.ReportItem.INSQL; // ObjectsTemplate oEMployees = Employee.GetByEmpIDs(sEmpID); // DataTable oFinalDSFMultipleEmp=null; // foreach(Employee oEmp in oEMployees) // { // ObjectsTemplate oincometaxes = IncomeTax.Get(oIncomeTax.GetEnumForSalaryIT(oEmp.ID), oEmp.ID,Payroll.BO.SystemInformation.CurrentSysInfo.TaxParamID); // oFinalDSFMultipleEmp=showMultipleEmployeeTaxCard(oincometaxes, oEmp); // } // oFinalDSFMultipleEmp.TableName = "PayrollDataSet_MultipleEmpIT"; // orootDataset.Tables.Add(oFinalDSFMultipleEmp); // RDLC = "Payroll.Report.RDLC.ITMultipleEmp.rdlc"; // form.ShowDlgForMultipleEmpTaxCard(_item, orootDataset, RDLC); //} //public DataTable showMultipleEmployeeTaxCard(ObjectsTemplate oincometaxes, Employee oEmp) //{ // IncomeTax oIncomeTax = new IncomeTax(); // DataTable oDFinalIncomeTax = null; // _dSet = new DataSet(); // fReportViewer form = new fReportViewer(); // _taxParameter = TaxParameter.Get(SystemInformation.CurrentSysInfo.TaxParamID); // _employee = oEmp; // _item = ReportItem.GetByReportType(Convert.ToInt32(EnumReportType.ITIndividual)); // _incometaxes = oincometaxes; // oDFinalIncomeTax = PrepareMultipleEmpDataset(oEmp); // return oDFinalIncomeTax; //} //public void xshowTaxCardMultiple() //{ // DataSet orootDataset = new DataSet(); // fReportViewer form = new fReportViewer(); // IncomeTax oIncomeTax = new IncomeTax(); // string sEmpID = _selectedParameter.ReportItem.INSQL; // ObjectsTemplate oEMployees = Employee.GetByEmpIDs(sEmpID); // DataSet oDFinalIncomeTax = null; // _taxParameter = TaxParameter.Get(SystemInformation.CurrentSysInfo.TaxParamID); // PayrollDataSet.PayrollDataSet.MultipleEmpITDataTable allTaxSheets = new Payroll.Report.PayrollDataSet.PayrollDataSet.MultipleEmpITDataTable(); // int nRowCount=0; // int ncount=0; // int nthirdRowcount = 0; // foreach (Employee oEmp in oEMployees) // { // _employee = oEmp; // _incometaxes = IncomeTax.Get(oIncomeTax.GetEnumForSalaryIT(oEmp.ID), oEmp.ID, Payroll.BO.SystemInformation.CurrentSysInfo.TaxParamID); // oDFinalIncomeTax = PrepareDataset(oEmp.ID); // ncount = nRowCount; // nthirdRowcount = nRowCount; // DataRow oNewRow = null; // foreach (DataRow oRow in oDFinalIncomeTax.Tables[0].Rows) // { // oNewRow = allTaxSheets.NewRow(); // oNewRow["EmpID"] = oEmp.ID; // oNewRow["EmpNo"] = oEmp.EmployeeNo; // oNewRow["EmpName"] = oEmp.Name; // oNewRow["TINNo"] = oEmp.TinNo; // oNewRow["AssesmentYear"] = _taxParameter.AssessmentYear; // oNewRow["FiscalYear"] = _taxParameter.FiscalYear; // oNewRow["ItemCode"] = oRow["ItemCode"]; // oNewRow["ItemID"] = oRow["ItemID"]; // oNewRow["IncomeHead"] = oRow["IncomeHead"]; // oNewRow["AmountPerAnnum"] = oRow["AmountPerAnnum"]; // oNewRow["ThisMonth"] = oRow["ThisMonth"]; // oNewRow["PaidTillDate"] = oRow["PaidTillDate"]; // oNewRow["Projected"] = oRow["Projected"]; // oNewRow["Position"] = oRow["Position"]; // oNewRow["Side"] = oRow["Side"]; // oNewRow["LessExaempted"] = oRow["LessExaempted"]; // oNewRow["RowSequence"] = oRow["RowSequence"]; // allTaxSheets.Rows.Add(oNewRow); // nRowCount = nRowCount + 1; // } // foreach (DataRow oRow in oDFinalIncomeTax.Tables[1].Rows) // { // allTaxSheets.Rows[ncount]["CurrentRate"] = oRow["CurrentRate"]; // allTaxSheets.Rows[ncount]["Parameter"] = oRow["Parameter"]; // allTaxSheets.Rows[ncount]["TaxableIncome"] = oRow["TaxableIncome"]; // allTaxSheets.Rows[ncount]["IndividualTaxLiability"] = oRow["IndividualTaxLiability"]; // ncount = ncount + 1; // } // foreach (DataRow oRow in oDFinalIncomeTax.Tables[2].Rows) // { // allTaxSheets.Rows[nthirdRowcount]["DataColumn1"] = oRow["DataColumn1"]; // allTaxSheets.Rows[nthirdRowcount]["DataColumn2"] = oRow["DataColumn2"]; // allTaxSheets.Rows[nthirdRowcount]["DataColumn3"] = oRow["DataColumn3"]; // nthirdRowcount = nthirdRowcount + 1; // } // } // allTaxSheets.TableName = "PayrollDataSet_MultipleEmpIT"; // orootDataset.Tables.Add(allTaxSheets); // RDLC = "Payroll.Report.RDLC.ITMultipleEmp.rdlc"; // form.ShowDlgForMultipleEmpTaxCard(_item, orootDataset, RDLC); //} public void showTaxCard(ObjectsTemplate oincometaxes, Employee oEmp, bool ITStatus) { _IsTaxCertificate = ITStatus; IncomeTax oIncomeTax = new IncomeTax(); ObjectsTemplate oTaxChallans = new ObjectsTemplate(); DataSet oDFinalIncomeTax = null; _dSet = new DataSet(); fReportViewer form = new fReportViewer(); if (oincometaxes.Count > 0 && oincometaxes[0].TaxParameterID != null && oincometaxes[0].TaxParameterID.IsUnassigned == false) _taxParameter = TaxParameter.Get(oincometaxes[0].TaxParameterID); else _taxParameter = TaxParameter.Get(SystemInformation.CurrentSysInfo.TaxParamID); _employee = oEmp; _item = ReportItem.GetByReportType(Convert.ToInt32(EnumReportType.ITIndividual)); _incometaxes = oincometaxes; oDFinalIncomeTax = PrepareDataset(oEmp.ID, ITStatus); IncomeTax pf = IncomeTax.Get(_incometaxes, _employee.ID, EnumIncomeTaxItemGroup.Company_Contri_PF, (int)EnumIncomeTaxItemGroup.Company_Contri_PF); double PFInvestment = 0.0; if (pf != null) PFInvestment = pf.TotalAmount; //oDFinalIncomeTax.Tables[0].TableName = "PayrollDataSet_IncomeTax"; //_dSet.Tables.Add(oDFinalIncomeTax.Tables[0].TableName); ////_dITSlabs = GetIncomeTaxSlabs(oparameter.ID, oEmp.ID); //oDFinalIncomeTax.Tables[1].TableName = "PayrollDataSet_IncomeTaxSlab"; //_dSet.Tables.Add(oDFinalIncomeTax.Tables[1].Copy()); //oDTableOthers = GetIncomeTaxOthers(oIncomeTax.GetEnumForSalaryIT(oEmp.ID), oEmp.ID); //oDFinalIncomeTax.Tables[2].TableName = "PayrollDataSet_IncomeTaxOther"; //_dSet.Tables.Add(oDFinalIncomeTax.Tables[2].Copy()); PayrollDataSet.PayrollDataSet.TaxRebeatInvestmentDataTable dTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.TaxRebeatInvestmentDataTable(); DataRow dr = null; dr = dTable.NewRow(); dr["TaxPercent"] = _taxParameter.MaxInvestPercent; dr["TaxableIncome"] = Math.Round(_20Investment); dr["MaxInvestment"] = Math.Round(_taxParameter.MaxInvAmount); dr["PFInvestment"] = Math.Round(PFInvestment); dTable.Rows.Add(dr); dTable.TableName = "PayrollDataSet_TaxRebeatInvestment"; oDFinalIncomeTax.Tables.Add(dTable); PayrollDataSet.PayrollDataSet.TaxChallanDataTable dTChallan = new Payroll.Report.PayrollDataSet.PayrollDataSet.TaxChallanDataTable(); DataRow dChallan = null; dChallan = dTChallan.NewRow(); if (!ITStatus) { oTaxChallans = TaxChallan.Get(oEmp.ID, oincometaxes[0].TaxParameterID); int count = 1; string sChallanNo = ""; // "# 57 dated 06-Sep-2010, # 56/88 dated 05-Oct-2010, # 54 dated 03-Nov-2010, # 58 dated 07-Dec-2010, # 57 dated 06-Jan-2011, # 56 dated 10-Feb-2011, # 58 dated 09-Mar-2011, # 50 dated 13-Apr-2011, # 47 dated 03-May-2011, # 55 dated 09-Jun-2011, # 71/49 dated 21-Jul-2011."; if (oTaxChallans != null && oTaxChallans.Count > 0) { foreach (TaxChallan oItem in oTaxChallans) { if (count == oTaxChallans.Count) { sChallanNo += "Challan: " + oItem.ChallanNo + " Date: " + oItem.DepositDate.ToString("dd-MMM-yyyy"); } else { sChallanNo += "Challan: " + oItem.ChallanNo + " Date: " + oItem.DepositDate.ToString("dd-MMM-yyyy") + ", "; count++; } } } dChallan["ChallanNo"] = sChallanNo; } double _taxInvestment = _actualInvestment; //string trget = "Tax Investment"; //var rslt = from item in oincometaxes // where item.Description.ToLower() == trget.ToLower() // select item; //if(rslt.Count() == 1) //{ // _taxInvestment = rslt.First().TotalAmount; //} if (!ITStatus) { EmployeeTaxInvestment etax = new EmployeeTaxInvestment(); _taxInvestment = etax.GetAmount(_taxParameter.ID, _employee.ID); } dChallan["TaxInvestment"] = _taxInvestment; dTChallan.Rows.Add(dChallan); dTChallan.TableName = "PayrollDataSet_TaxChallan"; oDFinalIncomeTax.Tables.Add(dTChallan); if (ITStatus) { //RDLC = "Payroll.Report.RDLC.ITCertificate.rdlc"; RDLC = "Payroll.Report.RDLC.IncomeTax.rdlc"; } else { RDLC = "Payroll.Report.RDLC.ITCertificate.rdlc"; } form.ShowDlgForTaxCard(_item, oDFinalIncomeTax, RDLC, oEmp.Name, oEmp.EmployeeNo, oEmp.TinNo, _taxParameter.AssessmentYear, _taxParameter.FiscalYear); } //Tax Card From Old Table public void showOldTaxCard(ObjectsTemplate oincometaxes, DataRow oEmp, bool ITStatus) { _IsTaxCertificate = ITStatus; IncomeTax oIncomeTax = new IncomeTax(); ObjectsTemplate oTaxChallans = new ObjectsTemplate(); DataSet oDFinalIncomeTax = null; _dSet = new DataSet(); fReportViewer form = new fReportViewer(); if (oincometaxes.Count > 0 && oincometaxes[0].TaxParameterID != null && oincometaxes[0].TaxParameterID.IsUnassigned == false) _taxParameter = TaxParameter.GetOldTaxParameter(oincometaxes[0].TaxParameterID); else _taxParameter = TaxParameter.GetOldTaxParameter(SystemInformation.CurrentSysInfo.TaxParamID); _item = ReportItem.GetByReportType(Convert.ToInt32(EnumReportType.ITIndividual)); _incometaxes = oincometaxes; oDFinalIncomeTax = PrepareOldDataset(ID.FromInteger(Convert.ToInt32(oEmp["EmployeeID"])), oEmp); IncomeTax pf = IncomeTax.Get(_incometaxes, ID.FromInteger(Convert.ToInt32(oEmp["EmployeeID"])), EnumIncomeTaxItemGroup.Company_Contri_PF, (int)EnumIncomeTaxItemGroup.Company_Contri_PF); double PFInvestment = 0.0; if (pf != null) PFInvestment = pf.TotalAmount; PayrollDataSet.PayrollDataSet.TaxRebeatInvestmentDataTable dTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.TaxRebeatInvestmentDataTable(); DataRow dr = null; dr = dTable.NewRow(); dr["TaxPercent"] = _taxParameter.MaxInvestPercent; dr["TaxableIncome"] = _20Investment; dr["MaxInvestment"] = _taxParameter.MaxInvAmount; dr["PFInvestment"] = PFInvestment; dTable.Rows.Add(dr); dTable.TableName = "PayrollDataSet_TaxRebeatInvestment"; oDFinalIncomeTax.Tables.Add(dTable); PayrollDataSet.PayrollDataSet.TaxChallanDataTable dTChallan = new Payroll.Report.PayrollDataSet.PayrollDataSet.TaxChallanDataTable(); DataRow dChallan = null; dChallan = dTChallan.NewRow(); if (!ITStatus) { oTaxChallans = TaxChallan.GetOldTaxChallan(ID.FromInteger(Convert.ToInt32(oEmp["EmployeeID"])), oincometaxes[0].TaxParameterID); int count = 1; string sChallanNo = "Certified that the above mentioned amount of tax has already been deposited base on the employer’s confirmation of investment amount in allowed instruments, Bangladesh Bank by Grameen Phone vide challan "; // "# 57 dated 06-Sep-2010, # 56/88 dated 05-Oct-2010, # 54 dated 03-Nov-2010, # 58 dated 07-Dec-2010, # 57 dated 06-Jan-2011, # 56 dated 10-Feb-2011, # 58 dated 09-Mar-2011, # 50 dated 13-Apr-2011, # 47 dated 03-May-2011, # 55 dated 09-Jun-2011, # 71/49 dated 21-Jul-2011."; if (oTaxChallans != null && oTaxChallans.Count > 0) { foreach (TaxChallan oItem in oTaxChallans) { if (count == oTaxChallans.Count) { sChallanNo += "#" + oItem.ChallanNo + " dated " + oItem.DepositDate.ToString("dd-MMM-yyyy"); } else { sChallanNo += "#" + oItem.ChallanNo + " dated " + oItem.DepositDate.ToString("dd-MMM-yyyy") + ","; count++; } } } dChallan["ChallanNo"] = sChallanNo; } double _taxInvestment = _actualInvestment; dChallan["TaxInvestment"] = _taxInvestment; dTChallan.Rows.Add(dChallan); dTChallan.TableName = "PayrollDataSet_TaxChallan"; oDFinalIncomeTax.Tables.Add(dTChallan); if (ITStatus) { RDLC = "Payroll.Report.RDLC.IncomeTax.rdlc"; } else { RDLC = "Payroll.Report.RDLC.ITCertificate.rdlc"; } form.ShowDlgForTaxCard(_item, oDFinalIncomeTax, RDLC, oEmp["Name"].ToString(), oEmp["EmployeeNo"].ToString(), oEmp["TinNo"].ToString(), _taxParameter.AssessmentYear, _taxParameter.FiscalYear); } public void ShowITPfAndOtherDetails() { //string sEmpID = _selectedParameter.ReportItem.INSQL; //ObjectsTemplate _TaxParameters = null; //_TaxParameters = TaxParameter.Get(true); //string[] sEmps = sEmpID.Split(','); //ObjectsTemplate allEmps = Employee.Get(); //ObjectsTemplate oEmpsITInvestment = EmployeeTaxInvestment.GetAllUsersInfo(); //Dictionary mapAllEmps = new Dictionary(); //Dictionary mapITInvestment = new Dictionary (); //foreach (EmployeeTaxInvestment oEmpInvestment in oEmpsITInvestment) //{ // mapITInvestment.Add(oEmpInvestment.EmployeeID.Integer, oEmpInvestment); //} //foreach (Employee emp in allEmps) //{ // if (!mapAllEmps.ContainsKey(emp.ID.Integer)) // { // mapAllEmps.Add(emp.ID.Integer, emp); // } //} //PayrollDataSet.PayrollDataSet.ITPfAndOtherDetailsDataTable dTPFAndInvestment = new Payroll.Report.PayrollDataSet.PayrollDataSet.ITPfAndOtherDetailsDataTable(); //foreach (string oEmp in sEmps) //{ // IncomeTax oIncomeTax = new IncomeTax(); // DataRow dr = dTPFAndInvestment.NewRow(); // int id = Convert.ToInt32(oEmp); // ID eid = ID.FromInteger(id); // ObjectsTemplate _IncomeTaxs = IncomeTax.Get(oIncomeTax.GetEnumForSalaryIT(eid), eid, _TaxParameters[0].ID); // int count = 0; // dr["EmployeeNo"] = String.Empty; // dr["EmployeeName"] = String.Empty; // if (mapAllEmps.ContainsKey(Convert.ToInt32(oEmp))) // { // dr["EmployeeName"] = mapAllEmps[Convert.ToInt32(oEmp)].Name; // dr["EmployeeNo"] = mapAllEmps[Convert.ToInt32(oEmp)].EmployeeNo; // } // if (mapITInvestment.ContainsKey(Convert.ToInt32(oEmp))) // { // dr["CumulativeAmount"] = mapITInvestment[Convert.ToInt32(oEmp)].Amount; // } // else dr["CumulativeAmount"] = 0.0; // double total = 0.0,pfamount = 0.0; // foreach (IncomeTax tetax in _IncomeTaxs) // { // if (tetax.ItemID == -220) // { // total = tetax.PreviousAmount + tetax.ProjectedAmount + tetax.ThisMonthAmount; // count++; // } // if (tetax.ItemID == -207) // { // pfamount = (tetax.PreviousAmount + tetax.ProjectedAmount + tetax.ThisMonthAmount) * 2; // count++; // } // if (count == 2) break; // } // if (pfamount != 0.0) // { // dr["TotalPFAmount"] = pfamount; // } // else // { // } // if (total - pfamount != 0.0) // { // dr["InvestmentAllowed"] = total - pfamount; // } // else // { // } // if (pfamount == 0.0 && (total - pfamount) == 0.0) continue; // if (pfamount == 0.0) // { // dr["TotalPFAmount"] = 0.0; // } // if (total - pfamount == 0.0) // { // dr["InvestmentAllowed"] = 0.0; // } // dTPFAndInvestment.Rows.Add(dr); //} //DataSet ds = new DataSet(); //dTPFAndInvestment.TableName = "PayrollDataSet_ITPfAndOtherDetails"; //ds.Tables.Add(dTPFAndInvestment); //fReportViewer form = new fReportViewer(); //form.ShowShowAllPFandDetails(ds); } public void showTaxCertificate(ObjectsTemplate _IncomeTaxs, Employee employee, bool _bIsForCurrentYear, DateTime fromDate, DateTime toDate) { double basic = 0.0; double HR = 0.0; double MAA = 0.0; double CA = 0.0; double BasicArrer = 0.0; double HRArrear = 0.0; double MArrear = 0.0; double CArraer = 0.0; double otherAllo = 0.00; double otherAlloChildren = 0.00; double nConvence = 0.0; double nConvenceCar = 0.0; double nTempConvenceCar = 0.0; double nComCar = 0.0; _IsTaxCertificate = _bIsForCurrentYear; IncomeTax oIncomeTax = new IncomeTax(); ObjectsTemplate oTaxChallans = new ObjectsTemplate(); ObjectsTemplate oAllDeduntions = AllowanceDeduction.Get(EnumStatus.Active); TaxParameter param = TaxParameter.Get(Payroll.BO.SystemInformation.CurrentSysInfo.TaxParamID); List oHeads = null; if (param != null) oHeads = ITEmpHead.Get(param.ID.Integer); DataRow oDR = null; DataSet oDset = null; oDset = MiscellaneousDataset.GetSalaryData(employee.ID.Integer.ToString(), fromDate, toDate); PayrollDataSet.PayrollDataSet.SalaryCertificateDataTable oSalary = new Payroll.Report.PayrollDataSet.PayrollDataSet.SalaryCertificateDataTable(); PayrollDataSet.PayrollDataSet.SalaryCertificateDataTable dtTempSalarySheet = new Payroll.Report.PayrollDataSet.PayrollDataSet.SalaryCertificateDataTable(); DataSet oDFinalIncomeTax = null; ObjectsTemplate _salarymonthlies = null; _dSet = new DataSet(); fReportViewer form = new fReportViewer(); if (_IncomeTaxs.Count > 0 && _IncomeTaxs[0].TaxParameterID != null && _IncomeTaxs[0].TaxParameterID.IsUnassigned == false) _taxParameter = TaxParameter.Get(_IncomeTaxs[0].TaxParameterID); else _taxParameter = TaxParameter.Get(SystemInformation.CurrentSysInfo.TaxParamID); _employee = employee; _item = ReportItem.GetByReportType(Convert.ToInt32(EnumReportType.ITIndividual)); _incometaxes = _IncomeTaxs; string sEmpNo = ""; double amount = 0.00; ObjectsTemplate oTaxes = new ObjectsTemplate(); if (Payroll.BO.SystemInformation.CurrentSysInfo.TaxParamID == _taxParameter.ID) oTaxes = IncomeTax.Get(EnumIncomeTaxDataFrom.ProcessTempData, _employee.ID, _taxParameter.ID); else oTaxes = IncomeTax.Get(EnumIncomeTaxDataFrom.ProcessedData, _employee.ID, _taxParameter.ID); if (oDset != null) { foreach (DataRow oRow in oDset.Tables[0].Rows) { if (sEmpNo != _employee.EmployeeNo) { BasicArrer = 0.0; MArrear = 0.0; CArraer = 0.0; HRArrear = 0.0; basic = 0.0; HR = 0.0; MAA = 0.0; CA = 0.0; amount = 0.00; otherAllo = 0.00; otherAlloChildren = 0.00; nConvence = 0.0; nConvenceCar = 0.0; nComCar = 0.0; nTempConvenceCar = 0.0; oDR = oSalary.NewRow(); foreach (IncomeTax inTax in oTaxes) { if (inTax.ItemGroup == EnumIncomeTaxItemGroup.Medical_Allowance && inTax.ItemID == -222) oDR["Medical"] = GlobalFunctions.Round(inTax.TotalAmount); else if (inTax.Description.ToLower() == "award") oDR["Awards"] = GlobalFunctions.Round(inTax.TotalAmount); else if (inTax.Description.ToLower() == "previous award") oDR["Awards"] = GlobalFunctions.Round(inTax.TotalAmount); else if (inTax.Description.ToLower() == "children education expenses") oDR["Children"] = GlobalFunctions.Round(inTax.TotalAmount); else if (inTax.ItemGroup == EnumIncomeTaxItemGroup.Cmp_Provided_car && inTax.ItemID == -215) nComCar = GlobalFunctions.Round(inTax.TotalAmount); else if (inTax.ItemGroup == EnumIncomeTaxItemGroup.Conveyance_Allowance && inTax.ItemID == 0) nConvence = GlobalFunctions.Round(inTax.TotalAmount); else if (inTax.ItemGroup == EnumIncomeTaxItemGroup.Conveyance_Allowance && inTax.ItemID == -205) { nConvenceCar += GlobalFunctions.Round(inTax.TotalAmount); nTempConvenceCar = GlobalFunctions.Round(inTax.TotalAmount); } else if (inTax.ItemGroup == EnumIncomeTaxItemGroup.Other_Allowance && inTax.ItemID == -202) { if (inTax.Description.ToLower() != "other allowances") nConvenceCar += GlobalFunctions.Round(inTax.TotalAmount); } } if (nComCar > 0) { oDR["Conveyance"] = 0.0; ITEmpHead oHe = oHeads.Find(delegate(ITEmpHead oh) { return oh.EmployeeID == _employee.ID && oh.HeadID == EnumIncomeTaxHead.Car && oh.TaxparamID == _taxParameter.ID; }); if (oHe == null) { oDR["sts"] = 0; oDR["daterange"] = ""; } else { oDR["sts"] = 1; oDR["daterange"] = oHe.StartDate.ToString("dd MMM yyyy") + " to " + oHe.EndDate.ToString("dd MMM yyyy"); oDR["Conveyance"] = nTempConvenceCar; } } else if (nConvence > 0) { oDR["Conveyance"] = nConvence; } else if (nConvenceCar > 0) oDR["Conveyance"] = nConvenceCar; AllowanceDeduction oAllDe = oAllDeduntions.Find(delegate(AllowanceDeduction oad) { return oad.ID.Integer == Convert.ToInt32(oRow["ITEMID"]); }); oDR["EmpNo"] = _employee.EmployeeNo; sEmpNo = _employee.EmployeeNo; oDR["EmpName"] = _employee.Name; if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Basic_Salary && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && Convert.ToInt32(oRow["ItemID"].ToString().Trim()) == (int)EnumSalaryItemCode.Basic_Salary) { basic = basic + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); oDR["Basic"] = basic; amount = Convert.ToDouble(oDR["Basic"]); } else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && oRow["ITEMID"].ToString().Trim() == "1") { HR = HR + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); oDR["HousrRent"] = HR; amount = Convert.ToDouble(oDR["HousrRent"]); } //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && oAllDe.Code == "004") //{ // CA = CA + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); // oDR["Conveyance"] = CA; //} //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Deduction && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Deductions || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && oAllDe.Code == "002") //{ // CA = CA - GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); // oDR["Conveyance"] = CA; //} //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && oRow["ITEMID"].ToString().Trim() == "10") //{ // oDR["Medical"] = oRow["Amount"]; // amount = amount + GlobalFunctions.Round(Convert.ToDouble(oDR["Medical"])); //} else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.PF_Contribution && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Deductions && Convert.ToInt32(oRow["ItemID"].ToString().Trim()) == (int)EnumSalaryItemCode.PF_Contribution) { oDR["PFContri"] = oRow["Amount"]; amount = amount + GlobalFunctions.Round(Convert.ToDouble(oDR["PFContri"])); } else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.PF_Contribution && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Deductions && Convert.ToInt32(oRow["ItemID"].ToString().Trim()) == 0) { oDR["PFPrev"] = oRow["Amount"]; amount = amount + GlobalFunctions.Round(Convert.ToDouble(oDR["PFPrev"])); } //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross && oRow["ITEMID"].ToString().Trim() == "5") //{ // CA = CA + Convert.ToDouble(oRow["Amount"]); // oDR["Conveyance"] = CA; // amount = amount + Convert.ToDouble(oDR["CarAll"]); //} else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross && (oAllDe.Code == "005" || oAllDe.Code == "006" || oAllDe.Code == "003")) { otherAllo = otherAllo + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); oDR["OtherAll"] = otherAllo; amount = amount + Convert.ToDouble(oDR["OtherAll"]); } //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross && oAllDe.Code == "007") //{ // oDR["Awards"] = GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"]));//GlobalFunctions.Round(item.GetAmount(EnumSalaryGroup.Gross, EnumSalaryItemCode.Allowance, 5)); //} oSalary.Rows.Add(oDR); } else if (sEmpNo == _employee.EmployeeNo) { AllowanceDeduction oAllDe = oAllDeduntions.Find(delegate(AllowanceDeduction oad) { return oad.ID.Integer == Convert.ToInt32(oRow["ITEMID"]); }); if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Basic_Salary && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && Convert.ToInt32(oRow["ItemID"].ToString().Trim()) == (int)EnumSalaryItemCode.Basic_Salary) { basic = basic + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); oDR["Basic"] = basic; amount = amount + Convert.ToDouble(oDR["Basic"]); } else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && oRow["ITEMID"].ToString().Trim() == "1") { HR = HR + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); oDR["HousrRent"] = HR; amount = amount + Convert.ToDouble(oDR["HousrRent"]); } //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && (oAllDe.Code == "002" || oAllDe.Code == "004")) //{ // CA = CA + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); // oDR["Conveyance"] = CA; // amount = amount + Convert.ToDouble(oDR["Conveyance"]); //} //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && (Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross || Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Arrear) && oAllDe.Code == "008") //{ // oDR["Medical"] = oRow["Amount"]; // amount = amount + GlobalFunctions.Round(Convert.ToDouble(oDR["Medical"])); //} else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.PF_Contribution && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Deductions && Convert.ToInt32(oRow["ItemID"].ToString().Trim()) == (int)EnumSalaryItemCode.PF_Contribution) { oDR["PFContri"] = oRow["Amount"]; amount = amount + GlobalFunctions.Round(Convert.ToDouble(oDR["PFContri"])); } else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.PF_Contribution && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Deductions && Convert.ToInt32(oRow["ItemID"].ToString().Trim()) == 0) { oDR["PFPrev"] = oRow["Amount"]; amount = amount + GlobalFunctions.Round(Convert.ToDouble(oDR["PFPrev"])); } //else if(Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim())==(int)EnumSalaryGroup.Gross && oRow["ITEMID"].ToString().Trim() == "5") //{ // oDR["CarAll"] = oRow["Amount"]; // amount = amount + Convert.ToDouble(oDR["CarAll"]); //} else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross && (oAllDe.Code == "005" || oAllDe.Code == "006" || oAllDe.Code == "003")) { otherAllo = otherAllo + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); oDR["OtherAll"] = otherAllo; amount = amount + Convert.ToDouble(oDR["OtherAll"]); } //else if(Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Bonus && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim())==(int)EnumSalaryGroup.Gross && oRow["ITEMID"].ToString().Trim() == "2") //{ // oDR["BonusIC"] = oRow["Amount"]; // amount = amount + Convert.ToDouble(oDR["BonusIC"]); //} //else if(Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Bonus && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim())==(int)EnumSalaryGroup.Gross && oRow["ITEMID"].ToString().Trim() == "1") //{ // oDR["BonusFes"] = oRow["Amount"]; // amount = amount + Convert.ToDouble(oDR["BonusFes"]); //} //else if (Convert.ToInt32(oRow["ItemCode"].ToString().Trim()) == (int)EnumSalaryItemCode.Allowance && Convert.ToInt32(oRow["ItemGroup"].ToString().Trim()) == (int)EnumSalaryGroup.Gross && oAllDe.Code == "007") //{ // oDR["Awards"] = GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"]));//GlobalFunctions.Round(item.GetAmount(EnumSalaryGroup.Gross, EnumSalaryItemCode.Allowance, 5)); //} oDR["TotalGross"] = amount; } } } PayrollDataSet.PayrollDataSet.TaxChallanDataTable dTChallan = new Payroll.Report.PayrollDataSet.PayrollDataSet.TaxChallanDataTable(); PayrollDataSet.PayrollDataSet.ChallanNoWithMonthDataTable dTChallan2 = new Payroll.Report.PayrollDataSet.PayrollDataSet.ChallanNoWithMonthDataTable(); DataRow dChallan = null; dChallan = dTChallan.NewRow(); oTaxChallans = TaxChallan.Get(_employee.ID, _taxParameter.ID); int count = 1; string sChallanNo = "Certified that the above mentioned amount of tax has already been deposited base on the employer’s confirmation of investment amount in allowed instruments, Bangladesh Bank by Grameen Phone as per following details: "; // "# 57 dated 06-Sep-2010, # 56/88 dated 05-Oct-2010, # 54 dated 03-Nov-2010, # 58 dated 07-Dec-2010, # 57 dated 06-Jan-2011, # 56 dated 10-Feb-2011, # 58 dated 09-Mar-2011, # 50 dated 13-Apr-2011, # 47 dated 03-May-2011, # 55 dated 09-Jun-2011, # 71/49 dated 21-Jul-2011."; //if (oTaxChallans != null && oTaxChallans.Count > 0) //{ // foreach (TaxChallan oItem in oTaxChallans) // { // if (count == oTaxChallans.Count) // { // sChallanNo += "#" + oItem.ChallanNo + " dated " + oItem.DepositDate.ToString("dd-MMM-yyyy"); // } // else // { // sChallanNo += "#" + oItem.ChallanNo + " dated " + oItem.DepositDate.ToString("dd-MMM-yyyy") + ","; // count++; // } // } //} dChallan["ChallanNo"] = sChallanNo; double _taxInvestment = _actualInvestment; dChallan["TaxInvestment"] = _taxInvestment; dTChallan.Rows.Add(dChallan); //string sChallanNo = "Certified that the above mentioned amount of tax has already been deposited base on the employer’s confirmation of investment amount in allowed instruments, Bangladesh Bank by Citibank, N. A. as per following details : "; if (oTaxChallans != null && oTaxChallans.Count > 0) { foreach (TaxChallan oItem in oTaxChallans) { dChallan = null; dChallan = dTChallan2.NewRow(); dChallan["ChallanNo"] = oItem.ChallanNo; dChallan["Amount"] = GlobalFunctions.Round(oItem.Amount); dChallan["ChallanDate"] = oItem.SalaryMonthly.ToString("dd MMM yyyy"); dTChallan2.Rows.Add(dChallan); } } var sortedData = from DataRow dr in oSalary.Rows orderby _employee.EmployeeNo select dr; foreach (DataRow dr in sortedData) { DataRow nDr = dtTempSalarySheet.NewRow(); nDr.ItemArray = dr.ItemArray; dtTempSalarySheet.Rows.Add(nDr); } string empNo = string.Empty; double nAmount1 = 0.0; double nAmount2 = 0.0; double nAmount3 = 0.0; double nAmount4 = 0.0; double nChildrenTaxAmount = 0.0; double nBinusTaxAmount = 0.0; foreach (IncomeTax inTax in oTaxes) { if (inTax.Description.ToLower() == "adjustment on previous year tax slab change") { nAmount1 = GlobalFunctions.Round(inTax.TotalAmount); //break; } else if (inTax.Description.ToLower() == "adjustment on previous year tax slab change-inc") { nAmount2 = GlobalFunctions.Round(inTax.TotalAmount); ///break; } else if (inTax.Description.ToLower() == "award tax adjustment") { nAmount3 = GlobalFunctions.Round(inTax.TotalAmount); ///break; } else if (inTax.Description.ToLower() == "lta tax adjustment") { nAmount4 = GlobalFunctions.Round(inTax.TotalAmount); ///break; } else if (inTax.Description.ToLower() == "children education tax adjustment") { nChildrenTaxAmount = GlobalFunctions.Round(inTax.TotalAmount); ///break; } } foreach (DataRow oDR1 in dtTempSalarySheet) { double bAmount = 0.0; double inc = 0.0; foreach (DataRow oRow in oDset.Tables[2].Rows) { if (oDR1["EmpNo"].ToString() == _employee.EmployeeNo) { inc = GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); } } foreach (DataRow oRow in oDset.Tables[3].Rows) { if (oDR1["EmpNo"].ToString() == oRow["EmployeeNo"].ToString()) { if (Convert.ToInt32(oRow["BonusID"]) != 1) { bAmount = bAmount + GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); nBinusTaxAmount = GlobalFunctions.Round(Convert.ToDouble(oRow["taxamount"])); oDR1["BonusIC"] = bAmount; } else { oDR1["BonusFes"] = GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); nBinusTaxAmount = GlobalFunctions.Round(Convert.ToDouble(oRow["taxamount"])); } } } foreach (DataRow oRow in oDset.Tables[1].Rows) { if (oDR1["EmpNo"].ToString() == _employee.EmployeeNo) { inc += GlobalFunctions.Round(Convert.ToDouble(oRow["Amount"])); inc += nAmount1 - nAmount2 + nAmount3 + nAmount4 + nBinusTaxAmount + nChildrenTaxAmount; oDR1["TotalDeduct"] = inc.ToString("#,###.##"); oDR1["ChallanNo"] = sChallanNo; } } } form.ShowDlgForSalaryCertificate(dtTempSalarySheet, dTChallan, fromDate, toDate, dTChallan2); } public void ShowEmployeestaxDeduction() { fReportViewer form = new fReportViewer(); TaxParameter taxparam = _selectedParameter.TaxParameters[0]; _TaxParameterID = _selectedParameter.TaxParameters[0].ID; string sEmpIDs = _selectedParameter.ReportItem.INSQL; string taxYear = _taxParameters.Max(x => x.FiscalYear); string sMDate = taxparam.FiscalYear.ToString(); string sfDate = sMDate.Substring(0, 4); int index = sMDate.IndexOf("-"); string stDate = sMDate.Substring(index + 1); double dTotal = 0; double dsalTotal = 0; double dBonusTot = 0; double dDeductedTax = 0; double dFonalsettTot = 0; DateTime fromdate = new DateTime(Convert.ToInt32(sfDate), 7, 1); DateTime toDate = new DateTime(Convert.ToInt32(stDate), 6, 30); ObjectsTemplate oEMployees = Employee.GetEmpsWithDiscontinue(sEmpIDs); DataSet ds = new DataSet(); DataRow odrow = null; if (taxYear == taxparam.FiscalYear) { ds = MiscellaneousDataset.GetEmpsFiscalYeartax(sEmpIDs, fromdate, toDate, 0); } else { ds = MiscellaneousDataset.GetEmpsFiscalYeartax(sEmpIDs, fromdate, toDate, _TaxParameterID.Integer); } PayrollDataSet.dsEmpLeaveLedger.EmployeesTaxDeductionDataTable dTEmpTax = new Payroll.Report.PayrollDataSet.dsEmpLeaveLedger.EmployeesTaxDeductionDataTable(); if (ds.Tables[0].Rows.Count > 0) { foreach (Employee oem in oEMployees) { dTotal = 0; dsalTotal = 0; dBonusTot = 0; dDeductedTax = 0; dFonalsettTot = 0; foreach (DataRow orow in ds.Tables[0].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ.ToString("dd MMM yyyy"); DateTime dtFiscalyear = Convert.ToDateTime(orow["Fiscalmonth"].ToString()); odrow["Description"] = dtFiscalyear.ToString("MMM"); if (Convert.ToDouble(orow["Amount"].ToString()) != 0) { double dsTax = Convert.ToDouble(orow["Amount"].ToString()); odrow["Value"] = dsTax.ToString("##,###"); } else { odrow["Value"] = "0"; } odrow["Group"] = "Salary"; dsalTotal = dsalTotal + Convert.ToDouble(odrow["Value"].ToString()); dTEmpTax.Rows.Add(odrow); } } foreach (DataRow orow in ds.Tables[1].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ.ToString("dd MMM yyyy"); DateTime dtFiscalyear = Convert.ToDateTime(orow["Fiscalmonth"].ToString()); odrow["Description"] = dtFiscalyear.ToString("MMM"); double dBTax = Convert.ToDouble(orow["Amount"].ToString()); if (dBTax == 0) { continue; } odrow["Value"] = dBTax.ToString("##,###"); odrow["Group"] = "Bonus"; dBonusTot = dBonusTot + dBTax; dTEmpTax.Rows.Add(odrow); } } foreach (DataRow orow in ds.Tables[2].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ3 = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ3.ToString("dd MMM yyyy"); odrow["Description"] = "FinalSettlement Tax"; double dfsTax = Convert.ToDouble(orow["Amount"].ToString()); odrow["Value"] = dfsTax.ToString("##,###"); odrow["Group"] = ""; dFonalsettTot = dFonalsettTot + Convert.ToDouble(odrow["Value"].ToString()); dTEmpTax.Rows.Add(odrow); } } odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ4 = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ4.ToString("dd MMM yyyy"); odrow["Description"] = "Total"; dTotal = dsalTotal + dBonusTot + dFonalsettTot; dTotal = Math.Round(dTotal); odrow["Value"] = dTotal.ToString("##,###"); odrow["Group"] = ""; dTEmpTax.Rows.Add(odrow); foreach (DataRow orow in ds.Tables[3].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ5 = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ5.ToString("dd MMM yyyy"); odrow["Description"] = "Deducted"; double staxdeduct = Convert.ToDouble(orow["Amount"].ToString()); odrow["Value"] = staxdeduct.ToString("##,###"); odrow["Group"] = ""; dDeductedTax = Convert.ToDouble(dDeductedTax + odrow["Value"].ToString()); dTEmpTax.Rows.Add(odrow); } } odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ6 = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ6.ToString("dd MMM yyyy"); odrow["Description"] = "Difference"; odrow["Value"] = Convert.ToString(dTotal - dDeductedTax); odrow["Group"] = ""; dTEmpTax.Rows.Add(odrow); foreach (DataRow orow in ds.Tables[3].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ7 = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ7.ToString("dd MMM yyyy"); odrow["Description"] = "Manual Edit"; if (orow["FiscalMonth"].ToString() != "") { odrow["Value"] = "Yes"; } else { odrow["Value"] = "NO"; } odrow["Group"] = ""; dTEmpTax.Rows.Add(odrow); } } foreach (DataRow orow in ds.Tables[4].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ1 = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ1.ToString("dd MMM yyyy"); odrow["Description"] = orow["Description"].ToString(); double sInctax = Convert.ToDouble(orow["Amount"].ToString()); odrow["Value"] = sInctax.ToString("##,###"); odrow["Group"] = "Others"; dTEmpTax.Rows.Add(odrow); } } foreach (DataRow orow in ds.Tables[5].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { odrow = dTEmpTax.NewRow(); odrow["EmployeeNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; DateTime dtDOJ2 = Convert.ToDateTime(oem.JoiningDate); odrow["DOJ"] = dtDOJ2.ToString("dd MMM yyyy"); odrow["Description"] = orow["Description"].ToString(); double sDecTax = Convert.ToDouble(orow["Amount"].ToString()); odrow["Value"] = sDecTax.ToString("##,###"); odrow["Group"] = "Others"; dTEmpTax.Rows.Add(odrow); } } } } if (dTEmpTax.Rows.Count > 0) { form.ShowEmployeesTaxDeductionReport(dTEmpTax, taxparam.FiscalYear.ToString()); } else { throw new ServiceException("No Data Found For these Employee!!!"); } } public void ShowTaxInvestment() { fReportViewer form = new fReportViewer(); TaxParameter taxparam = _selectedParameter.TaxParameters[0]; _TaxParameterID = _selectedParameter.TaxParameters[0].ID; string sEmpIDs = _selectedParameter.ReportItem.INSQL; string taxYear = _taxParameters.Max(x => x.FiscalYear); string sMDate = taxparam.FiscalYear.ToString(); string sfDate = sMDate.Substring(0, 4); int index = sMDate.IndexOf("-"); string stDate = sMDate.Substring(index + 1); DateTime fromdate = new DateTime(Convert.ToInt32(sfDate), 7, 1); DateTime toDate = new DateTime(Convert.ToInt32(stDate), 6, 30); ObjectsTemplate oEMployees = Employee.GetEmpsWithDiscontinue(sEmpIDs); ObjectsTemplate oEmpsITInvestment = EmployeeTaxInvestment.GetAllUsersInfo(); DataSet ds = new DataSet(); DataRow odrow = null; if (taxYear == taxparam.FiscalYear) { ds = MiscellaneousDataset.GetEmpstaxInvestment(sEmpIDs, 0); } else { ds = MiscellaneousDataset.GetEmpstaxInvestment(sEmpIDs, _TaxParameterID.Integer); } PayrollDataSet.dsEmpLeaveLedger.TaxInvestmentDataTable dttaxInvestment = new Payroll.Report.PayrollDataSet.dsEmpLeaveLedger.TaxInvestmentDataTable(); foreach (Employee oem in oEMployees) { foreach (DataRow orow in ds.Tables[0].Rows) { if (oem.ID.Integer == Convert.ToInt32(orow["EMPLOYEEID"].ToString())) { EmployeeTaxInvestment oEmpInvestment = oEmpsITInvestment.Where(x => x.EmployeeID == oem.ID).FirstOrDefault(); if (oEmpInvestment != null) { odrow = dttaxInvestment.NewRow(); odrow["EmpNo"] = oem.EmployeeNo; odrow["Name"] = oem.Name; odrow["Designation"] = oem.Designation.Name; if (orow["Provident Fund"].ToString() != "") { odrow["PFBothPart"] = Convert.ToDouble(orow["Provident Fund"].ToString()) * 2; } if (orow["Salary Income"].ToString() != "") { odrow["SalaryIncome"] = Convert.ToDouble(orow["Salary Income"].ToString()); } if (orow["Investment Required"].ToString() != "") { odrow["Investment"] = Convert.ToDouble(orow["Investment Required"].ToString()); } odrow["ActualInvestment"] = oEmpInvestment.Amount; dttaxInvestment.Rows.Add(odrow); } } } } if (dttaxInvestment.Rows.Count > 0) { form.ShowtaxInvestmentReport(dttaxInvestment, taxparam.FiscalYear.ToString()); } else { throw new ServiceException("No Data Found For these Employee!!!"); } } public void ShowTaxChallan() { fReportViewer form = new fReportViewer(); TaxParameter taxparam = _selectedParameter.TaxParameters[0]; _TaxParameterID = _selectedParameter.TaxParameters[0].ID; string sEmpIDs = _selectedParameter.ReportItem.INSQL; string sMDate = taxparam.FiscalYear.ToString(); string sfDate = sMDate.Substring(0, 4); int index = sMDate.IndexOf("-"); string stDate = sMDate.Substring(index + 1); DateTime fromdate = new DateTime(Convert.ToInt32(sfDate), 7, 1); DateTime toDate = new DateTime(Convert.ToInt32(stDate), 6, 30); ObjectsTemplate oEMployees = Employee.GetEmpsWithDiscontinue(sEmpIDs); DataSet ds = new DataSet(); DataRow odrow = null; ds = MiscellaneousDataset.GetEmpstaxChallan(sEmpIDs, _TaxParameterID.Integer); PayrollDataSet.dsEmpLeaveLedger.TaxChallanDataTable dtTaxChallan = new Payroll.Report.PayrollDataSet.dsEmpLeaveLedger.TaxChallanDataTable(); if (ds.Tables.Count > 0) { foreach (DataRow orow in ds.Tables[0].Rows) { odrow = dtTaxChallan.NewRow(); odrow["EmpNo"] = orow["EmployeeNo"].ToString(); odrow["Name"] = orow["Name"].ToString(); odrow["Designation"] = orow["Designation"].ToString(); DateTime dtDepositDate = Convert.ToDateTime(orow["DepositDate"].ToString()); odrow["SalaryMonth"] = dtDepositDate.ToString("dd MMM yyyy"); odrow["ChallanNo"] = orow["ChallenNo"].ToString(); odrow["Amount"] = Convert.ToDouble(orow["Amount"].ToString()); dtTaxChallan.Rows.Add(odrow); } } if (dtTaxChallan.Rows.Count > 0) { form.ShowTaxChallanReport(dtTaxChallan, taxparam.FiscalYear.ToString()); } else { throw new ServiceException("No Data Found For these Employee!!!"); } } public void ShowTaxWithProjection(int empID) { fReportViewer form = new fReportViewer(); DataSet oTaxWithProjection = IncomeTax.GetTaxWithProjection(empID); DataTable dTTaxWithProjection = oTaxWithProjection.Tables[0].Copy(); DataSet dSet = new DataSet(); dTTaxWithProjection.TableName = "PayrollDataSet_TaxDetailsWithProjection"; dSet.Tables.Add(dTTaxWithProjection); //List parameters = new List(); //parameters.Add(new ReportParameter("BankName", _selectedParameter.Banks[0].Name)); form.CommonReportView(null, dSet, "Payroll.Report.RDLC.rptTaxDetailsWithProjection.rdlc", null); } public void ShowTaxWithoutProjection(int empID) { fReportViewer form = new fReportViewer(); DataSet oTaxWithoutProjection = IncomeTax.GetTaxWithoutProjection(empID); DataTable dTTaxWithoutProjection = oTaxWithoutProjection.Tables[0].Copy(); DataSet dSet = new DataSet(); dTTaxWithoutProjection.TableName = "PayrollDataSet_TaxDetailsWithoutProjection"; dSet.Tables.Add(dTTaxWithoutProjection); //List parameters = new List(); //parameters.Add(new ReportParameter("BankName", _selectedParameter.Banks[0].Name)); form.CommonReportView(null, dSet, "Payroll.Report.RDLC.rptTaxDetailsWithoutProjection.rdlc", null); } } }