<%@ page title="" language="C#" masterpagefile="~/MasterPages/Main.master" autoeventwireup="true" inherits="Business_DailySettlementGCC, App_Web_gcmbqb3f" viewStateEncryptionMode="Always" maintainScrollPositionOnPostBack="true" %>

<%@ Register Src="../UserControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script language="javascript" type="text/javascript">
        function noCopyMouse(e) {
            var isRight = (e.button) ? (e.button == 2) : (e.which == 3);
            if (isRight) {
                alert("Not Allowed to copy");
                return false;
            }
            return true;
        }

        function noCopyKey(e) {
            var forbiddenKeys = new Array('c', 'x', 'v');
            var keyCode = (e.keyCode) ? e.keyCode : e.which;
            var isCtrl;

            if (window.event)
                isCtrl = e.ctrlKey;
            else
                isCtrl = (window.Event) ? ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK) : false;

            if (isCtrl) {
                for (i = 0; i < forbiddenKeys.length; i++) {
                    if (forbiddenkeys[i] == String.fromCharCode(keyCode).toLowerCase()) {
                        alert("Not Allowed to Copy");
                        return false;
                    }
                }
            }
            return true;
        }

        function validateDate() {
            var message = "";
            if (document.getElementById("<%=dtp_filter_sttlDate.TextBoxClientID%>").value == "") {
                message += "You have to at enter the transaction date\n";
            }
            if (message.length > 0) {
                message = "please notice the following requirments:\n\n" + message;
                alert(message);
                return false;
            }
            return true;
        }

    </script>
    <style type="text/css">
        .style2
        {
            width: 15%;
            height: 20px;
        }
    


/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  padding-top: 100px; /* Location of the box */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content */
.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
}

/* The Close Button */
.close {
  color: #aaaaaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="body_MainTB" border="0" cellpadding="0" cellspacing="0">
        <tr align="center">
            <td valign="top">
                <!------------------------------------body St  ---------------------------------------------->
                <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                    <tr>
                        <td>
                            GCC Daily Settlement
                        </td>
                    </tr>
                </table>
                <br />
                <!------------------------------------body End1 ----------------------------------------------->
                <asp:Label ID="lbl_error" runat="server" Text="" class="fieldError"></asp:Label>
                <asp:Panel ID="pnl_searchCriteria" runat="server" Width="100%">
                    <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB1" style="width: 100%">
                        <tr>
                            <td class="tdNormal" style="width: 15%">
                                Settlement Date:
                            </td>
                            <td class="tdNormal" style="width: 30%">
                                <uc1:DatePicker ID="dtp_filter_sttlDate" runat="server" />
                            </td>
                            <td class="tdNormal" style="width: 10%">
                                <asp:Label ID="lbl_File_Number" runat="server" class="fieldNormal" Text="" Visible="false"></asp:Label>
                                <asp:Label ID="lbl_Status" runat="server" class="fieldNormal" Text="" Visible="false"></asp:Label>
                            </td>
                            <td class="tdNormal" style="width: 15%">
                                <asp:RadioButton ID="rdATM" runat="server" class="fieldNormal" Checked="True" GroupName="group" Text="ATM" />
                                <asp:RadioButton ID="rdPOS" runat="server" class="fieldNormal" Checked="False" GroupName="group" Text="POS" />
                            </td>
                            <td class="tdNormal" style="width: 30%">
                            </td>
                        </tr>
                        <tr>
                            <td class="tdNormal" style="width: 15%">
                            </td>
                            <td class="tdNormal" style="width: 30%">
                                <asp:Button ID="btn_search" runat="server" Text="   Search   " class="Btn_M_Normal"
                                    OnClientClick="return validateDate()" OnClick="btn_search_Click" />
                                <asp:Button ID="btnGenReport" runat="server" Text="Summary Report" CssClass="Btn_L_Normal1"
                                    OnClientClick="" OnClick="btnGenReport_Click" Width="128px" />
                                <asp:Button ID="Button1" runat="server" Text="Claim Report" CssClass="Btn_L_Normal1"
                                    OnClientClick="" OnClick="btnClaimReport_Click" Width="128px" Visible=false />
                                    


                                    
                            </td>
                            <td class="tdNormal" style="width: 10%">
                            </td>
                            <td class="tdNormal" style="width: 15%">
                            </td>
                            <td class="tdNormal" style="width: 30%">
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="pnl_result" runat="server" Width="100%">
                    <table dir="ltr" width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <table border="0" cellpadding="0" cellspacing="0" class="grid_TitleBG_B">
                                    <tr>
                                        <td>
                                            GCC Settlement
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table dir="ltr" border="0" cellpadding="0" cellspacing="0" class="add_ItemTB1" style="width: 100%">
                                    <thead>
                                        <tr>
                                            <td valign="middle" align="left" style="width: 15%; font-weight: bold">
                                                GCC ATM - POS  Recon. Summary
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                Debit
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                Credit
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                NET Total
                                            </td>
                                        </tr>
                                    </thead>
                                    <tr>
                                        <td valign="middle" align="left" style="width: 15%">
                                            GCC (A2FTRPT1 Report - A
                                        </td>
                                         <td align="center" valign="middle" class="style2">
                                            <asp:Label ID="lblgccpdfdebit" runat="server" class=""></asp:Label>
                                            
                                        </td>
                                        <td align="center" valign="middle" class="style2">
                                            <asp:Label ID="lblgccpdfcredit" runat="server" class=""></asp:Label>
                                            
                                        </td>

                                        <td valign="middle" align="center" class="style2">
                                            <asp:Label ID="lblgccpdftotal" runat="server" class=""></asp:Label>
                                            
                                                 <button id="myBtn" type="button" style="background:url(../Images/document_view.jpg) no-repeat 5px center; padding:20px 5px 5px 27px; border:0px;"></button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="middle" class="style2">
                                            SAIB (Switch Settlement Report) - B
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lblgccbankdebit" runat="server" class=""></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lblgccbankcredit" runat="server" class=""></asp:Label>
                                        </td>

                                      
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lblgccbanktotal" runat="server" class=""></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="middle" align="left" style="width: 15%">
                                            Differences ( A - B )
                                        </td>
                                         <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbldebitdiff" runat="server" class=""></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lblcreditdiff" runat="server" class=""></asp:Label>
                                        </td>
                                       
                                         <td valign="middle" align="center" style="width: 15%">
                                                <asp:Label ID="lblnetdiff" runat="server" class=""></asp:Label>
                                            </td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="middle" class="style2">
                                        </td>
                                    </tr>
                                    <tr style="display: none;">
                                        <td align="left" valign="middle" class="style2">
                                            Issuer (Reversal Difference)
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_debitPos_Rvslamt" runat="server" class="fieldNormal"></asp:Label>
                                            <asp:ImageButton id="imagebutton7" runat="server" AlternateText="View breakdown" ImageUrl="~/Images/document_view.jpg"/>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_CreditPos_Rvslamt" runat="server" class="fieldNormal"></asp:Label>
                                            <asp:ImageButton id="imagebutton8" runat="server" AlternateText="View breakdown" ImageUrl="~/Images/document_view.jpg"/>
                                        </td>
                                        
                                        <td>
                                        </td>
                                    </tr>
                                     <tr style="display: none;">
                                        <td align="left" valign="middle" class="style2">
                                            UnMatched (Txn in Switch Not in MADA)
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_DebitPos_Unmtch" runat="server" class=""></asp:Label>
                                            <asp:ImageButton id="imagebutton9" runat="server" AlternateText="View breakdown" ImageUrl="~/Images/document_view.jpg"/>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_CreditPos_Unmtch" runat="server" class=""></asp:Label>
                                            <asp:ImageButton id="imagebutton10" runat="server" AlternateText="View breakdown" ImageUrl="~/Images/document_view.jpg"/>
                                        </td>
                                       <td>
                                        </td>
                                    </tr>
                                    <tfoot>
                                            <tr style="display: none;">
                                            <td valign="middle" align="left" style="width: 15%">
                                                Overall Differences
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%">
                                                <asp:Label ID="lbl_debitPOS_difference" runat="server" class=""></asp:Label>
                                                <asp:ImageButton id="imagebutton11" runat="server" AlternateText="View breakdown" ImageUrl="~/Images/document_view.jpg"/>
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%">
                                                <asp:Label ID="lbl_creditPOS_difference" runat="server" class=""></asp:Label>
                                                <asp:ImageButton id="imagebutton12" runat="server" AlternateText="View breakdown" ImageUrl="~/Images/document_view.jpg"/>
                                            </td>
                                            <td>
                                        </td>
                                           
                                        </tr>
                                        <caption>
                                        </caption>
                                    </tfoot>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                        <tr>
                            <td>
                                <asp:Button ID="btn_print" runat="server" Text="  Print  " class="Btn_M_Normal" OnClick="btn_print_Click" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr><td>
       
                <!-- The Modal -->
<div id="myModal" class="modal">

  <!-- Modal content -->
  <div class="modal-content">
    <span class="close">&times;</span>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                        <tr>
                            <td class="tdNormal" colspan="5">
                                <asp:GridView ID="GridView2" CssClass="gridMaster" Width="100%" runat="server" AutoGenerateColumns="False"
                                    DataKeyNames="" AllowPaging="false" AllowSorting="True" ShowFooter="true"
                                    CellPadding="4" ForeColor="#333333" GridLines="None" 
                                    EmptyDataText="There are no Results">
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                    <Columns>
                                        <asp:BoundField DataField="GCCCntry" HeaderText="Country" />
                                        <asp:BoundField DataField="Acquirer" HeaderText="Acquirer" />
                                        <asp:BoundField DataField="Issuer" HeaderText="Issuer" />
                                        <asp:BoundField DataField="Net_Total" HeaderText="Net_Total" />
                                    </Columns>
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                    <EditRowStyle BackColor="#999999" />
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" HorizontalAlign="Right" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <caption>
                            &nbsp;</caption>
                    </table>
  </div>

</div>
                </td></tr>
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" class="grid_TitleBG_B">
                    <tr>
                        <td>
                            TLF Files Total
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr id="tlfFilesArea" runat="server">
            <td>
                <table  dir="ltr" border="0" cellpadding="0" cellspacing="0" class="add_ItemTB1" style="width: 100%">
                    <thead>
                        <tr>
                            <td valign="middle" align="left" style="width: 15%; font-weight: bold">
                                GCC Tlf Files Total
                            </td>
                              <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                 Debit
                            </td>
                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                 Credit
                            </td>
                           
                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                NET Total
                            </td>
                        </tr>
                    </thead>
                    <tr>
                        <td valign="middle" align="left" style="width: 15%">
                            Total</td>
                              <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLF06" runat="server" class=""></asp:Label>
                        </td>
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLF05" runat="server" class=""></asp:Label>
                        </td>
                       
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLFTotal" runat="server" class="" oncopy="event.KeyCode=0;"></asp:Label>
                        </td>
                    </tr>
               
                    <tfoot>
                        <tr>
                            <td valign="middle" align="left" style="width: 15%">
                              
                            </td>
                            <td valign="middle" align="center" style="width: 15%">
                              
                            </td>
                            <td valign="middle" align="center" style="width: 15%">
                                
                            </td>
                            <td valign="middle" align="center" style="width: 15%">
                                &nbsp;</td>
                            <td valign="middle" align="center" style="width: 15%">
                                &nbsp;</td>
                            <td valign="middle" align="center" style="width: 15%">
                                &nbsp;</td>
                        </tr>
                        <caption>
                        </caption>
                    </tfoot>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" class="grid_TitleBG_B">
                    <tr>
                        <td>
                            GCC Ticket Entry
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                <asp:Panel ID="pnlResult_TicketEntry" runat="server" Width="100%" Visible="false">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                        <tr>
                        <td>Records:</td></tr>
                        <tr>
                            <td class="tdNormal" colspan="5">
                                <asp:GridView ID="GridView1" runat="server" AllowPaging="false" 
                                    AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                    CssClass="gridMaster" DataKeyNames="Event_Name" 
                                    EmptyDataText="There are no Results" ForeColor="#333333" GridLines="None" 
                                    OnRowCreated="GridView1_RowCreated" ShowFooter="true" Width="100%">
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                    <Columns>
                                        <asp:BoundField DataField="Event_Name" HeaderText="Account Name" />
                                        <asp:BoundField DataField="From_Account" HeaderText="Dr. Account" />
                                        <asp:BoundField DataField="To_Account" HeaderText="Cr. Account" />
                                        <asp:BoundField DataField="Amount" DataFormatString="{0:n}" 
                                            HeaderText="Amount" />
                                        <asp:BoundField DataField="AMOUNT_SIGN" HeaderText="Db / Cr" />
                                        <asp:BoundField DataField="Narrative" HeaderText="Narrative" />
                                        <asp:BoundField DataField="CS_GL_Desc" HeaderText="Status" />
                                        <asp:BoundField DataField="CS_GL_Code" HeaderText="" />
                                        <asp:BoundField DataField="file_number" HeaderText="file_number" 
                                            Visible="True" />
                                    </Columns>
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                    <EditRowStyle BackColor="#999999" />
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" 
                                        HorizontalAlign="Right" />
                                </asp:GridView>
                            </td>
                        <tr>
                            <td>
                                VAT:</td>
                        </tr>
                        <tr>
                            <td class="tdNormal" colspan="5">
                                <asp:GridView ID="GridView3" runat="server" AllowPaging="false" 
                                    AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                    CssClass="gridMaster" DataKeyNames="Event_Name" 
                                    EmptyDataText="There are no Results" ForeColor="#333333" GridLines="None" 
                                    OnRowCreated="GridView1_RowCreated" ShowFooter="true" Width="100%">
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                    <Columns>
                                        <asp:BoundField DataField="Event_Name" HeaderText="Account Name" />
                                        <asp:BoundField DataField="From_Account" HeaderText="Dr. Account" />
                                        <asp:BoundField DataField="To_Account" HeaderText="Cr. Account" />
                                        <asp:BoundField DataField="Amount" DataFormatString="{0:n}" 
                                            HeaderText="Amount" />
                                        <asp:BoundField DataField="AMOUNT_SIGN" HeaderText="Db / Cr" />
                                        <asp:BoundField DataField="Narrative" HeaderText="Narrative" />
                                        <asp:BoundField DataField="CS_GL_Desc" HeaderText="Status" />
                                        <asp:BoundField DataField="CS_GL_Code" HeaderText="" />
                                        <asp:BoundField DataField="file_number" HeaderText="file_number" 
                                            Visible="True" />
                                    </Columns>
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                    <EditRowStyle BackColor="#999999" />
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" 
                                        HorizontalAlign="Right" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <caption>
                            &nbsp;</caption>
                    </table>
                    <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                        <tr>
                            <td class="tdNormal" style="width: 45%">
                            </td>
                            <td class="tdNormal" style="width: 10%">
                                Difference(CR-DB):
                            </td>
                            <td class="tdNormal">
                                <asp:Label ID="lbl_CR_DR_Diff" runat="server" Text="" class="fieldError"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left">
                                <% if (GridView1.Rows.Count >= 1)
                                   { %>
                                <% if (lbl_Status.Text == "000" || lbl_Status.Text == "008")
                                   { %>
                                <asp:Button ID="bttn_Approval" runat="server" Text="Submit for Approval" CssClass="Btn_L_Normal1"
                                    OnClick="ButtonSubmitForApproval_Click" Width="111px" OnClientClick="return SaveConfirmation('Are you sure to send all the entries for approval')" />
                                <%} %>
                                <% if (lbl_Status.Text == "001")
                                   { %>
                                <asp:Button ID="bttn_CreateGL" runat="server" Text="Approve" CssClass="Btn_L_Normal"
                                    OnClick="bttn_ApproveAndCreateGL" OnClientClick="return SaveConfirmation('Are you sure to process the GL')" />
                                <asp:Button ID="bttn_Reject" runat="server" Text="Reject" CssClass="Btn_L_Normal1"
                                    OnClick="ButtonRejectForApproval_Click" Width="111px" OnClientClick="return SaveConfirmation('Are you sure to cancel all the entries')" />
                                <%} %>
                                <%} %>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <br />
                <asp:Label ID="Lbl_MannualDif" runat="server" Text="" class="fieldError"></asp:Label>
                <br />
                <br />
            </td>
        </tr>
    </table>
    <script>
        // Get the modal
        var modal = document.getElementById("myModal");

        // Get the button that opens the modal
        //var btn = document.getElementById("ctl00$ContentPlaceHolder1$imagebutton1");
        var btn = document.getElementById("myBtn");
        
        // Get the <span> element that closes the modal
        var span = document.getElementsByClassName("close")[0];

        // When the user clicks the button, open the modal
        btn.onclick = function () {
            modal.style.display = "block";
            //return false;
        }

        // When the user clicks on <span> (x), close the modal
        span.onclick = function () {
            modal.style.display = "none";
        }

        // When the user clicks anywhere outside of the modal, close it
        window.onclick = function (event) {
            if (event.target == modal) {
                modal.style.display = "none";
            }
        }
</script>
</asp:Content>
