<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
    CodeBehind="gl_accounting_setup.aspx.cs" Inherits="HRMS.GL_LEGAL_ENTITY.gl_accounting_setup" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="scriptManager" runat="server">
    </asp:ScriptManager>

     <asp:UpdatePanel runat="server" ID="upMain" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
<script type="text/javascript">
    function clearTextBox() {
        var elements = document.getElementsByTagName("input");
        for (var ii = 0; ii < elements.length; ii++) {
            if (elements[ii].type == "text") {
                elements[ii].value = "";
            }
        }
        document.getElementById('<%=hid_led_id.ClientID %>').value = "";
        document.getElementById('<%=hid_per_name.ClientID %>').value = "";
    }
    </script>

    <div class="main-panel">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading" style="padding-bottom:30px">
                           <span class="label label-primary">GL Accounting Setup</span>
                    
                         <div class="pull-right">
                            <asp:Button CssClass="btn btn-info" ID="btn_save" Text="Save" runat="server"  ValidationGroup="save"
                                 onclick="btn_save_Click"/>
                            <asp:Button CssClass="btn btn-info" ID="btn_cancel" Text="Back" runat="server" 
                                 onclick="btn_cancel_Click"/>

                                      <input type="button" value="Clear" class="btn btn-info" onclick="clearTextBox()" />
                        </div>
                    </header>
                    <div class="panel-body">
                        <div class="span6">
                                <div id="divmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <asp:label text="" ID="lbl_msg" CssClass="msg" runat="server"></asp:label>
                                </div>
                            </div>

                            <div class="span6">
                                <div id="diverrmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <asp:label text="" id="lbl_err_msg" CssClass="msg" runat="server"></asp:label>
                                </div>
                            </div>


                            <div class="row">
                                <asp:HiddenField ID="hid_led_id" runat="server" />
                                <label class="control-label col-md-2">Legal Entity</label>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddl_lgl_entity" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                </div>

                                <label class="control-label col-md-2">Ledger Name</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_led_name" runat="server" CssClass="form-control"></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_led_name" controltovalidate="txt_led_name" errormessage="Ledger Name Required!" />
                                </div>
                            </div>


                            <div class="row" style="padding-top:05px">
                                <label class="control-label col-md-2">Ledger Category Code</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_led_cat_code" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>

                                <label class="control-label col-md-2">Ledger Description</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_led_desc" runat="server" CssClass="form-control"></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_led_desc" controltovalidate="txt_led_desc" errormessage="Description Required!" />
                                </div>
                            </div>
                            <hr />

                            <div class="row">
                                <label class="control-label col-md-2">Chart Of Account</label>
                                <div class="col-md-3">
                                   <asp:DropDownList ID="ddl_coa" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                </div>

                                <label class="control-label col-md-2">Currency</label>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddl_curr" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                </div>
                            </div>


                              <div class="row" style="padding-top:05px">
                                <label class="control-label col-md-2">Period Set Name</label>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddl_prd_set" runat="server" CssClass="form-control select2" 
                                        AutoPostBack="True" onselectedindexchanged="ddl_prd_set_SelectedIndexChanged"></asp:DropDownList>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_prd_set" controltovalidate="ddl_prd_set" errormessage="Period Set Name Required!" />
                                </div>

                                <label class="control-label col-md-2">Period Type</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_per_type" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                            </div>


                             <div class="row" style="padding-top:05px">
                                <label class="control-label col-md-2">Period Name</label>
                                <div class="col-md-3">
                                 <div class="input-group">
                                        <asp:HiddenField ID="hid_per_name" runat="server" />
                                       <asp:TextBox ID="txt_per_name" runat="server" CssClass="form-control"></asp:TextBox>
                                       <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_per_name" controltovalidate="txt_per_name" errormessage="Period Name Required!" />
                                          <span class="input-group-btn">
                                            <button id="btn_lov_per_sets" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_per_sets_Click"><i class="fa fa-search"></i></button>
                                          </span>
                                 </div>
                                    
                                </div>

                                <label class="control-label col-md-2">Code Combination</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_code_com" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                            </div>

                            <hr />
                            <div class="row">
                                <label class="control-label col-md-2">Start Date</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_strt_date" runat="server" CssClass="form-control form_datetime"></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_strt_date" controltovalidate="txt_strt_date" errormessage="Start Date Required!" />
                                </div>

                                <label class="control-label col-md-2">End Date</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_end_date" runat="server" CssClass="form-control form_datetime"></asp:TextBox>
                                </div>
                            </div>

                          <asp:Repeater ID="add_info" runat="server">
                            <HeaderTemplate><header class="panel-heading">Additional Information</header><br /></HeaderTemplate>
                            <ItemTemplate>
                                <div class="row">
                                    <asp:Label ID="r_lbl" CssClass="control-label col-md-2" runat="server" Text='<%#Eval("PROMPT") %>'></asp:Label>
                                    <div class="col-md-4">
                                        <asp:TextBox ID="txt_r_value" runat="server" CssClass="form-control" placeholder='<%#Eval("PROMPT") %>' Text='<%#Eval("Value") %>'></asp:TextBox>
                                        <asp:HiddenField ID="hid_field_name" runat="server" Value='<%#Eval("col_name") %>' />
                                    </div>
                                </div>
                            </ItemTemplate>
                          </asp:Repeater>

                    </div>
                </section>
            </div>
        </div>
    </div>
    </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btn_save" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>

    <script src="../../ThemeScrips/jquery.min.js"></script>
    <link href="../../ThemeScrips/select2.min.css" rel="stylesheet" />
    <script src="../../ThemeScrips/select2.min.js"></script>
    <script>
        $('.select2').select2();
    </script>
</asp:Content>
