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

<%@ 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="Date" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteTextBoxForGridView.ascx" TagName="AutoCompleteTextBoxForGridView" TagPrefix="acc" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/CommonSearch.ascx" TagName="CommonSearchUserControl" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/Common/Account/AccountDetailBoxControl.ascx" TagName="AccountControl" TagPrefix="Acnt" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="OTQueueListingUpdatePanel" runat="server">
        <ContentTemplate>
            <uc1:CommonSearchUserControl ID="CommonSearchControl" Visible="false" runat="server" />
            <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="148"
                                                            Visible="true" runat="server" />
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                            <div class="whiteboxpaddingleft row">
                                <Acnt:AccountControl ID="AccountUserControl" runat="server" Visible="true" />
                                <div class="himssuHeader5WireBox card card-box">
                                    <div class="himsBoxHeader card-head">
                                        
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                                <header>
                                                <i class="far fa-edit"></i>
                                                <asp:Label ID="Label1" runat="server" Text="Voucher Entry"></asp:Label>
                                                </header>
                                            </div>
                                        </div>
                                        <div class="fRight mt-27">
                                            <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0" class="btn btn-back fas" Text="&#xf30a; Back" />
                                        </div>
                                    </div>
                                    <div class="himsBoxContent card-body">
                                        <asp:Panel ID="DetailPanel" runat="Server">
                                            <div class="contentHolder">
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="VoucherTypeLabel" runat="server" Text="Voucher Type" SkinID="MandatoryLabel"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:DropDownList runat="server" ID="VoucherTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                            onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()"
                                                            AutoPostBack="True"
                                                            OnSelectedIndexChanged="VoucherTypeDropDownList_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="VoucerEnteryDate" runat="server" Text="Voucher Date" SkinID="MandatoryLabel"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <Date:DatePickerControl DisplayDatePicker="true" Width="100px" ID="VoucherDatePickerControl" Text='<%# Bind("TransactionDate") %>' Visible="True" runat="Server"></Date:DatePickerControl>
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="VoucherNoLabel" Text="Voucher No" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:TextBox ID="VoucherNoTextBox" runat="server" onmouseleave="showHideTooltip()" SkinID="CustomWidthTextBox"
                                                            onmouseenter="showHideTooltip()" Width="150px" onblur="javascript:return fnValidateDecimal(this,10,2)" onKeypress="javascript:return MaskDecimal(event,10,2)"></asp:TextBox>
                                                    </div>
                                                </div>
                                                
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="NarrationLabel" Text="Narration" runat="server"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:TextBox ID="NarrationTextBox" TextMode="MultiLine" Rows="3" runat="server" onmouseleave="showHideTooltip()" SkinID="CustomWidthTextBox"
                                                            onmouseenter="showHideTooltip()" MaxLength="1000" ></asp:TextBox><%--Added by dhananjay from mantis - 0035082--%>

                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="ChequeNoLabel" Text="Cheque No" runat="server"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:TextBox ID="ChequeNoTextBox" runat="server" onmouseleave="showHideTooltip()" SkinID="CustomWidthTextBox"
                                                            onmouseenter="showHideTooltip()" MaxLength="100"></asp:TextBox>
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3" visible="false">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="BankNameLabel" Text="Bank Name" runat="server" Visible="false"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:TextBox ID="BankNameTextBox" runat="server" onmouseleave="showHideTooltip()" SkinID="CustomWidthTextBox"
                                                            onmouseenter="showHideTooltip()" MaxLength="100"  Visible="false"></asp:TextBox>
                                                    </div>
                                                </div>
                                                   <div class="cBoth"></div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="ChequeDateLabel" runat="server" Text="Cheque Date" SkinID="MandatoryLabel"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <Date:DatePickerControl DisplayDatePicker="true" ID="ChequeDatePickerControl" Text='<%# Bind("ChequeDate") %>' Visible="True" runat="Server"></Date:DatePickerControl>
                                                    </div>
                                                </div>
                                               
                                                <div class="outerBox pTop15 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        
                                                        <asp:CheckBox ID="MultiVoucherCheckBox" AutoPostBack="true" runat="server"
                                                            OnCheckedChanged="MultiVoucherCheckBox_Checked" Text="Multi Voucher" class="pRight5" />
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="fLeft pRight5">
                                                        <asp:HiddenField ID="DetailHiddenField" runat="server" />
                                                    </div>
                                                </div>
                                                                                        
                                                <div id="Div1" class="himssuHeader7WireBox col-md-12 pTop15 pb5" runat="server" visible="true">
                                                    <div class="himsBoxHeader" id="GridViewPagerDiv" runat="server" visible="True">
                                                        <div class="leftdiv">
                                                        </div>
                                                        <div class="himsBoxTitle">
                                                            <div class="headerText">
                                                                <asp:Label ID="Label4" runat="server" Text=""></asp:Label>
                                                            </div>
                                                        </div>
                                                        <div class="fRight mt-27 display-flex">
                                                            <asp:Button ID="AddVoucherDetailButton" runat="Server" class="btn btn-add fas" SkinID="0" OnClick="AddVoucherDetailButton_Click" Text="&#xf067; Add" Visible="false" />
                                                       &nbsp;
                                                            <asp:DropDownList runat="server" Visible="false" ID="LedgerTypeAddDropDownList" SkinID="CustomWidthDropDownList"
                                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                DataValueField="LedgerTypeId" AutoPostBack="True">
                                                            </asp:DropDownList>
                                                        </div>

                                                    </div>
                                                    <div class="himsBoxContent card-body table-responsive">
                                                        <asp:GridView ID="VoucherGridView" runat="server" AutoGenerateColumns="False"
                                                            EmptyDataText="No Records Found !!" CssClass="table table-striped table-bordered table-hover" AllowPaging="false" ShowHeader="True"
                                                            DataKeyNames="TransactionDetailId" OnRowDataBound="VoucherGridView_RowDataBound" >
                                                            <Columns>
                                                                <asp:BoundField DataField="TransactionDetailId" HeaderText="Id" Visible="false"></asp:BoundField>
                                                                <asp:TemplateField HeaderText="To/By" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>
                                                                        <asp:DropDownList runat="server" Enabled="false" ID="LedgerTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                                            CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                            DataValueField="LedgerTypeId" AutoPostBack="True"
                                                                            OnSelectedIndexChanged="LedgerTypeDropDownList_SelectedIndexChanged">
                                                                        </asp:DropDownList>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="10%" Wrap="True" />
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Ledger" ItemStyle-Width="40%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>
                                                                        <asp:DropDownList runat="server" ID="LedgerDropDownList" SkinID="CustomWidthDropDownList"
                                                                            CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                            DataValueField="LedgerId" AutoPostBack="True"
                                                                            OnSelectedIndexChanged="LedgerDropDownList_SelectedIndexChanged">
                                                                        </asp:DropDownList>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="20%" Wrap="True" />
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Balance" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="OpBalanceLabel" runat="server" Text="" Font-Bold="true"></asp:Label>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="10%" Wrap="True" />
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Credit" ItemStyle-Width="20%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>
                                                                        <asp:TextBox ID="CreditTextBox" SkinID="CustomWidthTextBox" runat="server" Width="150px" MaxLength="200"
                                                                            Text='<%# Eval("Credit") %>'
                                                                            AutoPostBack="true" OnTextChanged="DebitTextBox_TextChanged"></asp:TextBox>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="20%" Wrap="True" />
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Debit" ItemStyle-Width="20%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>
                                                                        <asp:TextBox ID="DebitTextBox" SkinID="CustomWidthTextBox" runat="server" Width="150px" MaxLength="200"
                                                                            Text='<%# Eval("Debit") %>'
                                                                            AutoPostBack="True" OnTextChanged="DebitTextBox_TextChanged"></asp:TextBox>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="20%" Wrap="True" />
                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <PagerSettings Visible="False" />
                                                        </asp:GridView>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                </div>                               
                            </div>
                        </tr>
                    </table>
                </div>
            </div>         
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/voucher-entry-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/voucher-entry")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <%--Added for mantis : 32211 by Nilesh--%>
    <script type="text/javascript">
        function LimitDecimalPlaces(textBox, decimalPlaces) {
            var value = textBox.value;
            value = value.replace(/[^0-9.]/g, '');
            var decimalIndex = value.indexOf('.');
            if (decimalIndex !== -1) {
                if (value.substring(decimalIndex + 1).length > decimalPlaces) {
                    value = value.slice(0, decimalIndex + decimalPlaces + 1);
                }
            }
            textBox.value = value;
        }
    </script>
</asp:Content>
