<%@ page title="" language="C#" masterpagefile="~/MasterPages/Main.master" autoeventwireup="true" inherits="Business_DailySettlement, App_Web_dailysettlement.aspx.36edc644" 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;
        }
    </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>
                            MADA 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%">
                            </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" />
                            </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>
                                            MADA 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">
                                                MADA ATM - POS - ECOM  Recon. Summary
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                ECOM Debit
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                ECOM Credit
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                POS Debit
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                POS Credit
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                ATM Debit
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                                ATM 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%">
                                            MADA (A2FTRPT1 Report - A
                                        </td>
                                         <td align="center" valign="middle" class="style2">
                                            <asp:Label ID="lbl_debitECOM_BankAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td align="center" valign="middle" class="style2">
                                            <asp:Label ID="lbl_creditECOM_BankAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>

                                        <td align="center" valign="middle" class="style2">
                                            <asp:Label ID="lbl_debitPOS_BankAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td align="center" valign="middle" class="style2">
                                            <asp:Label ID="lbl_creditPOS_BankAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td align="center" valign="middle" class="style2">
                                            <asp:Label ID="lbl_debitATM_BankAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" class="style2">
                                            <asp:Label ID="lbl_creditATM_BankAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" class="style2">
                                            <asp:Label ID="lbl_BankTotal" runat="server" class="fieldNormal"></asp:Label>
                                        </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="lbl_debitECOM_SamaAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_creditECOM_SamaAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>

                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_debitPOS_SamaAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_creditPOS_SamaAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_debitATM_SamaAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_creditATM_SamaAmount" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_SpanTotal" runat="server" class="fieldNormal"></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="lbl_debitECOM_diff" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_creditECOM_diff" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_debitPOS_diff" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_creditPOS_diff" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_debitATM_diff" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_creditATM_diff" runat="server" class="fieldNormal" oncopy="event.KeyCode=0;"></asp:Label>
                                        </td>
                                         <td valign="middle" align="center" style="width: 15%">
                                                <asp:Label ID="lbl_NetDiffTotal" runat="server" class="fieldNormal"></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>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_CreditPos_Rvslamt" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_debitATM_Rvslamt" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_creditATM_Rvslamt" runat="server" class="fieldNormal"></asp:Label>
                                        </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="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_CreditPos_Unmtch" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_DebitATM_Unmtch" runat="server" class="fieldNormal"></asp:Label>
                                        </td>
                                        <td valign="middle" align="center" style="width: 15%">
                                            <asp:Label ID="lbl_CreditATM_Unmtch" runat="server" class="fieldNormal"></asp:Label>
                                        </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="fieldNormal"></asp:Label>
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%">
                                                <asp:Label ID="lbl_creditPOS_difference" runat="server" class="fieldNormal"></asp:Label>
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%">
                                                <asp:Label ID="lbl_debitATM_difference" runat="server" class="fieldNormal"></asp:Label>
                                            </td>
                                            <td valign="middle" align="center" style="width: 15%">
                                                <asp:Label ID="lbl_creditATM_difference" runat="server" class="fieldNormal" oncopy="event.KeyCode=0;"></asp:Label>
                                            </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>
                <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">
                                MADA Tlf Files Total
                            </td>
                              <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                ECOM Debit
                            </td>
                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                ECOM Credit
                            </td>
                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                POS Debit
                            </td>
                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                POS Credit
                            </td>
                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                ATM Debit
                            </td>
                            <td valign="middle" align="center" style="width: 15%; font-weight: bold">
                                ATM 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="fieldNormal"></asp:Label>
                        </td>
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLF05" runat="server" class="fieldNormal"></asp:Label>
                        </td>
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLF04" runat="server" class="fieldNormal"></asp:Label>
                        </td>
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLF03" runat="server" class="fieldNormal"></asp:Label>
                        </td>
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLF02" runat="server" class="fieldNormal"></asp:Label>
                        </td>
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLF01" runat="server" class="fieldNormal" oncopy="event.KeyCode=0;"></asp:Label>
                        </td>
                        <td valign="middle" align="center" style="width: 15%">
                            <asp:Label ID="LabelTLFTotal" runat="server" class="fieldNormal" 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>
                            MADA 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 class="tdNormal" colspan="5">
                                <asp:GridView ID="GridView1" CssClass="gridMaster" Width="100%" runat="server" AutoGenerateColumns="False"
                                    DataKeyNames="Event_Name" AllowPaging="false" AllowSorting="True" ShowFooter="true"
                                    CellPadding="4" ForeColor="#333333" GridLines="None" OnRowCreated="GridView1_RowCreated"
                                    EmptyDataText="There are no Results">
                                    <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="From Account" />
                                        <asp:BoundField DataField="To_Account" HeaderText="To Account" />
                                        <asp:BoundField DataField="DbAmt" HeaderText="Debit" DataFormatString="{0:n}" />
                                        <asp:BoundField DataField="CRAmt" HeaderText="Credit" DataFormatString="{0:n}" />
                                        <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>
</asp:Content>
