<%--
    Document   : ADHOC transaction
    Created on : Aug 3, 2015, 2:23:35 PM
    Author     : Administrator
--%>
<%@page import="DataEntryBean.transactionOperationBean"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.Date"%>
<%@page import="LoginDb.DbHandler"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@page import="java.util.UUID" %>
<%String uuid = UUID.randomUUID().toString();%>
<% try {
%>

<html>
    <head>
        <title>Buy/Sell Share</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="${pageContext.request.contextPath}/js/Calendar.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/TableCSSCode.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="shortcut icon" href="${pageContext.request.contextPath}/img/favicon.ico?pacs=<%=((new java.util.Date()).getTime())%>" type="image/x-icon" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/styles.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/InputBoxStyle.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/ButtonAndText.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/info.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/SelectStyle.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap" rel="stylesheet">
        <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/chromejs/chrome.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/js/iFrame_killer.js"></script>
        <style>
            .button{
                border:1px solid #333;
                background:#6479fd;

            }
            .button:hover{
                background:#a4a9fd;
            }
            .dialog{
                border:5px solid #666;
                padding:10px;
                background:#FFFFFF;
                position:absolute;
                left: 300px;
                z-index:1;
                display:none;
            }

            .dialog label{
                display:inline-block;
                color:#151414;
            }
            div .dialog input[type=text]{
                border:none;
                display:inline-block;
                margin:5px;
                width: 180px;
                -moz-user-select:-moz-none;
                -moz-user-select:none;
                -o-user-select:none;
                -khtml-user-select:none;
                -webkit-user-select:none;
                -ms-user-select:none;
                user-select:none;
            }
            .hideRow{
                 display: none;
}


        </style>
    </head>
    <body  onload="noBack()">
        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }

            function submitform(transactionForm)
            {
                if (checkDiv(transactionForm))
                {
                    document.transactionForm.action = '/PacsApplication/ShareTransactionOperationServlet';
                    document.transactionForm.submit();
                }
            }

            function checkDiv(transactionForm)
            {
                if (transactionForm.tranType.value == "Not")
                {
                    alert("Select Transaction Type.");
                    transactionForm.tranType.focus();
                    return false;
                }
                if (transactionForm.accNo.value == "")
                {
                    alert("Account Number must be filled.");
                    transactionForm.accNo.focus();
                    return false;
                }
                if (transactionForm.shareVal.value == "")
                {
                    alert("Please search account to get the details.");
                    transactionForm.accNo.focus();//shareVal
                    return false;
                }
                if (transactionForm.noOfShare.value == "")
                {
                    alert("Provide Number of Share must be filled.");
                    transactionForm.noOfShare.focus();
                    return false;
                }
                if (transactionForm.payMode.value == "")
                {
                    alert("Please select Payment Mode.");
                    transactionForm.payMode.focus();
                    return false;
                }
                if (transactionForm.trAmount.value == "")
                {
                    alert("Transaction Amount must be filled.");
                    transactionForm.trAmount.focus();
                    return false;
                }
                if (transactionForm.payMode.value == "T")
                {
                    if (transactionForm.transferAcc.value == "")
                    {
                    alert("Transfer A/C Number must be filled.");
                    transactionForm.transferAcc.focus();
                    return false;
                    }
                }
                if (transactionForm.narration.value == "")
                {
                    alert("Narration must be filled");
                    transactionForm.narration.focus();
                    return false;
                }
                
                var amount = $('#resTXNAmt').val();
                if((amount == null || amount == ""|| amount == "0") && $('#payMode').val() === "C"){
                        alert("Please fill-in the cash denominations.");
                        $("#trAmount").click();
                        return false;
                    }
                if(transactionForm.tranType.value == "1" && $('#payMode').val() === "C"){
                    if(amount <=0){
                        alert("Amount can not be lesser than or equal to zero when Transaction Credit is performed.");
                        return false;
                    }
                }
                if(transactionForm.tranType.value == "2" && $('#payMode').val() === "C"){
                    if(amount >=0){
                        alert("Amount can not be greater than or equal to zero when Transaction Debit is performed.");
                        return false;
                    }
                }
                return true;
            }

            function popup_TransdepAccount(width, height, accNo) {
                if($('#accNo').val() == ""){
                    alert( "Please select A/C No. first !!" );
                }else if($('#payMode').val() == ""){
                    alert( "Please select Payment Method  first." );
                }
                else{
                    if (window.innerWidth) {
                        LeftPosition = (window.innerWidth - width) / 2;
                        TopPosition = ((window.innerHeight - height) / 2) - 20;
                    }
                    else {
                        LeftPosition = (parseInt(window.screen.width) - width) / 2;
                        TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                    }
                    attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                        height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                        TopPosition + '';
                    var screenName = "shareaccounttransaction.jsp";
                    var  lovKey="SavingsAccSearchTransfer"
                    popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?accNo=' + accNo + '&screenName=' + screenName+'&lovKey='+lovKey, 'SavingsAccSearchTransfer', attr);
                    popWin.focus();

                }
            }

            function popup_depAccount(width, height, accNo) {

                if($('#tranType').val() === "Not"){
                    alert('Please select transaction type before searching account.');
                    $('#tranType').focus();
                    return false;

                }

                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                }
                else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                    height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                    TopPosition + '';
                var screenName = "ShareTransactionOperation.jsp";
                var lovKey = "shareAccount"
                popWin = open('${pageContext.request.contextPath}/CommonSearchInformationDepositLOV.jsp?accNo=' + accNo + '&screenName=' + screenName + '&lovKey=' + lovKey, 'shareAccount', attr);
                popWin.focus();

            }

            $(function() {
                $("#trAmount").keypress(function() {
                    if($('#tranType').val() === "Not"){
                        alert("Please select Transaction Type first.");
                        event.preventDefault();
                    }else if ($('#accNo').val() === ""){
                        alert("Please enter A/C No.");
                    }
                    else if ($('#status').val() === "C"){
                        alert("Cash Drawer isn't opened yet.");
                    }
                    else{
                        $("#myform").show(500);
                    }
                });

            });

            $(document).ready(function () {
                $('select#payMode').change(function () {
                    var val = $(this).val();
                    switch(val)
                    {
                        case 'C':

                            $('#tran').hide();
                            $('#transferaccNoSearch').hide();
                            $('#transferAcc').val('');
                            break;
                        case 'T':

                            $('#tran').show();
                            $('#transferaccNoSearch').show();
                            $('#transferAcc').val('');
                            if ($('.DenoCanBAdded').find('img').length > 0){
                                $('.DenoAdded').remove();
                            }
                            $( "#btnReset" ).click();
                            break;
                        default:

                            $('#tran').hide();
                            $('#transferaccNoSearch').hide();
                            $('#transferAcc').val('');
                            break;
                    }
                });

                $('select#tranType').change(function () {
                    $('#tranType option:not(:selected)').attr('disabled', true);
                });
            });

            $(function() {
                $("#trAmount").click(function() {
                    if($('#tranType').val() === "Not"){
                        alert("Please select Transaction Type first.");
                        event.preventDefault();
                    }else if ($('#accNo').val() === ""){
                        alert("Please enter A/C No.");
                    } else if ($('#payMode').val() === "T"){

                    } else if ($('#status').val() === "C"){
                        alert("Cash Drawer isn't opened yet.");
                    }
                    else{
                        $("#myform").show(500);
                    }
                });

            });

            function ShowParent()
            {
                document.forms[0].action = "${pageContext.request.contextPath}/Share_Module/shareaccounttransaction.jsp";
                document.forms[0].submit();
            }
            
            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });

        </script>

        <%
             String error_msg = "";
             Object error = request.getAttribute("message");
             if (error != null) {
                 error_msg = error.toString();
             }
        %>

        <%
             String displayFlag = "";
             Object display = request.getAttribute("displayFlag");
             if (display != null) {
                 displayFlag = display.toString();
             }
        %>

        <%          String odeno2000 = "";
             String odeno500 = "";
             String odeno200 = "";
             String odeno100 = "";
             String odeno50 = "";
             String odeno20 = "";
             String odeno10 = "";
             String odeno5 = "";
             String odeno2 = "";
             String odeno1 = "";
             String status = "C";
             String odeno50P = "";
             String odeno1P = "";
             String pacsid = (String) session.getAttribute("pacsId");
             String makerId = session.getAttribute("user").toString();
             Connection connection = null;
             ResultSet rs = null;
             Statement statement = null;
             connection = DbHandler.getDBConnection();
             try {
                 statement = connection.createStatement();
                 rs = statement.executeQuery("select nvl(d.deno_2000,0),nvl(d.deno_500,0),nvl(d.deno_100,0),nvl(d.deno_50,0),nvl(d.deno_20,0),nvl(d.deno_10,0),nvl(d.deno_5,0),nvl(d.deno_2,0),nvl(d.deno_1,0),nvl(d.DENO_50P,0),nvl(d.DENO_1P,0),d.status,nvl(d.deno_200,0) from cash_drawer d where d.entry_date = (select system_date from system_date) and  d.teller_id ='" + makerId + "' and d.pacs_id ='" + pacsid + "' ");

                 while (rs.next()) {
                     odeno2000 = rs.getString(1);
                     odeno500 = rs.getString(2);
                     odeno100 = rs.getString(3);
                     odeno50 = rs.getString(4);
                     odeno20 = rs.getString(5);
                     odeno10 = rs.getString(6);
                     odeno5 = rs.getString(7);
                     odeno2 = rs.getString(8);
                     odeno1 = rs.getString(9);
                     odeno50P = rs.getString(10);
                     odeno1P = rs.getString(11);
                     status = rs.getString(12);
                     odeno200 = rs.getString(13);

                 }
                // statement.close();         
                // connection.close();
             } catch (Exception e) {
                System.out.println("Error occurred during processing.");
            } finally {
                try {
                    if(statement !=null)
                        statement.close();
                    if (connection != null)
                    connection.close();

            } catch (Exception e) {               
               System.out.println("Error Occurred during connection close.");
            }

            }
        %>
        <jsp:include page="MenuHead_Share.jsp" flush="true" />
        <br>
        <%!
            String blankNull(String s) {
                return (s == null) ? "" : s;
            }
        %>



        <%-- added on 23/4/24<fieldset style="border-color: black; background-image: url('/PacsApplication/img/download.jpg'); border-width: 3px">
            <legend style="padding: 8px; border-radius: 20px; background-color: #006600; color: white">Buy/Sell Share</legend>--%>
        <fieldset style="border-radius: 20px; border-color: rgb(177, 224, 178); border-width: 2px; margin-left: 75px;margin-right: 75px;">
            <legend style="margin-left: 40px; width:130px; padding: 8px; border-radius: 18px; background-color: rgb(177, 224, 178); color: rgb(0, 140, 69)"><b>Buy/Sell Share</b></legend>
            <form name="transactionForm" method="post" action="">


                <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>
                <% }%>
                <br>
                <div class="dialog" id="myform">

                    <table border="2" width="auto" cellspacing="1" cellpadding="1" style="text-align: center ;overflow-y: scroll; font-size: 15px">
                        <thead class="CSSTableGenerator">
                            <tr>
                                <td>Denominations</td>
                                <td>Available</td>
                                <td>IN</td>
                                <td>OUT</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left"><label>2000 Note</label></td>
                                <td><input type="text" readonly name="twothouAvail" id="twothouAvail" class="available" value="<%=odeno2000%>"></td>
                                <td><input type="text" name="twothouIN" id="twothouIN" class="inDeno"></td>
                                <td><input type="text" name="twothouOUT" id="twothouOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>500 Note</label></td>
                                <td><input type="text" readonly name="fivehundredAvail" id="fivehundredAvail" class="available" value="<%=odeno500%>"></td>
                                <td><input type="text" name="fivehundredIN" id="fivehundredIN" class="inDeno"></td>
                                <td><input type="text" name="fivehundredOUT" id="fivehundredOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>200 Note</label></td>
                                <td><input type="text" readonly name="twohundredAvail" id="twohundredAvail" class="available" value="<%=odeno200%>"></td>
                                <td><input type="text" name="twohundredIN" id="twohundredIN" class="inDeno"></td>
                                <td><input type="text" name="twohundredOUT" id="twohundredOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>100 Note</label></td>
                                <td><input type="text" readonly name="hundredAvail" id="hundredAvail" class="available" value="<%=odeno100%>"></td>
                                <td><input type="text" name="hundredIN" id="hundredIN" class="inDeno"></td>
                                <td><input type="text" name="hundredOUT" id="hundredOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>50 Note</label></td>
                                <td><input type="text" readonly name="fiftyAvail" id="fiftyAvail" class="available" value="<%=odeno50%>"></td>
                                <td><input type="text" name="fiftyIN" id="fiftyIN" class="inDeno"></td>
                                <td><input type="text" name="fiftyOUT" id="fiftyOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>20 Note</label></td>
                                <td><input type="text" readonly name="twentyAvail" id="twentyAvail" class="available" value="<%=odeno20%>"></td>
                                <td><input type="text" name="twentyIN" id="twentyIN" class="inDeno"></td>
                                <td><input type="text" name="twentyOUT" id="twentyOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>10 Note</label></td>
                                <td><input type="text" readonly name="tenAvail" id="tenAvail" class="available" value="<%=odeno10%>"></td>
                                <td><input type="text" name="tenIN" id="tenIN" class="inDeno"></td>
                                <td><input type="text" name="tenOUT" id="tenOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>5 Note</label></td>
                                <td><input type="text" readonly name="fiveAvail" id="fiveAvail" class="available" value="<%=odeno5%>"></td>
                                <td><input type="text" name="fiveIN" id="fiveIN" class="inDeno"></td>
                                <td><input type="text" name="fiveOUT" id="fiveOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>2 Note</label></td>
                                <td><input type="text" readonly name="twoAvail" id="twoAvail" class="available" value="<%=odeno2%>"></td>
                                <td><input type="text" name="twoIN" id="twoIN" class="inDeno"></td>
                                <td><input type="text" name="twoOUT" id="twoOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>1 Note</label></td>
                                <td><input type="text" readonly name="oneAvail" id="oneAvail" class="available" value="<%=odeno1%>"></td>
                                <td><input type="text" name="oneIN" id="oneIN" class="inDeno"></td>
                                <td><input type="text" name="oneOUT" id="oneOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>50 Paisa</label></td>
                                <td><input type="text" readonly name="fiftyPaisaAvail" id="fiftyPaisaAvail" class="available" value="<%=odeno50P%>"></td>
                                <td><input type="text" name="fiftyPaisaIN" id="fiftyPaisaIN" class="inDeno"></td>
                                <td><input type="text" name="fiftyPaisaOUT" id="fiftyPaisaOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td align="left"><label>1 Paisa</label></td>
                                <td><input type="text" readonly name="onePaisaAvail" id="onePaisaAvail" class="available" value="<%=odeno1P%>"></td>
                                <td><input type="text" name="onePaisaIN" id="onePaisaIN" class="inDeno"></td>
                                <td><input type="text" name="onePaisaOUT" id="onePaisaOUT" class="outDeno"></td>
                            </tr>
                            <tr>
                                <td colspan="2" align="left"><label>Total IN/OUT</label></td>

                                <td><input type="text" readonly name="totalIN" id="totalIN" ></td>
                                <td><input type="text" readonly name="totalOUT" id="totalOUT" ></td>
                            </tr>
                            <tr>
                                <td><label>Cash Drawer Present Balance</label></td>
                                <td><input type="text" readonly name="cashDRWBal" id="cashDRWBal" ></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><label>Resulted Txn Amount</label></td>
                                <td><input type="text" readonly name="resTXNAmt" id="resTXNAmt"></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </tbody>
                    </table>
                    <br>
                    <div align="center">
                        <input type="button" value="Ok" id="btnOK"><input type="button" value="Reset" id="btnReset"><input type="button" value="Close" id="closePopup">
                    </div>

                </div>
                <div id="transaction" style="display:block;">
                    <center>
                        <table class="numbersOnly">
                            <tbody>
                                <tr>
                                    <td></td>
                                    <td style="text-align: left;">Select Transaction Type<font color="red" >*</font>:</td>
                                    <td><select style="width: 177px";id="tranType" name="tranType">
                                            <option value="Not">--Select--</option>
                                            <option value="1">Buy Share</option>
                                            <option value="2">Sell Share</option>

                                        </select>
                                    </td>
                                </tr>

                                <tr>
                                    <td></td>
                                    <td>Account Number<font color="red" >*</font>:</td>
                                    <td><input type="text" name="accNo" id="accNo" style="text-align:right; border-radius: 20px" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                    <td><input type="button" name="accNoSearch" id="accNoSearch" value="Search" onclick="javascript:popup_depAccount(750, 250, document.transactionForm.accNo.value);"/></td>
                                </tr>

                                <tr class="hideRow"><td colspan="5"><hr></td></tr>
                                <tr class="hideRow">
                                    <td>Customer Name:</td>
                                    <td><input type="text" name="custName" id="custName" size="15" value="" readonly/></td>

                                    <td>Share Amount Due:</td>
                                    <td><input type="text" name="amtDue" id="amtDue" size="15" value="" readonly style="text-align:right;"/></td>
                                </tr>

                                <tr class="hideRow">
                                    <td>Number of Share Bought:</td>
                                    <td><input type="text" name="shareBrgt" id="shareBrgt" size="15" value="" readonly style="text-align:right;"/></td>

                                    <td>Share Value:</td>
                                    <td><input type="text" name="shareVal" id="shareVal" size="15" value="" readonly style="text-align:right;"/></td>
                                </tr>

                                <tr class="hideRow"><td colspan="5"><hr></td></tr>
                                <tr class="hideRow">
                                    <td></td>
                                    <td>Number of Share<font color="red" >*</font>:</td>
                                    <td><input type="text" name="noOfShare" id="noOfShare" size="15" value="" style="text-align:right;"/></td>
                                </tr>
                                <tr class="hideRow">
                                    <td></td>
                                    <td>Payment Mode<font color="red" >*</font>:</td>
                                    <td><select id="payMode" name="payMode">
                                            <option value="" disabled selected style="display: none">-- Select --</option>
                                            <option value="C">Cash/Cheque</option>
                                            <option value="T">Transfer</option>
                                        </select> </td>
                                </tr>
                                <tr class="hideRow" id="trAmountTD">
                                    <td></td>
                                    <td>Transaction Amount<font color="red" >*</font>:</td>
                                    <td><input type="text" name="trAmount" id="trAmount" size="15" readonly value="" style="text-align:right;"/></td>
                                </tr>
                                <tr id="tran" name="tran" style="display: none">
                                    <td></td>
                                    <td>Transfer A/C Number<font color="red" >*</font>: </td><td><input type="text" readonly name="transferAcc" id="transferAcc" style="text-align:right;" /></td><td><input type="button" name="transferaccNoSearch" id="transferaccNoSearch" value="Search" onclick="javascript:popup_TransdepAccount(520, 280, document.transactionForm.accNo.value);"/></td>
                                </tr>
                                <tr class="hideRow">
                                    <td></td>
                                    <td>Transaction Narration<font color="red" >*</font>:</td>
                                    <td><textarea name="narration" id="narration"></textarea> </td> 
                                </tr>
                            </tbody>
                        </table>
                    </center>
                    <br><br>

                    <center>
                        <input type="button" value="Submit" onclick="javascript:submitform(transactionForm)">
                        <input type="button" value="Reset" onclick="javascript:ShowParent()" />
                   </center>
                </div>
                <input type="hidden" name="screenName" value="DepositTransactionOperation.jsp"/>
                <input type="hidden" name="status" id="status" value="<%=status%>" />
                <input type="hidden" value="" name="custNo" id="custNo"/>
            </form>
        </fieldset>
    </body>
    <script>


        function check(v){
            if(isNaN(v) || v == '' || v.trim().length == 0){ return parseInt(0);}
            else { return v;}
        }

        var first = $('#twothouAvail').val();
        var second = $('#fivehundredAvail').val();
        var third = $('#hundredAvail').val();
        var fourth = $('#fiftyAvail').val();
        var fifth = $('#twentyAvail').val();
        var sixth = $('#tenAvail').val();
        var seventh = $('#fiveAvail').val();
        var eighth = $('#twoAvail').val();
        var ninth = $('#oneAvail').val();
        var eleventh = $('#fiftyPaisaAvail').val();
        var twelveth = $('#onePaisaAvail').val();
        var thirtinth = $('#twohundredAvail').val();


        $(document).ready(function() {
            $('#myform').find(':input.inDeno[type="text"],#totalIN,#totalOUT,#resTXNAmt').val('0');
            $('#myform').find(':input.outDeno[type="text"]').val('0');
            $('.inDeno,.outDeno').css({"background-color": "#FFFFC1"});
            $('#totalIN,#totalOUT').css({"background-color": "#ffff93"});
            $('#cashDRWBal,#resTXNAmt').css({"background-color": "#b2d0b2"});
        });

        var AvailsumOnLoad = 0;
        var DenoINsumOnLoad = 0;

        AvailsumOnLoad = parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100) + parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1)+ parseFloat(parseInt(check($('#fiftyPaisaAvail').val())) * 0.50) + parseFloat(parseInt(check($('#onePaisaAvail').val())) * 0.01)  ;
        $("#cashDRWBal").val(AvailsumOnLoad);
        var tenth = $('#cashDRWBal').val();//calculating present cash drawer value for first time

        $( "#btnReset" ).click(function() {
            $('#myform').find(':input.inDeno[type="text"],:input.outDeno[type="text"]').val('0');
            $("#totalIN").val('0');
            $("#totalOUT").val('0');
            $('#twothouAvail').val(first);
            $('#fivehundredAvail').val(second);
            $('#hundredAvail').val(third);
            $('#fiftyAvail').val(fourth);
            $('#twentyAvail').val(fifth);
            $('#tenAvail').val(sixth);
            $('#fiveAvail').val(seventh);
            $('#twoAvail').val(eighth);
            $('#oneAvail').val(ninth);
            $('#fiftyPaisaAvail').val(eleventh);
            $('#onePaisaAvail').val(twelveth);
            $("#cashDRWBal").val(tenth);
            $('#resTXNAmt').val('0');
            $('#twohundredAvail').val(thirtinth);
            if ($('#trAmountTD').find('img').length > 0){
                $('.DenoAdded').remove();
            }
        });

        //make all inputs whole numbers only
        $('.dialog').on('keydown',':input[type="text"]', function(event) {
            if (event.shiftKey == true) {
                event.preventDefault();
            }

            if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 46) {

            } else {
                event.preventDefault();
            }
        });

        //calculating IN & OUT Total,and Resultant final Amount
        $('#myform').on("keyup", ".inDeno,.outDeno", function() {
            var DenoINsumOnChange = 0;
            var DenoOUTsumOnChange = 0;
            DenoINsumOnChange = parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01);
            $("#totalIN").val(DenoINsumOnChange);
            DenoOUTsumOnChange = parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val()) * 0.01);
            $("#totalOUT").val(DenoOUTsumOnChange);
            $('#resTXNAmt').val(parseFloat(check($('#totalIN').val())) - parseFloat(check($('#totalOUT').val())));
        });

        //for Rs 2000 starts
        $('#myform').on("keyup", "#twothouOUT", function() {
            if(parseInt($("#twothouAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.2000 Notes");
                $('#btnReset').click();
            }
            else{
                $('#twothouAvail').val(parseInt(check(first)) + (parseInt(check($('#twothouIN').val())) - parseInt(check($('#twothouOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#twothouOUT", function() {
            if(parseInt(first)< parseInt(check($('#twothouOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#twothouIN", function() {

                $('#twothouAvail').val(parseInt(check(first)) + (parseInt(check($('#twothouIN').val())) - parseInt(check($('#twothouOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });

        //for Rs 500 starts
        $('#myform').on("keyup", "#fivehundredOUT", function() {
            if(parseInt($("#fivehundredAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.500 Notes");
                $('#btnReset').click();
            }
            else{
                $('#fivehundredAvail').val(parseInt(check(second)) + (parseInt(check($('#fivehundredIN').val())) - parseInt(check($('#fivehundredOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#fivehundredOUT", function() {
            if(parseInt(second)< parseInt(check($('#fivehundredOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#fivehundredIN", function() {

                $('#fivehundredAvail').val(parseInt(check(second)) + (parseInt(check($('#fivehundredIN').val())) - parseInt(check($('#fivehundredOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });

        //for Rs 200 starts
        $('#myform').on("keyup", "#twohundredOUT", function() {
            if(parseInt($("#twohundredAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.200 Notes");
                $('#btnReset').click();
            }
            else{
                $('#twohundredAvail').val(parseInt(check(thirtinth)) + (parseInt(check($('#twohundredIN').val())) - parseInt(check($('#twohundredOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#twohundredOUT", function() {
            if(parseInt(thirtinth)< parseInt(check($('#twohundredOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#twohundredIN", function() {

                $('#twohundredAvail').val(parseInt(check(thirtinth)) + (parseInt(check($('#twohundredIN').val())) - parseInt(check($('#twohundredOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });

        //for Rs 100 starts
        $('#myform').on("keyup", "#hundredOUT", function() {
            if(parseInt($("#hundredAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.100 Notes");
                $('#btnReset').click();
            }
            else{
                $('#hundredAvail').val(parseInt(check(third)) + (parseInt(check($('#hundredIN').val())) - parseInt(check($('#hundredOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#hundredOUT", function() {
            if(parseInt(third)< parseInt(check($('#hundredOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#hundredIN", function() {

                $('#hundredAvail').val(parseInt(check(third)) + (parseInt(check($('#hundredIN').val())) - parseInt(check($('#hundredOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });


        //for Rs 50 starts
        $('#myform').on("keyup", "#fiftyOUT", function() {
            if(parseInt($("#fiftyAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.50 Notes");
                $('#btnReset').click();
            }
            else{
                $('#fiftyAvail').val(parseInt(check(fourth)) + (parseInt(check($('#fiftyIN').val())) - parseInt(check($('#fiftyOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#fiftyOUT", function() {
            if(parseInt(fourth)< parseInt(check($('#fiftyOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#fiftyIN", function() {

                $('#fiftyAvail').val(parseInt(check(fourth)) + (parseInt(check($('#fiftyIN').val())) - parseInt(check($('#fiftyOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });

        //for Rs 20 starts
        $('#myform').on("keyup", "#twentyOUT", function() {
            if(parseInt($("#twentyAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.20 Notes");
                $('#btnReset').click();
            }
            else{
                $('#twentyAvail').val(parseInt(check(fifth)) + (parseInt(check($('#twentyIN').val())) - parseInt(check($('#twentyOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#twentyOUT", function() {
            if(parseInt(fifth)< parseInt(check($('#twentyOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#twentyIN", function() {

                $('#twentyAvail').val(parseInt(check(fifth)) + (parseInt(check($('#twentyIN').val())) - parseInt(check($('#twentyOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });

        //for Rs 10 starts
        $('#myform').on("keyup", "#tenOUT", function() {
            if(parseInt($("#tenAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.10 Notes");
                $('#btnReset').click();
            }
            else{
                $('#tenAvail').val(parseInt(check(sixth)) + (parseInt(check($('#tenIN').val())) - parseInt(check($('#tenOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#tenOUT", function() {
            if(parseInt(sixth)< parseInt(check($('#tenOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#tenIN", function() {

                $('#tenAvail').val(parseInt(check(sixth)) + (parseInt(check($('#tenIN').val())) - parseInt(check($('#tenOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });


        //for Rs 5 starts
        $('#myform').on("keyup", "#fiveOUT", function() {
            if(parseInt($("#fiveAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.5 Notes");
                $('#btnReset').click();
            }
            else{
                $('#fiveAvail').val(parseInt(check(seventh)) + (parseInt(check($('#fiveIN').val())) - parseInt(check($('#fiveOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#fiveOUT", function() {
            if(parseInt(seventh)< parseInt(check($('#fiveOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#fiveIN", function() {

                $('#fiveAvail').val(parseInt(check(seventh)) + (parseInt(check($('#fiveIN').val())) - parseInt(check($('#fiveOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });


        //for Rs 2 starts
        $('#myform').on("keyup", "#twoOUT", function() {
            if(parseInt($("#twoAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.2 Notes");
                $('#btnReset').click();
            }
            else{
                $('#twoAvail').val(parseInt(check(eighth)) + (parseInt(check($('#twoIN').val())) - parseInt(check($('#twoOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#twoOUT", function() {
            if(parseInt(eighth)< parseInt(check($('#twoOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#twoIN", function() {

                $('#twoAvail').val(parseInt(check(eighth)) + (parseInt(check($('#twoIN').val())) - parseInt(check($('#twoOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });


        //for Rs 1 starts
        $('#myform').on("keyup", "#oneOUT", function() {
            if(parseInt($("#oneAvail").val())<= 0)
            {
                alert("Insufficiernt Rs.1 Notes");
                $('#btnReset').click();
            }
            else{
                $('#oneAvail').val(parseInt(check(ninth)) + (parseInt(check($('#oneIN').val())) - parseInt(check($('#oneOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#oneOUT", function() {
            if(parseInt(ninth)< parseInt(check($('#oneOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#oneIN", function() {

                $('#oneAvail').val(parseInt(check(ninth)) + (parseInt(check($('#oneIN').val())) - parseInt(check($('#oneOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });

        //for 50 Paisa starts
        $('#myform').on("keyup", "#fiftyPaisaOUT", function() {
            if(parseInt($("#fiftyPaisaAvail").val())<= 0)
            {
                alert("Insufficiernt 50 Paisa");
                $('#btnReset').click();
            }
            else{
                $('#fiftyPaisaAvail').val(parseInt(check(eleventh)) + (parseInt(check($('#fiftyPaisaIN').val())) - parseInt(check($('#fiftyPaisaOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#fiftyPaisaOUT", function() {
            if(parseInt(eleventh)< parseInt(check($('#fiftyPaisaOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#fiftyPaisaIN", function() {

                $('#fiftyPaisaAvail').val(parseInt(check(eleventh)) + (parseInt(check($('#fiftyPaisaIN').val())) - parseInt(check($('#oneOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });

        //for 1 Paisa starts
        $('#myform').on("keyup", "#onePaisaOUT", function() {
            if(parseInt($("#onePaisaAvail").val())<= 0)
            {
                alert("Insufficiernt 1 Paisa");
                $('#btnReset').click();
            }
            else{
                $('#onePaisaAvail').val(parseInt(check(twelveth)) + (parseInt(check($('#onePaisaIN').val())) - parseInt(check($('#onePaisaOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));
            }
        });
        $('#myform').on("change", "#onePaisaOUT", function() {
            if(parseInt(twelveth)< parseInt(check($('#onePaisaOUT').val()))){
                alert("Insufficient Denomination !!!");
                $('#btnReset').click();
            }
        });
        $('#myform').on("keyup", "#onePaisaIN", function() {

                $('#onePaisaAvail').val(parseInt(check(twelveth)) + (parseInt(check($('#onePaisaIN').val())) - parseInt(check($('#onePaisaOUT').val()))));
                $("#totalOUT").val(parseInt(check($('#twothouOUT').val())) * 2000 + parseInt(check($('#fivehundredOUT').val())) * 500 + parseInt(check($('#twohundredOUT').val())) * 200 + parseInt(check($('#hundredOUT').val())) * 100 + parseInt(check($('#fiftyOUT').val())) * 50 + parseInt(check($('#twentyOUT').val())) * 20 + parseInt(check($('#tenOUT').val())) * 10 + parseInt(check($('#fiveOUT').val())) * 5 + parseInt(check($('#twoOUT').val())) * 2 + parseInt(check($('#oneOUT').val())) + parseFloat(check($('#fiftyPaisaOUT').val()) * 0.50) + parseFloat(check($('#onePaisaOUT').val())* 0.01));
                $('#totalIN').val(parseInt(check($('#twothouIN').val())) * 2000 + parseInt(check($('#fivehundredIN').val())) * 500 + parseInt(check($('#twohundredIN').val())) * 200 + parseInt(check($('#hundredIN').val())) * 100 + parseInt(check($('#fiftyIN').val())) * 50 + parseInt(check($('#twentyIN').val())) * 20 + parseInt(check($('#tenIN').val())) * 10 + parseInt(check($('#fiveIN').val())) * 5 + parseInt(check($('#twoIN').val())) * 2 + parseInt(check($('#oneIN').val())) + parseFloat(check($('#fiftyPaisaIN').val()) * 0.50) + parseFloat(check($('#onePaisaIN').val()) * 0.01));
                $("#cashDRWBal").val(parseInt(check($('#twothouAvail').val()) * 2000) + parseInt(check($('#fivehundredAvail').val()) * 500) + parseInt(check($('#twohundredAvail').val()) * 200) + parseInt(check($('#hundredAvail').val()) * 100)+ parseInt(check($('#fiftyAvail').val()) * 50)+ parseInt(check($('#twentyAvail').val()) * 20)+ parseInt(check($('#tenAvail').val()) * 10)+ parseInt(check($('#fiveAvail').val()) * 5)+ parseInt(check($('#twoAvail').val()) * 2)+ parseInt(check($('#oneAvail').val()) * 1) + parseFloat(check($('#fiftyPaisaAvail').val()) * 0.50) + parseFloat(check($('#onePaisaAvail').val()) * 0.01));
                $('#resTXNAmt').val(Number(check($('#totalIN').val())) - Number(check($('#totalOUT').val())));

        });


        //Reset transaction amout when OK button clicks
        $('#btnOK').click(function(){
            var amount = $('#resTXNAmt').val();
            var flag = 0;
            if($('#tranType').val() == "1")//crdeit
            {
                if(Number(amount) <= 0){
                    alert("Amount can not be lesser than or equal to zero when Transaction Credit is performed!!! ");
                    flag = 1;
                }
            }
            else if($('#tranType').val() == "2")//debit
            {
                if(Number(amount) >= 0){
                    alert("Amount can not be greater than or equal to zero when Transaction Debit is performed!!! ");
                    flag = 1;
                }
            }
            if(parseInt(flag) == 0){
                $('#trAmount').val(Number(Math.abs(amount)));
                $("#myform").hide(400);
                if ($('#trAmountTD').find('img').length == 0)
                {
                    $('#trAmountTD').append('<span class="DenoAdded" style="padding-right:3px; padding-top: 3px; padding-left: 5px; display:inline-block;"><img class="manImg" src="${pageContext.request.contextPath}/img/check.png" width="15" height="20"/>Denomination added</span>');

                }
            }
        });
        $('#closePopup').click(function(){
            $( "#btnReset" ).click();
            //$('#trAmount').val('0');
            $("#myform").hide(400);
        });

    </script>
    <script>
        //make all inputs whole numbers only
        $('table.numbersOnly').on('keydown','#noOfShare', function(event) {

            //alert(event.keyCode);

            if($('#shareVal').val() == ""){
                alert('Please search a account to proceed');
                event.preventDefault();
            }
            if (event.shiftKey == true) {
                event.preventDefault();
            }

            if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.keyCode == 8  || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 46 || event.keyCode == 110 || event.keyCode == 190) {

            } else {
                event.preventDefault();
            }
        });

        $('#noOfShare').keyup(function(){
            $('#trAmount').val(Math.ceil(Number(check($('#noOfShare').val())) * Number(check($('#shareVal').val()))));
        });



    </script>
</html>
<% 	} catch (Exception e) {
               
            }
%>





