<%@ page language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_FeeManagement_PostDatedPayment, App_Web_qjwkbn0d" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="Date" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="DPC" %>
<%@ Register Src="~/UserControls/Common/StudentSearch/StudentSearch.ascx" TagName="StudentSearch" TagPrefix="Std" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <style type="text/css">
        .table-responsive.pdctable {
            display: block;
            width: 100%;
            overflow-x: auto;
            overflow-y: auto;
        }
        .fixed_height thead,
        .fixed_height tbody tr {
            display: table;
            width: 100%;
            table-layout: fixed;
        }
    </style>
    <asp:UpdatePanel ID="IncidentLogUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <Std:StudentSearch ID="StudentSearch" Visible="false" runat="server" />
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="104"
                                Visible="true" runat="server" />
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader5WireBox card card-box" id="SearchDiv" runat="server">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="Panel1" runat="server">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="SearchHeaderLabel" runat="server" Text="Search"></asp:Label>
                                        </header>
                                    </div>
                                </div>
                                <div class="fRight mt-27 pagination">
                                    <asp:Button ID="AddNewButtonID" runat="server" OnClick="AddNewButton_Click" Text="&#xf067; Add" SkinID="0" CssClass="btn btn-add fas" />
                                </div>
                            </asp:Panel>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="SearchCriteriaPanel" runat="Server">
                                <div class="contentHolder">
                                    <asp:Panel ID="SearchPanel" runat="Server">
                                        <div class="contentHolder">
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OrganizationGroupBatchLabel" runat="server" Text="Group Batch" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="OrganizationGroupBatchDropDownList" SkinID="CustomWidthDropDownList"
                                                        AutoPostBack="true" class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        OnSelectedIndexChanged="OrganizationGroupBatchDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                    <asp:HiddenField runat="server" ID="ButtonIdHiddenField" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OrganizationLabel" Text="Organization" runat="server"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList ID="OrganizationDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                                        onmouseenter="showHideTooltip()" AutoPostBack="true" SkinID="CustomWidthDropDownList"
                                                        class="form-control" OnSelectedIndexChanged="OrganizationDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="BatchLable" Text="Batch" runat="server"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList ID="BatchDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                                        onmouseenter="showHideTooltip()" SkinID="CustomWidthDropDownList" class="form-control"
                                                        AutoPostBack="true" OnSelectedIndexChanged="BatchDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="AdmissionCategoryLabel" runat="server" Text="Fees Category"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="AdmissionCategoryDropDownList" SkinID="CustomWidthDropDownList"
                                                        onmouseleave="showHideTooltip()" class="form-control" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="IdNoLabel" runat="server" Text="ID No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="IdNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200" AutoPostBack="false">
                                                    </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="DepartmentLabel" runat="server" Text="Department"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="DepartmentDropDownList" SkinID="CustomWidthDropDownList"
                                                        AutoPostBack="true" onmouseleave="showHideTooltip()" class="form-control" onmouseenter="showHideTooltip()"
                                                        OnSelectedIndexChanged="DepartmentDropDownList_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ClassLabel" runat="server" Text="Class"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="ClassDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        AutoPostBack="true" OnSelectedIndexChanged="ClassDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="DivisionLabel" runat="server" Text="Division"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="DivisionDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ReceiptBookLabel" runat="server" Text="Receipt Book" meta:resourcekey="ReceiptBookLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="ReceiptBookDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        AutoPostBack="true" OnSelectedIndexChanged="ReceiptBookDropDownList_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="CollectionGroupLabel" runat="server" Text="Collection Group"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="CollectionGroupDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="PayTypeLabel" runat="server" Text="Pay Type" meta:resourcekey="PayTypeLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="SearchPayTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="StatusLabel" runat="server" Text="Status" meta:resourcekey="StatusLabelResource"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="StatusDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FirstNameLabel" runat="server" Text="First Name"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="FirstNameTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"> </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FromReceiptNoLabel" runat="server" Text="From Receipt No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="FromReceiptNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ToReceiptNoLabel" runat="server" Text="To Receipt No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="ToReceiptNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"> </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ChequeNoLabel" runat="server" Text="Cheque / Reference No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="ChequeNoTextBox" SkinID="CustomWidthTextBox" runat="server"
                                                        MaxLength="20">
                                                    </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FromPaymentClearanceDateLabel" runat="server" Text="From Payment Clearance Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="true" ID="FromPaymentClearanceDatePickerControl" Visible="True" runat="server" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ToPaymentClearanceDateLabel" runat="server" Text="To Payment Clearance Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="True" ID="ToPaymentClearanceDatePickerControl" Visible="True" runat="server" />
                                                </div>
                                            </div>
                                            <%--Added for mantis : 35660 by Nilesh--%>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FromCreatedDateLabel" runat="server" Text="From Created Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="true" ID="FromCreatedDateDatePickerControl" Visible="True" runat="server" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ToCreatedDateLabel" runat="server" Text="To Created Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="True" ID="ToCreatedDateDatePickerControl" Visible="True" runat="server" />
                                                </div>
                                            </div>
                                            <div class="alignCenter col-md-12 pTop15 pb5">
                                                <asp:Button ID="SearchButton" runat="server" OnClick="SearchButton_Click" Text="&#xf002; Search" SkinID="0" CssClass="btn-search btn fas" />
                                                <asp:Button ID="ExportButton" runat="server" Text="&#xf093; Export" OnClick="ExportButton_Click" SkinID="0" CssClass="btn-examcommon btn fas" />
                                                <asp:Button ID="ResetButton" runat="server" OnClick="ClearSearch_Click" Text="&#xf0e2; Reset" SkinID="0" CssClass="btn-reset btn fas" />
                                                <asp:Button ID="SaveDataButton" runat="server" OnClick="SaveDataButton_Click" Text="&#xf0c7; Save" SkinID="0" CssClass="btn btn-save fas" />
                                            </div>
                                        </div>
                                    </asp:Panel>
                                    <div id="ApplyDiv" runat="server" visible="false" class="himsBoxTitle">
                                        <div class="fRight display-flex col-md-4">
                                            <asp:DropDownList ID="ApplyDropDownList" runat="server" SkinID="CustomWidthDropDownList" CssClass="form-control mt-10">
                                                <asp:ListItem Text="- Select -" Value="-1" Selected="True"></asp:ListItem>
                                                <asp:ListItem Text="Deposited Date" Value="1"></asp:ListItem>
                                                <asp:ListItem Text="Receipt Date" Value="2"></asp:ListItem>
                                            </asp:DropDownList>
                                            &nbsp;&nbsp;&nbsp;
                                        <asp:TextBox ID="ApplyAllTextBox" onkeyup="FormatIt(this);" runat="server" ClientIDMode="Static" MaxLength="10" SkinID="CustomWidthTextBox" Width="120px" class="pTop5"></asp:TextBox>
                                            &nbsp;&nbsp;&nbsp;  
                                             <asp:Button ID="ApplyAllButton" runat="server" OnClick="ApplyAllButton_Click" Text="Apply All" SkinID="0" CssClass="btn btn-apply fas mt-10" />
                                            <%-- <input type="button" runat="server" name="ApplyAllButton" value="Apply All" id="ApplyAllButton" class="btn btn-apply fas mt-10" />--%>
                                        </div>
                                    </div>
                                    <div class="cBoth">
                                    </div>
                                    <div id="Div5" class="himssuHeader7WireBox col-md-12" runat="server">
                                        <div id="ReceiptDetailDiv" visible="false" runat="server">
                                            <div class="himsBoxHeader" id="Div2" runat="server" visible="false">
                                                <div class="himsBoxTitle">
                                                    <div class="gridHeaderText">
                                                        <asp:Label ID="GridHeaderLabel" Text="" runat="server" />
                                                    </div>
                                                    <div class="col-md-12 padd-0">
                                                        <div class="col-md-5">
                                                            <div class="col-md-3 padd-0">
                                                                <asp:Label ID="RecordsPerPage" Text="Records per Page : " runat="server" />
                                                            </div>
                                                            <div class="col-md-3 padd-0">
                                                                <asp:DropDownList ID="AddRowsToGridDropDownList" SkinID="CustomWidthDropDownList" Width="60px" runat="server"
                                                                    AutoPostBack="true" OnSelectedIndexChanged="AddRowsToGridDropDownList_SelectedIndexChanged" class="form-control">
                                                                    <asp:ListItem Text="10" Value="10" Selected="True"></asp:ListItem>
                                                                    <asp:ListItem Text="20" Value="20"></asp:ListItem>
                                                                    <asp:ListItem Text="50" Value="50"></asp:ListItem>
                                                                    <asp:ListItem Text="100" Value="100"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-7">
                                                            <uc1:GridViewPager ID="PostDatedPaymentListGridView_GridViewPager" runat="server" OnFirstRecordClick="PostDatedPaymentListGridView_GridViewPager_FirstRecordClick"
                                                                OnLastRecordClick="PostDatedPaymentListGridView_GridViewPager_LastRecordClick" OnNextRecordClick="PostDatedPaymentListGridView_GridViewPager_NextRecordClick"
                                                                OnPrevRecordClick="PostDatedPaymentListGridView_GridViewPager_PrevRecordClick" OnTextBoxValueChange="PostDatedPaymentListGridView_GridViewPager_TextBoxValueChange"
                                                                ParentGridView="PostDatedPaymentListGridView" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="himsBoxContent pTop5">
                                                <asp:UpdatePanel ID="MenuPlanDetailUpdatePanel" runat="server" UpdateMode="Always">
                                                    <ContentTemplate>
                                                        <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server" visible="False">
                                                        </div>
                                                        <div id="Div3" runat="server" visible="true">
                                                            <asp:GridView ID="PostDatedPaymentListGridView" runat="server" AutoGenerateColumns="False"
                                                                EmptyDataText="No Records Found !!" SkinID="" ShowHeader="True" PagerSettings-Visible="false"
                                                                DataKeyNames="Id,OrgId,BatchId,ReceiptId,SourceId,SourceTypeId,ReceiptBookId,IdNo,StatusId,ReceiptAmount,PDCEntryUserName"
                                                                OnRowDataBound="PostDatedPaymentListGridView_RowDataBound"
                                                                CssClass="table table-striped table-bordered table-hover">
                                                                <Columns>
                                                                    <%--<asp:BoundField DataField="Organization" HeaderText="Organization" ItemStyle-Width="125px" HeaderStyle-Width="125px"
                                                                        HeaderStyle-HorizontalAlign="Left"></asp:BoundField>--%>
                                                                    <%--Mantis Id : 0036351	--%>
                                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderText="Organization">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="OrganizationLinkButton" runat="server" CommandName="Select" Text='<%#Bind("Organization") %>'
                                                                                CausesValidation="false" OnClick="OrganizationLinkButton_Click" ></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="Batch" HeaderText="Batch" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderStyle-Width="100px"></asp:BoundField>
                                                                    <%-- <asp:TemplateField HeaderText="ID No" ItemStyle-Width="8%">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="IDNoCodeLabel" runat="server" Text='<%#Eval("IdNo") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>--%>
                                                                    <asp:BoundField DataField="ClassDivision" HeaderText="Class" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderStyle-Width="100px"></asp:BoundField>
                                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderText="ID No">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="IDNoCodeLinkButton" runat="server" CommandName="Select" Text='<%#Eval("IdNo") %>'
                                                                                CausesValidation="false" OnClick="IDNoCodeLinkButton_Click"></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="StudentName" HeaderText="Name" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="120px" HeaderStyle-Width="120px"></asp:BoundField>
                                                                    <asp:BoundField DataField="ReceiptBook" HeaderText="Receipt Book" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderStyle-Width="100px"></asp:BoundField>
                                                                    <asp:BoundField DataField="PayType" HeaderText="Pay Type" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderStyle-Width="100px"></asp:BoundField>
                                                                    <asp:TemplateField HeaderText="Cheque Date" SortExpression="PaymentClearanceDate" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="PaymentClearanceDateLabel" CssClass="boxEllips"
                                                                                runat="server" Text='<%# Bind("PaymentClearanceDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="ChequeNo" HeaderText="Reference No" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                    <asp:BoundField DataField="BankName" HeaderText="Bank Name" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                    <asp:BoundField DataField="ReceiptAmount" HeaderText="Receipt Amount" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                    <%-- <asp:TemplateField HeaderText="Receipt Date" ItemStyle-Width="6%" SortExpression="ReceiptDate"
                                                                        ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="ReceiptDateLabel" CssClass="boxEllips" ToolTip='<%# Bind("ReceiptDate") %>'
                                                                                runat="server" Text='<%#Eval("ReceiptDate","{0:dd/MM/yyyy}") == "01/01/0001" || Eval("ReceiptDate","{0:dd/MM/yyyy}") == "01/01/1900" ? "" :Convert.ToString(Eval("ReceiptDate","{0:dd/MM/yyyy}")) %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>--%>
                                                                    <asp:TemplateField HeaderText="Deposited Date" ItemStyle-Width="100px" HeaderStyle-Width="100px">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="DepositedDatePickerControl" onkeyup="FormatIt(this);" runat="server" Width="100px" Text='<%# Bind("DepositedDate","{0:dd/MM/yyyy}") %>' />
                                                                        </ItemTemplate>
                                                                        <HeaderStyle HorizontalAlign="Left" />
                                                                        <ItemStyle Wrap="True" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Receipt Date / Payment Cancel Date" ItemStyle-Width="100px" HeaderStyle-Width="100px">
                                                                        <ItemTemplate>
                                                                            <%--<asp:TextBox ID="ReceiptDatePickerControl" onkeyup="FormatIt(this);" runat="server" Width="100px" Text='<%# Bind("PDPReceiptDate","{0:dd/MM/yyyy}") %>' />--%>
                                                                            <asp:TextBox ID="ReceiptDatePickerControl" onkeyup="FormatIt(this);" runat="server" Width="100px"
                                                                                Text='<%# Eval("StatusId").ToString() == "754" ? string.Format("{0:dd/MM/yyyy}", Eval("CancelDate")) : string.Format("{0:dd/MM/yyyy}", Eval("PDPReceiptDate")) %>' />
                                                                        </ItemTemplate>
                                                                        <HeaderStyle HorizontalAlign="Left" />
                                                                        <ItemStyle Wrap="True" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Created Date" SortExpression="CreatedDateTime" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderStyle-Width="100px">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="CreatedDateTimeLabel" CssClass="boxEllips" ToolTip='<%# Bind("CreatedDateTime") %>'
                                                                                runat="server" Text='<%#Eval("CreatedDateTime","{0:dd/MM/yyyy}") == "01/01/0001" || Eval("CreatedDateTime","{0:dd/MM/yyyy}") == "01/01/1900" ? "" :Convert.ToString(Eval("CreatedDateTime","{0:dd/MM/yyyy}")) %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <%--<asp:BoundField DataField="Remark" HeaderText="Remark" ItemStyle-Width="120px" HeaderStyle-Width="120px"
                                                                        HeaderStyle-HorizontalAlign="Left"></asp:BoundField>--%>
                                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderText="Remark">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="RemarkTextBox" runat="server" SkinID="CustomWidthTextBox" Text='<%#Bind("Remark") %>' ></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="StatusTitle" HeaderText="Status" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderText="Receipt">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="GenerateReceiptLinkButton" runat="server" CommandName="Select" Text="Generate"
                                                                                CausesValidation="false" OnClick="GenerateReceiptLinkButton_Click"></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                                                                        HeaderText="Payment">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="CancelLinkButton" runat="server" CommandName="Select" Text="Cancel"
                                                                                CausesValidation="false" OnClick="CancelLinkButton_Click"></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                                <PagerSettings Visible="False" />
                                                            </asp:GridView>
                                                        </div>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                    <div class="himssuHeader1WireBox card card-box" id="DetailDiv" runat="server" visible="false">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <i class="fas fa-tasks"></i>
                                        <asp:Label ID="AssignToLabel" runat="server" Text="Assign To"></asp:Label>
                                    </header>
                                </div>
                            </div>
                            <div class="fRight mt-27 display-flex pagination">
                                <div class="outerBox col-md">
                                    <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0"
                                        CssClass="btn btn-back fas" Text="&#xf30a; Back" />
                                    <asp:Button ID="BackToReceiptButton" runat="Server" OnClick="BackToReceiptButton_Click" SkinID="0"
                                        CssClass="btn btn-back fas" Text="&#xf30a; Back To Fee Receipt" Visible="false" />
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <div class="contentHolder col-md-12 col-xs-12">
                                <div class="tableContainer">
                                    <div class="contentHolder">
                                        <asp:HiddenField ID="IdHiddenField" runat="server" Value="0" />
                                        <asp:HiddenField ID="IndexHiddenField" runat="server" Value="0" />
                                        <div id="SUIdDiv" class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="SUIdLabel" runat="server" Text="SU Id"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:TextBox ID="SUIdTextBox" runat="server" SkinID="CustomWidthTextBox"
                                                    AutoPostBack="true" MaxLength="50" OnTextChanged="SUIdTextBox_TextChanged"></asp:TextBox>
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="OrganizationLabel1" Text="Organization" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:DropDownList ID="OrganizationDropDownList1" runat="server" onmouseleave="showHideTooltip()"
                                                    onmouseenter="showHideTooltip()" AutoPostBack="true" SkinID="CustomWidthDropDownList"
                                                    class="form-control" OnSelectedIndexChanged="OrganizationDropDownList1_OnSelectedIndexChanged">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="BatchLable1" Text="Batch" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:DropDownList ID="BatchDropDownList1" runat="server" onmouseleave="showHideTooltip()"
                                                    onmouseenter="showHideTooltip()" SkinID="CustomWidthDropDownList" class="form-control"
                                                    OnSelectedIndexChanged="BatchDropDownList1_SelectedIndexChanged" AutoPostBack="true">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div id="StudentAutoSearchDiv" runat="server" visible="false">
                                            <div class="outerBox pTop5 col-md-6 col-sm-4 col-xs-12">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="StudentAutoSearchLabel" runat="server" Text="Student Search"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="StudentAutoSearchTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" onkeyup="Search(this);" onclick="Search(this);"
                                                        SkinID="CustomWidthTextBox" runat="server" CssClass="studentautosearchitem"> </asp:TextBox>
                                                    <div id="AutoSearchSuggestion"></div>
                                                    <asp:HiddenField ID="SearchListHiddenField" runat="server" />
                                                </div>
                                            </div>
                                            <div class="cBoth"></div>
                                        </div>
                                        <asp:Panel ID="StudentSearchPanel" runat="server">
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="StudentIdNoLabel" runat="server" Text="Id No" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5 display-flex">
                                                    <asp:TextBox ID="StudentIdNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200" AutoPostBack="true"
                                                        OnTextChanged="StudentIdNoTextBox_TextChanged">
                                                    </asp:TextBox>
                                                    <asp:ImageButton SkinID="FindImage" ToolTip="Student Search" ID="StudentIdNoImageButton"
                                                        runat="server" ImageUrl="../../Images/icons/icon_find.gif" />
                                                    <br />
                                                    <br />
                                                    <br />
                                                    <asp:LinkButton ID="StudentAddGetImageButton" runat="server"
                                                        Visible="true" OnClick="AddStudentGetImageButton_Click">
                                                    <i class="fa fa-refresh" style="font-size:1.5em;padding-left:3px;color:black"></i>
                                                    </asp:LinkButton>
                                                    <%-- <asp:HiddenField ID="AcademicIdHiddenField" runat="server" />--%>
                                                    <asp:HiddenField ID="SourceIdHiddenField" runat="server" />
                                                    <asp:HiddenField ID="ClassIdHiddenField" runat="server" />
                                                    <asp:HiddenField ID="ReceiptIdHiddenField" runat="server" />
                                                    <asp:HiddenField ID="DeleteHiddenField" runat="server" />
                                                    <asp:HiddenField ID="RedirectHiddenField" runat="server" />
                                                    <asp:HiddenField ID="AdmissionCategoryHiddenField" runat="server" />

                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="StudentNameLabel" runat="server" Text="Name"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="StudentNameTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" Width="250px" runat="server" MaxLength="200"> </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="Label1" runat="server" Text="Class/Division/Roll No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="ClassTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"> </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="StudentStatusLabel" runat="server" Text="Student Status"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:Label ID="StatusNameLabel" runat="server"></asp:Label>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                </div>
                                <div class="himssuHeader6WireBox">
                                    <div id="StudentFeeReceiptDiv" runat="server" visible="true">
                                        <div class="himsBoxHeader pTop5" id="Div1" runat="server">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="card-head inner">
                                                    <div class="fLeft pRight5 headerText">
                                                        <header>
                                                            <asp:Label ID="GridViewLabel" Text="New and Pending Details" runat="server" />
                                                        </header>
                                                    </div>
                                                </div>
                                                <div class="pull-right col-md-6 display-flex pTop10">
                                                    <asp:DropDownList ID="ApplyAllDropDownlist" runat="server" Style="height: 25px !important" SkinID="CustomWidthDropDownList" CssClass="form-control" OnSelectedIndexChanged="ApplyAllDropDownlist_SelectedIndexChanged" AutoPostBack="true">
                                                        <asp:ListItem Text="-Select-" Value="-1"></asp:ListItem>
                                                        <asp:ListItem Text="Receipt Book" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="Pay Type" Value="2"></asp:ListItem>
                                                        <asp:ListItem Text="Cheque Date" Value="3"></asp:ListItem>
                                                        <asp:ListItem Text="Bank Name" Value="4"></asp:ListItem>
                                                        <asp:ListItem Text="Amount" Value="5"></asp:ListItem>
                                                        <asp:ListItem Text="Remark" Value="6"></asp:ListItem>
                                                    </asp:DropDownList>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                                     <asp:TextBox ID="ApplyAmountTextBox" runat="server" CssClass="pTop5" SkinID="CustomWidthTextBox" HeaderStyle-HorizontalAlign="right" onkeypress="javascript:return MaskDecimal(event,10,2)" onblur="javascript:return MaskDecimal(event,10,2)"> </asp:TextBox>
                                                    <asp:TextBox ID="ApplyTextBox" runat="server" CssClass="pTop5" SkinID="CustomWidthTextBox" HeaderStyle-HorizontalAlign="right" Visible="false"> </asp:TextBox>
                                                    <asp:TextBox ID="ApplyPaymentDateTextBox" CssClass="pTop5" runat="server" SkinID="CustomWidthTextBox" HeaderStyle-HorizontalAlign="right" Visible="false" onkeyup="FormatIt(this);"> </asp:TextBox>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                                    <asp:Button ID="ApplyButton" runat="server" SkinID="0" Text="&#xf058; Apply All" OnClick="ApplyButton_Click" CssClass="btn btn-apply fas" Style="height: 27px !important;" />
                                                    <asp:Button ID="AddButton" runat="server" SkinID="0" CssClass="btn btn-add fas" OnClick="AddButton_Click" Text="&#xf067; Add" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="himsBoxContent width-100 pTop5 table-responsive">
                                            <div id="Div6" runat="server" visible="true">
                                                <asp:GridView ID="PostDatedPaymentAddGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                    AllowPaging="false" PageSize="5" SkinID="" PagerSettings-Visible="false" EmptyDataText="No Records Found !!"
                                                    DataKeyNames="Id,ReceiptBookId,PayTypeId,StatusId" OnRowDataBound="PostDatedPaymentAddGridView_RowDataBound"
                                                    OnPageIndexChanging="PostDatedPaymentAddGridView_PageIndexChanging" CssClass="table table-striped table-bordered">
                                                    <Columns>
                                                        <asp:TemplateField ItemStyle-Width="15%" ShowHeader="true" HeaderText="Receipt Book" HeaderStyle-HorizontalAlign="Center">
                                                            <ItemTemplate>
                                                                <asp:DropDownList ID="ReceiptBookDropDownList" runat="server" class="form-control">
                                                                    <asp:ListItem Text="-Select-" Value="-1"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </ItemTemplate>
                                                            <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="15%" ShowHeader="true" HeaderText="Pay Type" HeaderStyle-HorizontalAlign="Center">
                                                            <ItemTemplate>
                                                                <asp:DropDownList ID="PaytypeDropDownList" runat="server" class="form-control">
                                                                    <asp:ListItem Text="-Select-" Value="-1"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </ItemTemplate>
                                                            <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="12%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"
                                                            HeaderText="Cheque Date">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="PaymentClearanceDateTextBox" Text='<%#Eval("PaymentClearanceDate","{0:dd/MM/yyyy}") == "01/01/0001" ? "" :Convert.ToString(Eval("PaymentClearanceDate","{0:dd/MM/yyyy}")) %>' runat="server" HeaderStyle-HorizontalAlign="Left" onkeyup="FormatIt(this);"></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="12%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"
                                                            HeaderText="Cheque No">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="ChequeNoTextBox" Text='<%#Eval("ChequeNo") %>' runat="server" HeaderStyle-HorizontalAlign="Left" MaxLength="20"></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="12%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"
                                                            HeaderText="Bank Name">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="BankNameTextBox" Text='<%#Eval("BankName") %>' runat="server" HeaderStyle-HorizontalAlign="Left" MaxLength="200"></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="12%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"
                                                            HeaderText="Amount">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="AmountTextBox" Text='<%#Eval("ReceiptAmount") %>' runat="server" HeaderStyle-HorizontalAlign="Left" onkeypress="javascript:return MaskDecimal(event,10,2)"
                                                                    onblur="javascript:return fnValidateDecimal(this,10,2)"> </asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"
                                                            HeaderText="Remark">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="RemarkTextBox" Text='<%#Eval("Remark") %>' runat="server" HeaderStyle-HorizontalAlign="Left" MaxLength="200"></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Status" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%" ItemStyle-Wrap="true">
                                                            <ItemTemplate>
                                                                <asp:Label ID="StatusLabel" runat="server" Text='<%#Eval("StatusTitle") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <%-- <asp:BoundField DataField="StatusTitle" HeaderText="Status" ItemStyle-Width="15%"
                                                            HeaderStyle-HorizontalAlign="Left"></asp:BoundField>--%>
                                                        <asp:TemplateField HeaderText="Delete" ItemStyle-Width="2%" HeaderStyle-HorizontalAlign="Center"
                                                            ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="DeleteImageButton" runat="server" OnClick="DeleteImageButton_Click"
                                                                    ToolTip="Delete" ImageUrl="~/Images/Del.png" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <%--MantisId : 0034663--%>
                                <div class="himssuHeader6WireBox">
                                    <div id="PendindandPaidAmountDiv" runat="server" visible="true">
                                        <div class="himsBoxHeader pTop5" id="Div7" runat="server">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="card-head inner">
                                                    <div class="fLeft pRight5 headerText">
                                                        <header>
                                                            <asp:Label ID="Label3" Text="Paid and Pending Amount Details" runat="server" />
                                                        </header>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-2">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="PaidAmountLabel" runat="server" Text="Total Paid amount"  CssClass="center"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-4">
                                        <div class="fLeft pRight5">
                                            <asp:TextBox ID="PaidAmountTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                SkinID="CustomWidthTextBox" Width="250px" runat="server" Enabled="false"> </asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-2">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="PendingAmountLabel" runat="server" Text="Total Pending Amount" CssClass="center"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-4">
                                        <div class="fLeft pRight5">
                                            <asp:TextBox ID="PendingAmountTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                SkinID="CustomWidthTextBox" Width="250px" runat="server" Enabled="false"> </asp:TextBox>
                                        </div>
                                    </div>

                                </div>

                                <div class="himssuHeader6WireBox">
                                    <div id="ClearedPaymentDetailsDiv" runat="server" visible="true">
                                        <div class="himsBoxHeader pTop5" id="Div8" runat="server">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="card-head inner">
                                                    <div class="fLeft pRight5 headerText">
                                                        <header>
                                                            <asp:Label ID="Label2" Text="Cleared Payment Details" runat="server" />
                                                        </header>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="himsBoxContent width-100 pTop5 table-responsive">
                                            <div id="Div9" runat="server" visible="true">
                                                <asp:GridView ID="ClearedPaymentDetailsGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                    AllowPaging="false" PageSize="5" SkinID="" PagerSettings-Visible="false" EmptyDataText="No Records Found !!"
                                                    DataKeyNames="Id,SourceId,SourceTypeId,OrgGroupBatchId,PayTypeId,ReceiptId,OrgId,BatchId" CssClass="table table-striped table-bordered">
                                                    <Columns>
                                                        <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"
                                                            HeaderText="">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="SelectReceiptLinkButton" runat="server" CommandName="Select" Text="Select"
                                                                    CausesValidation="false" OnClick="SelectReceiptLinkButton_Click"></asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="ReceiptNumber" HeaderText="Receipt Number" ItemStyle-Width="5%" HeaderStyle-HorizontalAlign="Left" />
                                                        <asp:TemplateField HeaderText="Receipt Date" ItemStyle-Width="6%" SortExpression="ReceiptDate"
                                                            ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="ReceiptDateLabel" CssClass="boxEllips" ToolTip='<%# Bind("ReceiptDate") %>'
                                                                    runat="server" Text='<%# Bind("ReceiptDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="ReceiptAmount" HeaderText="Receipt Amount" ItemStyle-Width="6%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="PayType" HeaderText="Pay Type" ItemStyle-Width="6%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ChequeNo" HeaderText="Reference No" ItemStyle-Width="8%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="BankName" HeaderText="Bank Name" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ReceiptBookTitle" HeaderText="Receipt Book" ItemStyle-Width="6%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:TemplateField HeaderText="Cheque Date" ItemStyle-Width="6%" SortExpression="PaymentDate"
                                                            ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="PaymentDateLabel" CssClass="boxEllips" runat="server" Text='<%# Bind("PaymentDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="Remark" HeaderText="Remark" ItemStyle-Width="15%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                    </Columns>
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="spacer">
                <img src="../../Images/spacer.gif" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/fee-invoice")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script type="text/javascript">

        //Mantis Start - 39122
        localStorage.pdctab = Date.now();
        var onLocalStorageEvent = function (e) {
            if (e.key == "pdctab") {
                localStorage.pdctab_available = Date.now();

            }
            if (e.key == "pdctab_available") {
                alert("One more page already open");
                window.location = '/Pages/Baseframework/MyDashBoard.aspx';
            }
        };
        window.addEventListener('storage', onLocalStorageEvent, false);
        //Mantis End - 39122

        function Search(obj) {
            if (obj.id == 'ctl00_CP_StudentAutoSearchTextBox') {
                var OrgId = $("#ctl00_CP_OrganizationDropDownList1").val();
                var BatchId = $("#ctl00_CP_BatchDropDownList1").val();
                if ($(obj).val().length > 1) {
                    $.ajax({
                        type: "POST",
                        url: "/Pages/FeeManagement/PostDatedPayment.aspx/SearchStudent",
                        data: '{"SearchValue":"' + $(obj).val() + '", "OrgId": "' + OrgId + '", "BatchId": "' + BatchId + '", "Flag": "' + $("#ctl00_CP_SearchListHiddenField").val() + '"}',
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            if ($("#ctl00_CP_SearchListHiddenField").val() == "true") {
                                if (data.d.includes("</li>")) {
                                    $("#ctl00_CP_SearchListHiddenField").val("false");
                                }
                            }
                            document.getElementById("AutoSearchSuggestion").hidden = false;
                            document.getElementById("AutoSearchSuggestion").innerHTML = data.d;
                        },
                        error: function (jqXHR, Status, errorMsg) {

                        }
                    });
                }
                else {
                    document.getElementById("AutoSearchSuggestion").hidden = true;
                }
            }
        }

        function selectStudent(val, IsEnter) {
            $("#ctl00_CP_StudentAutoSearchTextBox").val(val);
            var str = $("#ctl00_CP_StudentAutoSearchTextBox").val();
            if (!IsEnter)
                str = str.substring(0, str.length - 1);

            $("#ctl00_CP_StudentAutoSearchTextBox").val(str);
            $("#ctl00_CP_StudentIdNoTextBox").val(str.substring(str.lastIndexOf(' ') + 1));
            $("#ctl00_CP_StudentIdNoTextBox").trigger("change");
            document.getElementById("AutoSearchSuggestion").hidden = true;
        }

        function FormatIt(obj) {
            if (obj.value.length == 2)
                obj.value = obj.value + "/";
            if (obj.value.length == 5)
                obj.value = obj.value + "/";
        }
    </script>
</asp:Content>
