<%--
    Document   : ReverseTransaction
    Created on : Nov 29, 2016, 1:16:44 PM
    Author     : 986137
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

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

<html>
    <head>

        <title>Reverse Transaction</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>
    <body onload="noBack()">
        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }

            function submitJrnl(txnReversal){

                if (checkDiv(txnReversal))
                {
                    var answer = confirm("Transaction will be reversed. Do you want to continue? ");
                    if(answer){
                        document.txnReversal.action = '/PacsApplication/DepositTxnReversalServlet';
                        document.txnReversal.submit();
                    }
                }
            }
            function checkDiv(txnReversal){
                if(txnReversal.jrnlNo.value=="")
                {
                    alert("Please enter Journal No. !!");
                    txnReversal.jrnlNo.focus();
                    return false;
                }
                return true;

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

        <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">TRANSACTION REVERSAL</legend>
            <form action="" method="post" name="txnReversal">
                <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>
                <% }%>

                <div id="create" align="center">
                    <table class="numberOnly">
                        <tr>
                            <td>Enter Reference No :
                                <input type="text" name="jrnlNo"  id="jrnlNo" style="width: 200px" /></td>

                            <td><input type="button" value="Submit" onclick="javascript:submitJrnl(txnReversal)"></td>
                        </tr>
                    </table>
                </div>

            </form>

        </fieldset>

    </body>
    <script>
        //make all inputs whole numbers only
        $('table.numbersOnly').on('keydown','#jrnlNo', 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 == 37 || event.keyCode == 39 || event.keyCode == 46) {

            } else {
                event.preventDefault();
            }
        });
    </script>
</html>
<% 	} catch (Exception e) {
               
            }
%>

