<%@ page language="C#" autoeventwireup="true" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" inherits="Pages_FeeManagement_FeePosting, App_Web_qez54o55" uiculture="auto" meta:resourcekey="PageResource1" enableEventValidation="false" viewStateEncryptionMode="Never" %>

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

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="OTQueueListingUpdatePanel" runat="server">
        <ContentTemplate>
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="104"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader1WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <asp:Label ID="ReasonMasterDetailLabel" runat="server" Text="Fee Posting"></asp:Label>
                                    </header>
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <div class="contentHolder">
                                <div class="cBoth">
                                </div>
                                <%--Changes for Mantis ID: 0036805--%>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="TypeLabel" Text="Account Posting" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:DropDownList ID="TypeDropDownList" runat="server" onmouseleave="showHideTooltip()" AutoPostBack="true"
                                            onmouseenter="showHideTooltip()" SkinID="CustomWidthDropDownList" class="form-control" OnSelectedIndexChanged="TypeDropDownList_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="FeeReceiptLabel" Text="Receipt Book" runat="server"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:DropDownList ID="FeeReceiptDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                            onmouseenter="showHideTooltip()" AutoPostBack="true" SkinID="CustomWidthDropDownList"
                                            class="form-control" OnSelectedIndexChanged="FeeReceiptDropDownList_OnSelectedIndexChanged">
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="ReceiptDateLabel" runat="server" Text="From Receipt Date" SkinID="MandatoryLabel"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <Date:DatePickerControl DisplayDatePicker="true" ID="ReceiptDatePickerControl" runat="server" />
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="ReceiptDateToLabel" runat="server" Text="To Receipt Date" SkinID="MandatoryLabel"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <Date:DatePickerControl DisplayDatePicker="true" ID="ReceiptDateToPickerControl" runat="server" />
                                    </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="PayTypeDropDownList" SkinID="CustomWidthDropDownList"
                                            CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3" id="OrganizationDiv" runat="server" visible="false">
                                    <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()" SkinID="CustomWidthDropDownList"
                                            class="form-control">
                                        </asp:DropDownList>
                                    </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="ResetButton" runat="server" OnClick="ResetButton_Click" Text="&#xf0e2; Reset" SkinID="0" CssClass="btn-reset btn fas" />
                                    <asp:Button ID="PostButton" Text="&#xf0ea; Post" runat="Server" SkinID="0" CssClass="btn-examcommon btn fas" OnClick="PostButton_Click" />
                                </div>
                                <div class="outerBox pTop5 col-md-3" style="height: 25px;">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="LabelTtlAmount" runat="server" Text="Total Amount :-" Visible="false"></asp:Label>
                                        <asp:Label ID="lblTotalAmount" runat="server" Text="" Visible="false"></asp:Label>
                                    </div>
                                </div>

                                <div id="FeePostingDiv" runat="server" visible="false" class="pTop5">

                                    <div class="himssuHeader6WireBox">

                                        <div class="himsBoxContent box-body box-solid gridviewfont">
                                            <div id="Div1" runat="server" visible="true" class="table-responsive">
                                                <asp:GridView ID="FeePostingGridView" runat="server"     Width="100%" AutoGenerateColumns="False"
                                                    EmptyDataText="No Records Found !!" AllowPaging="False" ShowHeader="True" ShowFooter="false" Visible="false"
                                                    DataKeyNames="CreditLedgerId,DebitLedgerId,PayTypeId,ISLocked,ReceiptNumber,ReceiptBookId,Name,Code,PayType" CssClass="table table-striped table-bordered table-hover" OnRowDataBound="FeePostingGridView_RowDataBound">  <%--Mantis - 37360--%>
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                                                            ItemStyle-Wrap="true">
                                                            <HeaderTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="HeaderSelectCheckBox" runat="server" Enabled="true" AutoPostBack="true"
                                                                        Visible="true" OnCheckedChanged="HeaderSelectCheckBox_checked" />
                                                                    <span></span>
                                                                </label>
                                                            </HeaderTemplate>
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <ItemTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="SelectCheckBox" runat="server" />
                                                                    <span></span>
                                                                </label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="AccountName" HeaderText="Account" ItemStyle-Width="20%" HeaderStyle-HorizontalAlign="Left" HtmlEncode="false"></asp:BoundField>
                                                        <asp:BoundField DataField="ReceiptDate" HeaderText="Date" DataFormatString="{0:d}" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="AccountingYearName" HeaderText="Accounting Year" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="CreditLedgerName" HeaderText="Credit Ledger" ItemStyle-Width="15%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="DebitLedgerName" HeaderText="Debit Ledger" ItemStyle-Width="15%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ReceiptAmount" HeaderText="Receipt Amount" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ChequeNo" HeaderText="ChequeNo" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ChequeDate" HeaderText="ChequeDate" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="BankName" HeaderText="BankName" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ChequeClearDate" HeaderText="ChequeClearDate" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:TemplateField HeaderText="Last Posting Date" ItemStyle-Width="6%" SortExpression="LastPostingDate" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LastPostingDateLabel" CssClass="boxEllips" runat="server" 
                                                                    Text='<%# (Eval("LastPostingDate") != DBNull.Value && Convert.ToDateTime(Eval("LastPostingDate")) != DateTime.Parse("1900-01-01")) 
                                                                            ? Convert.ToDateTime(Eval("LastPostingDate")).ToString("dd/MM/yyyy") : "" %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="ViewDetailLabel" SkinID="CustomWidthLabel" runat="server" Width="100%"
                                                                    Text="View Detail" OnClick="ViewDetailLinkButton_Click"></asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>

                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                                <%--Changes for Mantis ID: 0036805--%>
                                                <asp:GridView ID="FeeRefundGridView" runat="server" Width="100%" AutoGenerateColumns="False" EmptyDataText="No Records Found !!"
                                                    AllowPaging="False" ShowHeader="True" ShowFooter="false" DataKeyNames="CreditLedgerId,DebitLedgerId,PayTypeId,ISLocked,ReceiptNumber,ReceiptBookId,RefundId"
                                                    CssClass="table table-striped table-bordered table-hover" OnRowDataBound="FeeRefundGridView_RowDataBound" Visible="false">
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                                                            ItemStyle-Wrap="true">
                                                            <HeaderTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="HeaderSelectCheckBox" runat="server" Enabled="true" AutoPostBack="true"
                                                                        Visible="true" OnCheckedChanged="HeaderSelectCheckBox_CheckedChanged" />
                                                                    <span></span>
                                                                </label>
                                                            </HeaderTemplate>
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <ItemTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="SelectCheckBox" runat="server" />
                                                                    <span></span>
                                                                </label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="AccountName" HeaderText="Account" ItemStyle-Width="20%" HeaderStyle-HorizontalAlign="Left" HtmlEncode="false"></asp:BoundField>
                                                        <asp:BoundField DataField="ReceiptDate" HeaderText="Date" DataFormatString="{0:d}" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="AccountingYearName" HeaderText="Accounting Year" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="CreditLedgerName" HeaderText="Credit Ledger" ItemStyle-Width="15%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="DebitLedgerName" HeaderText="Debit Ledger" ItemStyle-Width="15%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ReceiptAmount" HeaderText="Receipt Amount" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ChequeNo" HeaderText="ChequeNo" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ChequeDate" HeaderText="ChequeDate" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="BankName" HeaderText="BankName" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ChequeClearDate" HeaderText="ChequeClearDate" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:TemplateField ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="ViewDetailLabel" SkinID="CustomWidthLabel" runat="server" Width="100%"
                                                                    Text="View Detail" OnClick="ViewDetailLabel_Click"></asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>

                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div id="FeePostingDetailDiv" runat="server" visible="false" class="pTop5">
                                    <div class="himssuHeader6WireBox table-responsive">
                                        <div class="himsBoxContent box-body box-solid gridviewfont">
                                            <div id="Div2" runat="server" visible="true">
                                                <asp:GridView ID="FeePostingDetailGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                    EmptyDataText="No Records Found !!" AllowPaging="False" ShowHeader="True" ShowFooter="false"
                                                    CssClass="table table-striped table-bordered table-hover">
                                                    <Columns>
                                                        <asp:BoundField DataField="ReceiptNumber" HeaderText="Receipt No." ItemStyle-Width="8%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="FeeTitle" HeaderText="Fee" ItemStyle-Width="15%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="FeeHeadName" HeaderText="Fee Head" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ReceiptBookTitle" HeaderText="Receipt Book" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="PayTypeName" HeaderText="Pay Type" ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="AccountName" HeaderText="Account" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="AccountingYearName" HeaderText="Accounting Year" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="CreditLedgerName" HeaderText="Credit Ledger" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="DebitLedgerName" HeaderText="Debit Ledger" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="ReceiptAmount" HeaderText="Receipt Amount" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--   <script data-main="../../JavaScript/rjs/encrypt/fee-posting-encrypt" src="../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/fee-posting")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>
