<%-- 
    Document   : ChequePosting
    Created on : Jul 7, 2018, 2:34:34 PM
    Author     : 1004242
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        
        <title>Cheque Posting</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/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())%>" />
        <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>
        
    </head>


    <script>
    function popup_depAccount(width, height, accNo) {
            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 = "ChequePosting.jsp";
            var lovKey = "depositAccount"
            popWin = open('${pageContext.request.contextPath}/CommonSearchInformationDepositLOV.jsp?accNo=' + accNo + '&screenName=' + screenName + '&lovKey=' + lovKey, 'depositAccount', attr);
            popWin.focus();

        }
          function checkDiv(transferForm)
            {

                if (transferForm.accNo.value == "")
                {
                    alert("Account must be selected!!");
                    transferForm.accNo.focus();
                    return false;
                }
                else if (transferForm.chqNo.value == "" )
                {
                    alert("Cheque Number must be selected!!");
                    transferForm.chqNo.focus();
                    return false;
                }
                else if (transferForm.chqDt.value == "" )
                {
                    alert("Please provide cheque date.");
                    transferForm.chqDt.focus();
                    return false;
                }
                 else if (transferForm.chqAmt.value == "" || transferForm.chqAmt.value == 0 )
                {
                    alert("Cheque amount must be provided(Can not be zero)!!");
                    transferForm.chqAmt.focus();
                    return false;
                }
                else if (transferForm.chqBnk.value == "" )
                {
                    alert("Please provide issuer bank name.");
                    transferForm.chqBnk.focus();
                    return false;
                }

                return true;
            }

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

    </script>
        <%
             String error_msg = "";
             Object error = request.getAttribute("message");
             if (error != null) {
                 error_msg = error.toString();
             }
        %>
      
          
    <body >
    
         <jsp:include page="MenuHead_Deposit.jsp" flush="true" />
        <br>
        <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">CHEQUE POSTING</legend>
            <form name="transferForm" method="post" action="" id="transferForm">
                 <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>
                <% }%>
                <center>
                 <td>Account No:</td>
                 <td><input type="text" name="accNo" id="accNo"  /></td>
                 <td><input type="button"  value="Search" onclick="javascript:popup_depAccount(750, 250,document.transferForm.accNo.value);"/></td>
                 <br><br>
                <%-- <td style="text-align: right">Customer Name.: </td>
                 <td><input type="text " name="custNm" id="custNm" value="" readonly/></td>--%>
                 </center>
                <br><br>
                 <center>
                <table >
                    <tr>
                                <td style="text-align: right">Cheque No. </td>
                                <td><input type="number" name="chqNo" id="chqNo" value=""/></td>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td style="text-align: right">Cheque Date: </td>
                                <td><input  type="text" id="chqDt" name="chqDt" readonly /><a href="#" onclick="return getCalendar(document.forms[0].chqDt);"><img src="${pageContext.request.contextPath}/img/calendar.gif" name="imgr" border="0" width="15" height="20" /></a></td>


                    </tr>
                    <tr>
                                <td style="text-align: right">Cheque Amount. </td>
                                <td><input type="number" name="chqAmt" id="chqAmt" value=""/></td>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td style="text-align: right">Cheque Issuer Bank. </td>
                                <td><input type="text" name="chqBnk" id="chqBnk" value=""/></td>
                    </tr>
                           
                </table>
                </center>
                <br><br>

                

                <center>
                    <input type="button" id="submitButton"  value="Submit" onclick="javascript:submitform(transferForm)">
                    <input type="reset" value="Reset" />
                </center>
                <input type="hidden" name="screenName" value="DepositTransferOperation">
               

            </form>
        </fieldset>
    </body>
</html>
