Ejemplo n.º 1
0
    private string Challan(DataSet ds, string BankName, string Date, string ChequeNo)
    {
        StringBuilder sb = new StringBuilder();

        try
        {
            DataTable _dt  = ds.Tables[0];
            DataTable _dt1 = ds.Tables[1];

            sb.Append("<table width='97%'  align='center' cellpadding='0' cellspacing='0' style='border:1px solid #000000;font-size:14px;'>");
            string strStartFont1 = "<b><font size='2'>";
            string strEndFont1   = "</b></font>";

            string strStartFont2 = "<font size='1'>";
            string strEndFont2   = "</font>";

            if (_dt.Rows[0][0].ToString() != "0")
            {
                #region Calcaultaion

                double Account1  = 0;
                double Account10 = 0;
                double Account21 = 0;

                double AccountSN1AC1  = 0;
                double AccountSN1AC10 = 0;
                double AccountSN1AC21 = 0;
                double sn1Total       = 0;


                double AccountSN2AC1 = 0;
                double sn2Total      = 0;


                double AccountSN3AC2  = 0;
                double AccountSN3AC22 = 0;
                double sn3Total       = 0;

                double FRTotal = 0;
                double FCTotal = 0;

                double AC1Total  = 0;
                double AC2Total  = 0;
                double AC10Total = 0;
                double AC21Total = 0;
                double AC22Total = 0;



                for (int q = 0; q < _dt1.Rows.Count; q++)
                {
                    if (Convert.ToDecimal(_dt1.Rows[q]["AllwancesAmt"].ToString()) > 0)
                    {
                        if (Convert.ToDecimal(_dt1.Rows[q]["AllwancesAmt"]) <= 6500)
                        {
                            Account1  = Account1 + Convert.ToDouble(_dt1.Rows[q]["AllwancesAmt"].ToString());
                            Account10 = Account10 + Convert.ToDouble(_dt1.Rows[q]["AllwancesAmt"].ToString());
                            Account21 = Account21 + Convert.ToDouble(_dt1.Rows[q]["AllwancesAmt"].ToString());
                        }
                        else if (Convert.ToDecimal(_dt1.Rows[q]["AllwancesAmt"]) > 6500)
                        {
                            if (Convert.ToDecimal(_dt1.Rows[q]["DedAmount"]) == 780)
                            {
                                Account1 = Account1 + Convert.ToDouble(6500);
                            }
                            else
                            {
                                Account1 = Account1 + Convert.ToDouble(_dt1.Rows[q]["AllwancesAmt"].ToString());
                            }
                            Account10 = Account10 + Convert.ToDouble(6500);
                            Account21 = Account21 + Convert.ToDouble(6500);
                        }
                    }
                }

                Int32 AccountSN1AC1int;
                AccountSN1AC1 = Convert.ToDouble(Account1) * Convert.ToDouble(3.67) / 100;



                AccountSN1AC1int = Convert.ToInt32(Math.Round(AccountSN1AC1));


                Int32 AccountSN1AC10int;
                AccountSN1AC10 = Account10 * Convert.ToDouble(8.33) / 100;

                AccountSN1AC10int = Convert.ToInt32(Math.Round(AccountSN1AC10));


                Int32 AccountSN1AC21int;
                AccountSN1AC21 = Account10 * Convert.ToDouble(0.50) / 100;

                AccountSN1AC21int = Convert.ToInt32(Math.Round(AccountSN1AC21));

                Int32 sn1Totalint;
                sn1Total = AccountSN1AC1 + AccountSN1AC10 + AccountSN1AC21;

                sn1Totalint = Convert.ToInt32(Math.Round(sn1Total));

                Int32 AccountSN2AC1int;
                AccountSN2AC1 = Account1 * Convert.ToDouble(12.00) / 100;



                AccountSN2AC1int = Convert.ToInt32(Math.Round(AccountSN2AC1));

                AccountSN2AC1int = AccountSN2AC1int - AccountSN1AC10int;
                Int32 sn2Totalint;
                sn2Total = AccountSN2AC1;

                sn2Totalint = Convert.ToInt32(Math.Round(sn2Total));

                Int32 AccountSN3AC2int;
                AccountSN3AC2 = Account1 * Convert.ToDouble(1.10) / 100;

                AccountSN3AC2int = Convert.ToInt32(Math.Round(AccountSN3AC2));



                Int32 AccountSN3AC22int;
                AccountSN3AC22 = Account10 * Convert.ToDouble(0.01) / 100;

                AccountSN3AC22int = Convert.ToInt32(Math.Round(AccountSN3AC22));

                if (AccountSN3AC22int < 2)
                {
                    AccountSN3AC22int = 2;
                }

                Int32 sn3Totalint;
                //sn3Total = AccountSN3AC2 + AccountSN3AC22; // By Shruti
                sn3Total = AccountSN3AC2 + AccountSN3AC22int;

                sn3Totalint = Convert.ToInt32(Math.Round(sn3Total));



                //Int32 AC1Totalint = AccountSN1AC1int + AccountSN2AC1int;
                Int32 AC1Totalint  = AccountSN1AC1int + Convert.ToInt32(Math.Round(AccountSN2AC1));
                Int32 AC2Totalint  = AccountSN3AC2int;
                Int32 AC10Totalint = AccountSN1AC10int;
                Int32 AC21Totalint = AccountSN1AC21int;
                Int32 AC22Totalint = AccountSN3AC22int;


                Int32 FCTotalint = sn1Totalint + sn2Totalint + sn3Totalint;
                Int32 FRTotalint = AC1Totalint + AC2Totalint + AC10Totalint + AC21Totalint + AC22Totalint;
                #endregion Calcaultaion
                sb.Append("<tr>");
                sb.Append("<td><img src='../../Images/logo.jpg' width='70' height='70' /></td>");
                sb.Append("<td colapan='2' valign='top' align='left'>");
                sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");

                sb.Append(strStartFont2 + "COMBINED CHALLAN oF A/C NO.1,2,10,21 & 22(STATE BANK OF INDIA)" + strEndFont2);
                sb.Append("<br>" + strStartFont1 + "EMPLOYEE PROVIDENT FUND ORGANIZATION" + strEndFont1);
                sb.Append(strStartFont2 + "(USE SEPRATE CHALLAN FOR EACH MONTH)" + strEndFont2 + "</td>");

                sb.Append("<td align='right'>" + strStartFont2 + "ORIGINAL<br>DUPLICATE<br>TRIPLICATE<br>QUARDUPLICATE" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                sb.Append("<tr><td colspan='3'><hr></td></tr>");
                sb.Append("<tr><td colspan='3'><table width='100%'>");
                sb.Append("<tr>");
                sb.Append("<td width='17%'>" + strStartFont2 + "ESTABLISHMENT CODE NO." + strEndFont2 + "</td>");
                sb.Append("<td width='2%'>:</td>");
                sb.Append("<td width='10%'>" + strStartFont2 + "DSSHD0938826" + strEndFont2 + "</td>");
                sb.Append("<td  width='9%' colspan='2'>" + strStartFont2 + "ACCOUNT GROUP NO." + strEndFont2 + "&nbsp;&nbsp;&nbsp;......................................</td>");
                sb.Append("<td align='left' width='1%'>&nbsp;</td>");

                sb.Append("<td width='22%'>" + strStartFont2 + "PAID BY CHEQUE CASH" + '/' + " CASH" + strEndFont2 + "&nbsp;&nbsp;&nbsp;.........................</td>");
                sb.Append("</tr>");
                sb.Append("<tr><td colspan='6'><br></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td width='17%'>" + strStartFont2 + "DUES FOR THE MONTH OF" + strEndFont2 + "</td>");
                sb.Append("<td width='2%'>:</td>");
                sb.Append("<td width='15%' colspan='2'>" + strStartFont2 + "EMPLOYEE SHARE &nbsp;&nbsp;<b>" + ddlMonth.SelectedValue.ToString() + "/" + ddlFinYear.SelectedValue.ToString() + "</b><BR>EMPLOYER SHARE &nbsp;&nbsp;<b>" + ddlMonth.SelectedValue.ToString() + "/" + ddlFinYear.SelectedValue.ToString() + "</b>" + strEndFont2 + "</td>");
                sb.Append("<td  width='4%'></td>");
                sb.Append("<td width='1%'></td>");

                sb.Append("<td width='22%'>" + strStartFont2 + "DATE OF PAYMENT" + strEndFont2 + "&nbsp;&nbsp;&nbsp;...........................................</td>");
                sb.Append("</tr>");
                sb.Append("<tr><td colspan='6'><br></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td width='17%'>" + strStartFont2 + "TOTAL NO. OF SUBSCRIBERS<br>TORAL WAGES DUE" + strEndFont2 + "</td>");
                sb.Append("<td width='4%'>" + strStartFont2 + " A/c 1" + strEndFont2 + "</td>");
                sb.Append("<td width='15%' align='right' style='border-left:1px solid #000000;border-RIGHT:1px solid #000000;'>" + strStartFont2 + _dt.Rows[0][0].ToString() + "<BR>" + Account1 + "" + strEndFont2 + "</td>");
                sb.Append("<td  width='4%' align='center'>" + strStartFont2 + "A/c 10" + strEndFont2 + "</td>");
                sb.Append("<td width='15%' align='right' style='border-left:1px solid #000000;border-RIGHT:1px solid #000000;'>" + strStartFont2 + _dt.Rows[0][0].ToString() + "<BR>" + Account10 + "" + strEndFont2 + "</td>");

                sb.Append("<td width='4%' align='center'>" + strStartFont2 + "A/c 21" + strEndFont2 + "</td>");
                sb.Append("<td width='15%' align='right' style='border-left:1px solid #000000;border-RIGHT:1px solid #000000;'>" + strStartFont2 + _dt.Rows[0][0].ToString() + "<BR>" + Account21 + "" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                sb.Append("</table></td></tr>");
                sb.Append("<tr><td colspan='3'><b><hr></b></td></tr>");
                sb.Append("<tr><td colspan='3'><table width='100%'>");
                sb.Append("<tr>");
                sb.Append("<td  style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "S.NO." + strEndFont2 + "</b></td>");
                sb.Append("<td style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "PARTICULARS" + strEndFont2 + "</b></td>");
                sb.Append("<td style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "A/c. No.1" + strEndFont2 + "</b></td>");
                sb.Append("<td style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "A/c. No.2" + strEndFont2 + "</b></td>");
                sb.Append("<td style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "A/c. No.10" + strEndFont2 + "</b></td>");
                sb.Append("<td style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "A/c. No.21" + strEndFont2 + "</b></td>");
                sb.Append("<td style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "A/c. No.22" + strEndFont2 + "</b></td>");
                sb.Append("<td style='border-bottom:1px solid #000000;'><b>" + strStartFont2 + "TOTAL" + strEndFont2 + "</b></td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "1</td>" + strEndFont2 + "");
                sb.Append("<td>" + strStartFont2 + "EMPLOYER'S SHARE OF CONT." + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + AccountSN1AC1int + "" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "" + AccountSN1AC10int + "" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + AccountSN1AC21int + "" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "" + sn1Totalint + "" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                // sb.Append("<tr><td colspan='8'><b><br></b></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "2" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "EMPLOYEE SHARE OF CONT." + strEndFont2 + "</td>");
                //sb.Append("<td>" + strStartFont2 + "" + AccountSN2AC1int + "" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + AccountSN2AC1 + "" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "" + sn2Totalint + "" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                // sb.Append("<tr><td colspan='8'><b><br></b></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "3" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "ADMN. CHARGES" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "" + AccountSN3AC2int + "" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "" + AccountSN3AC22int + "" + strEndFont2 + "</td>");
                //sb.Append("<td>" + strStartFont2 + "" + sn3Totalint + "" + strEndFont2 + "</td>");//By Shruti
                sb.Append("<td>" + strStartFont2 + "" + sn3Totalint + "" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                //sb.Append("<tr><td colspan='8'><b><br></b></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "4" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "INPECTION CHARGES" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td></td>");
                sb.Append("<td></td>");
                sb.Append("<td></td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                // sb.Append("<tr><td colspan='8'><b><br></b></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "5" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "PENAL DAMAGES" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                //sb.Append("<tr><td colspan='8'><b><br></b></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "6" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "MISC. PAYMENTS(Past <br>Accumulation only)" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "0.00" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                // sb.Append("<tr><td colspan='8'><b><br></b></td></tr>");
                sb.Append("<tr>");
                sb.Append("<td></td>");
                sb.Append("<td align='center'>" + strStartFont2 + "TOTAL</td>");
                sb.Append("<td>" + strStartFont2 + "" + AC1Totalint + "" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + AC2Totalint + "" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + AC10Totalint + "" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + AC21Totalint + "" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + AC22Totalint + "" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + "" + FCTotalint + "" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                sb.Append("<tr><td colspan='8'><b><br></b></td></tr>");
                sb.Append("<tr><td colspan='8' align='center'>" + strStartFont2 + "(AMOUNT IN WORDS)____<b>" + _objConvertMasterManager.changeNumericToWords(FCTotalint) + strEndFont2 + "</b></td></tr>");
                sb.Append("</table></td></tr>");
                sb.Append("<tr><td colspan='3'><hr></td></tr>");
                sb.Append("<tr><td colspan='3'><table width='100%'>");
                sb.Append("<tr>");
                sb.Append("<td style='border-right:1px solid #000000;'><table width='100%'>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "NAME OF ESTABLISHMENT" + strEndFont2 + "</td>");
                sb.Append("<td><b>" + strStartFont2 + txtOrgName.Text + strEndFont2 + "</b></td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "ADDRESS" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + txtAddress.Text + strEndFont2 + "</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "NAME OF DEPOSITOR" + strEndFont2 + "</td>");
                sb.Append("<td>.....................................................</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "SIGNATURE OF DEPOSITOR" + strEndFont2 + "</td>");
                sb.Append("<td>.....................................................</td>");
                sb.Append("</tr>");
                sb.Append("</table></td>");
                sb.Append("<td><table width='100%'>");
                sb.Append("<tr>");
                sb.Append("<td colspan='2'><b>" + strStartFont2 + "(FOR BANK USE ONLY)" + strEndFont2 + "</b></td>");

                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "AMOUNT RECEIVED:RS" + strEndFont2 + "</td>");
                sb.Append("<td>..................................</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td colspan='2'>" + strStartFont2 + "FOR CHEQUE ONLY" + strEndFont2 + "</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "DATE OF PRESENTATION</td>");
                sb.Append("<td>..................................</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "DATE OF REALISATION" + strEndFont2 + "</td>");
                sb.Append("<td>..................................</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "BRANCH NAME" + strEndFont2 + "</td>");
                sb.Append("<td>..................................</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td>" + strStartFont2 + "BRANCH CODE NO." + strEndFont2 + "</td>");
                sb.Append("<td>..................................</td>");
                sb.Append("</tr>");
                sb.Append("</table></td>");
                sb.Append("</tr>");
                sb.Append("</table></td></tr>");
                sb.Append("<tr><td colspan='3'><b><hr></b></td></tr>");
                sb.Append("<tr><td colspan='3' align='center'><b>" + strStartFont2 + "(TO BE FILLED IN BY EMPLOYEE)" + strEndFont2 + "</b></td></tr>");
                sb.Append("<tr><td colspan='3'><table width='100%'>");
                sb.Append("<tr>");
                sb.Append("<td width='20%'>" + strStartFont2 + "NAME OF THE BANK" + strEndFont2 + "</td>");
                sb.Append("<td>" + BankName + "</td>");
                sb.Append("<td width='20%'>" + strStartFont2 + "CHEQUE NO." + strEndFont2 + "</td>");
                sb.Append("<td>" + ChequeNo + "</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td width='20%'>" + strStartFont2 + "Date" + strEndFont2 + "</td>");
                sb.Append("<td>" + Date + "</td>");
                sb.Append("<td width='20%'>" + strStartFont2 + "Amount" + strEndFont2 + "</td>");
                sb.Append("<td>" + strStartFont2 + FCTotalint + strEndFont2 + "</td>");
                sb.Append("</tr>");
                sb.Append("</table></td></tr>");
            }
            else
            {
                sb.Append("<tr><td colspan='3'><b>There is no record....</b></td></tr>");
            }

            sb.Append("</table>");
        }
        catch (Exception ex)
        {
            lblMsg.Text = "" + ex.Message.ToString();
        }
        return(sb.ToString());
    }
Ejemplo n.º 2
0
    public string GenratePaySlip(DataSet ds, string ForMonthYear, decimal PaidSalary)
    {
        DataTable _dt  = ds.Tables[0];
        DataTable _dt1 = ds.Tables[1];
        // DataTable _dt2 = ds.Tables[2];

        StringBuilder sb = new StringBuilder();

        sb.Append("<table width='100%' align='center' cellpadding='5' cellspacing='5' style='padding:20px,20px,20px,20px;' >");
        sb.Append("<tr>");
        sb.Append("<td width='5%'><img src='../../Images/logo.jpg' width='100' height='100' /></td>");
        sb.Append("<td width='95%' align='center' colspan='2' ><b>BROADCAST ENGINEERING CONSULTANTS INDIA LTD.<br>14-B, Ring Road,<br>Indraprastha Estate,<br>New Delhi 110002</b></td>");
        //sb.Append("<td width='18%'></td>");
        sb.Append("</tr>");
        //sb.Append("<tr>");
        //sb.Append("<td><img src='../../Images/logo.jpg' width='100' height='100' /></td>");
        //sb.Append("<td align='center'>14-B, Ring Road,<br>Indraprastha Estate,<br>New Delhi 110002");
        //sb.Append("</td>");
        //sb.Append("<td></td>");
        //sb.Append("</tr>");
        sb.Append("<tr><td><br></td></tr>");
        sb.Append("<tr>");
        sb.Append("<td></td>");
        sb.Append("<td align='center'><b>Pay Slip<br><font size='2'>for " + ForMonthYear + "</font></b></td>");
        sb.Append("<td></td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td></td>");
        sb.Append("<td align='center'><b>" + _dt.Rows[0]["Name"].ToString() + "</b></td>");
        sb.Append("<td></td>");
        sb.Append("</tr>");
        sb.Append("<tr><td colspan='3'><table width='100%'  align='center' cellpadding='0' cellspacing='0' style='border:1px solid #000000;font-size:14px;'>");
        sb.Append("<tr>");
        sb.Append("<td>Employee Number</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["EmployeeId"].ToString() + "</td>");

        sb.Append("<td>Income Tax Number(PAN)</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["PANCardNo"].ToString() + "</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td>Function</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["Department"].ToString() + "</td>");

        sb.Append("<td>PF Account Number</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["PFNo"].ToString() + "</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td>Designation</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["Designation"].ToString() + "</td>");

        sb.Append("<td>ESI Number</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["ESINo"].ToString() + "</td>");
        sb.Append("</tr>");

        sb.Append("<tr>");
        sb.Append("<td>Loation</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["ParamAddress"].ToString() + "</td>");

        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td>Bank Details</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["BankDetail"].ToString() + "</td>");

        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td>Date of Joining</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + _dt.Rows[0]["JoiningDate"].ToString() + "</td>");

        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td>Working Salary</td>");
        sb.Append("<td>:</td>");
        sb.Append("<td>" + PaidSalary + "</td>");

        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("<td></td>");
        sb.Append("</tr>");

        sb.Append("<tr><td colspan='6'><table width='100%'>");
        sb.Append("<hr>");
        sb.Append("<tr>");
        sb.Append("<th>Earning</th>");
        sb.Append("<th>Amount</th>");
        sb.Append("<th>Deduction</th>");
        sb.Append("<th>Amount</th>");
        sb.Append("</tr>");
        decimal TotalEarning   = 0;
        decimal TotalDesuction = 0;
        decimal NetAmount;
        string  AmountinWord;
        decimal Employee_EPFAmount = 0;

        for (int i = 0; i < _dt1.Rows.Count; i++)
        {
            TotalEarning = TotalEarning + Convert.ToDecimal(_dt1.Rows[i]["AllowancecesAmt"].ToString());


            sb.Append("<tr>");
            sb.Append("<td align='center'>" + _dt1.Rows[i]["Allowanceces"].ToString() + "</td>");
            sb.Append("<td align='center'>" + _dt1.Rows[i]["AllowancecesAmt"].ToString() + "</td>");
            sb.Append("<td align='center'>" + _dt1.Rows[i]["Deductions"].ToString() + "</td>");
            if (_dt1.Rows[i]["Deductions"].ToString() == "EPF")
            {
                Employee_EPFAmount = PaidSalary * Convert.ToDecimal(12.50) / 100;
                sb.Append("<td align='center'>" + Employee_EPFAmount.ToString("F") + "</td>");
                TotalDesuction = TotalDesuction + Employee_EPFAmount;
            }
            else if (_dt1.Rows[i]["Deductions"].ToString() == "VPF")
            {
                Employee_EPFAmount = PaidSalary * Convert.ToDecimal(12) / 100;
                sb.Append("<td align='center'>" + Employee_EPFAmount.ToString("F") + "</td>");
                TotalDesuction = TotalDesuction + Employee_EPFAmount;
            }
            else if (_dt1.Rows[i]["Deductions"].ToString() == "ESI")
            {
                Employee_EPFAmount = PaidSalary * Convert.ToDecimal(1.75) / 100;
                sb.Append("<td align='center'>" + Employee_EPFAmount.ToString("F") + "</td>");
                TotalDesuction = TotalDesuction + Employee_EPFAmount;
            }
            else if (_dt1.Rows[i]["Deductions"].ToString() == "LWF")
            {
                Employee_EPFAmount = PaidSalary * Convert.ToDecimal(12) / 100;
                sb.Append("<td align='center'>" + Employee_EPFAmount.ToString("F") + "</td>");
                TotalDesuction = TotalDesuction + Employee_EPFAmount;
            }

            else
            {
                sb.Append("<td align='center'>" + 0 + "</td>");
                TotalDesuction = TotalDesuction + 0;
            }
            sb.Append("</tr>");
        }

        NetAmount = TotalEarning - TotalDesuction;
        sb.Append("<tr>");
        sb.Append("<td align='center'><b>Total Earning</td>");
        sb.Append("<td align='center'><b>" + TotalEarning + "<b></td>");
        sb.Append("<td align='center'>Total Deduction</td>");
        sb.Append("<td align='center'><b>" + TotalDesuction.ToString("F") + "</b></td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td align='center'></td>");
        sb.Append("<td align='center'></td>");
        sb.Append("<td align='center'>Net Amount</td>");
        sb.Append("<td align='center'><b>" + NetAmount.ToString("F") + "</b></td>");
        sb.Append("</tr>");
        sb.Append("</table></td></tr>");
        sb.Append("</table></td></tr>");
        AmountinWord = _objConvertMasterManager.changeNumericToWords(Convert.ToDouble(NetAmount.ToString("F")));
        sb.Append("<tr>");
        sb.Append("<td>Amount(in words)</td>");
        sb.Append("<td colspan='2' align='right'><font size='2'>for BROADCAST ENGINEERING CONSULTANTS INDIA LTD.<font></td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td colspan='3'><font size='2'>" + AmountinWord + "<font></td>");
        sb.Append("<tr><td colspan='3'><br></td></tr>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td colspan='3' align='right'><font size='2'>Authorised Signatory<font></td>");
        sb.Append("</tr>");
        sb.Append("</table>");
        return(sb.ToString());
    }
Ejemplo n.º 3
0
    private string Challan(DataSet ds, string BankName, string Date, string ChequeNo)
    {
        StringBuilder sb = new StringBuilder();

        try
        {
            DataTable _dt  = ds.Tables[0];
            DataTable _dt1 = ds.Tables[1];

            sb.Append("<table width='100%'  align='center' cellpadding='0' cellspacing='0' style='border:1px solid #000000;font-size:14px; padding-left:10px; padding-right:10px; padding-bottom:10px;'>");



            if (_dt.Rows[0][0].ToString() != "0")
            {
                #region Calcaultaion

                double TotalAmt = 0;
                //double TotalAmt = 0;

                for (int q = 0; q < _dt1.Rows.Count; q++)
                {
                    if (Convert.ToString(_dt1.Rows[q]["AllwancesName"].ToString()) != "")
                    {
                        if (Convert.ToDouble(_dt1.Rows[q]["AllwancesAmt"].ToString()) > 0)
                        {
                            TotalAmt = TotalAmt + Convert.ToDouble(_dt1.Rows[q]["AllwancesAmt"].ToString());
                        }
                    }
                }

                double TotalEmpShareAmt = 0;
                TotalEmpShareAmt = Math.Round(Convert.ToDouble(TotalAmt) * Convert.ToDouble(1.75) / 100);

                double TotalEmplrShareAmt = 0;
                TotalEmplrShareAmt = Math.Round(Convert.ToDouble(TotalAmt) * Convert.ToDouble(4.75) / 100);
                double TotalEsiAmt = 0;
                TotalEsiAmt = TotalEmpShareAmt + TotalEmplrShareAmt;
                ConvertMasterManager objConvertMasterManager = new ConvertMasterManager();
                string InWordToEsi = objConvertMasterManager.changeNumericToWords(Convert.ToDouble(TotalEsiAmt));
                #endregion Calcaultaion
                //                sb.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0' style='border:1px solid #000; padding-left:10px; padding-right:10px;'>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top'>");
                sb.Append("<table>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top' style='font-size:13px;'>ORIGINAL<br />DUPLICATE<br />TRIPPLICATE<br />QUARDUPLICATE");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");

                sb.Append("</td>");
                sb.Append("<td align='left' valign='top'>");
                sb.Append("<table>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top' style='font-size:24px; font-weight:bold; padding-left:85px;'>E.S.I.C");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top' style='font-size:16px; font-weight:bold;'>");
                sb.Append("<table>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top'>");
                sb.Append("<div>Challan No.</div>");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top'><div style='border:1px solid #000; width:150px; height:20px;'></div>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");
                sb.Append("</td>");

                sb.Append("</tr>");
                sb.Append("</table>");
                sb.Append("</td>");
                sb.Append("</tr>");


                sb.Append("<tr>");
                sb.Append("<td align='center' valign='top' colspan='2' style=' font-size:14px;'><b>EMPLOYEE'S STATE INSURANCE FUND ACCOUNT NO. -1)<br />PAY-IN SLIP FOR CONTRIBUTIONN<br />STATE OF BANK OF INDIA</b>");
                sb.Append("</td>");

                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top'>Station &nbsp; ........................................</td>");
                sb.Append("<td align='right' valign='top'>Dated &nbsp;" + txtDate.Text + "</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top' height='10'></td>");
                sb.Append("<td align='right' valign='top' height='10'></td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top'>");
                sb.Append("<table style=' background-color:black;' cellpadding='1' cellspacing='1' height='100'>");
                sb.Append("<tr>");
                sb.Append("<td align='center' style=' background-color:#ffffff;' valign='top'>Particulars of cash/cheque No.");
                sb.Append("</td>");
                sb.Append("<td align='center' valign='top' style=' background-color:#ffffff;'>Amount Rs.P.");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='center' valign='middel' style=' background-color:#ffffff;'>Total");
                sb.Append("</td>");
                sb.Append("<td align='center' valign='middle' style=' background-color:#ffffff;'><b> " + TotalEsiAmt.ToString("F") + "</b><div style='border-top:1px solid #000;'><b>" + TotalEsiAmt.ToString("F") + "</b></div>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");

                sb.Append("</td>");
                sb.Append("<td align='left' valign='top'>");
                sb.Append("<table>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top'>Paid into credit of the Employee's State insurance Fund Account No. 1<br /><b style='border-bottom:1px dotted #000;'>Rs. " + TotalEsiAmt.ToString("F") + "</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (in figures)<br /><div style='border-bottom:1px dotted #000;'><i>" + InWordToEsi + "</i> (in words)</div>in cash/by Cheque (on realistion) of contribution as per details given below under the");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top'></td>");
                sb.Append("</tr>");
                sb.Append("</table>");

                sb.Append("</td>");
                sb.Append("</tr>");

                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>E.S.I Act, 1948 for the month of");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'><b>" + ddlMonth.SelectedItem.Text + "," + ddlFinYear.SelectedItem.Text + "</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Employer's Code No.");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;' >");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top'>Deposited By");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Name and Address of Factory/ Establishment");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'><b>" + txtOrgName.Text + "<br>" + txtAddress.Text + "</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>No of Employees");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'><b>" + Convert.ToString(_dt.Rows[0]["CntEmployee"].ToString()) + "</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Total Wages");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;' ><b>" + TotalAmt.ToString("F") + "</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Employee's Contribution Rs.");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'><b>" + TotalEmpShareAmt.ToString("F") + "</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Employer's Contribution Rs.");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'><b>" + TotalEmplrShareAmt.ToString("F") + "</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Total Rs.");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'><b>" + TotalEsiAmt.ToString("F") + "</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top' colspan='2' style='border-bottom:1px solid #000; padding-bottom:20px;'>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>(For use in Bank)");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top'><b> ( ACKNOWLEDGEMENT )</b>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top' height='10'></td>");
                sb.Append("<td align='right' valign='top' height='10'></td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Recieved payment with Cash/ Cheque / Draf No.");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'><b> " + txtChequeNo.Text + "</b></td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>");

                sb.Append("<table>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='bottom'>Dated</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000; margin-left:50px;'>" + txtDate.Text + "");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top'  >");

                sb.Append("<table>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='bottom'>for Rs.</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000; margin-left:50px;'>" + TotalEsiAmt.ToString("F") + "");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");

                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' colspan='2' valign='top' style='border-bottom:1px dotted #000;' ><i>" + InWordToEsi + "</i>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'  colspan='2' ><table width='100%'>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top' width='80%' >");



                sb.Append("<table>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='bottom'>Draw on </td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000; margin-left:50px;'>" + txtBankName.Text + "");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");
                sb.Append("</td>");
                sb.Append("<td align='right' valign='middle' width='20%'>(Bank in favour of)");
                sb.Append("</td>");

                sb.Append("</tr>");
                sb.Append("</table>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>Employee's State Insurance Fund Account No.1");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'>");


                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'>SL. No in Bank's Scroll");
                sb.Append("</td>");
                sb.Append("<td align='left' valign='top' style='border-bottom:1px dotted #000;'>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td align='left' valign='top' height='20'></td>");
                sb.Append("<td align='right' valign='top' height='20'></td>");
                sb.Append("</tr>");
                sb.Append("<tr >");
                sb.Append("<td align='left' valign='top'><b> Dated :</b>" + txtDate.Text + "");
                sb.Append("</td>");
                sb.Append("<td align='right' valign='top'>Aouthorised Signatory of the receiving Bank");

                sb.Append("</td>");
                sb.Append("</tr>");



                //sb.Append("</table>");
            }
            else
            {
                sb.Append("<tr><td colspan='3'><b>There is no record....</b></td></tr>");
            }

            sb.Append("</table>");
        }
        catch (Exception ex)
        {
            lblMsg.Text = "" + ex.Message.ToString();
        }
        return(sb.ToString());
    }