<%@ 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" />

                                    <asp:Button CssClass="btn btn-info" ID="btn_clear" Text="Clear" runat="server" OnClick="btn_clear_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" style="padding-top: 05px">
                                    <label class="control-label col-md-3">Subledger Accounting Method</label>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_sub_acc_mth" runat="server" />
                                            <asp:TextBox ID="txt_sub_acc_mth" runat="server" CssClass="form-control"></asp:TextBox>
                                            <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" ID="RequiredFieldValidator1" ControlToValidate="txt_sub_acc_mth" ErrorMessage="Subledger Accounting Method is Required!" />--%>
                                            <span class="input-group-btn">
                                                <button id="btn_sub_acc_mth" type="button" runat="server" class="btn btn-white"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>

                                    <label class="control-label col-md-3">Journal Entry Language</label>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_jr_entry_lng" runat="server" />
                                            <asp:TextBox ID="txt_jr_entry_lng" runat="server" CssClass="form-control"></asp:TextBox>
                                            <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" ID="RequiredFieldValidator2" ControlToValidate="txt_jr_entry_lng" ErrorMessage="Journal Entry Language is Required!" />--%>
                                            <span class="input-group-btn">
                                                <button id="btn_jr_entry_lng" type="button" runat="server" class="btn btn-white"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>


                                </div>


                                <div class="row" style="padding-top: 05px">
                                    <label class="control-label col-md-3">Entered Currency Balancing Account </label>
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_ent_curr_bal_acc" runat="server" />
                                            <asp:TextBox ID="txt_ent_curr_bal_acc" runat="server" CssClass="form-control"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button id="btn_ent_curr_bal_acc" type="button" runat="server" class="btn btn-white" onserverclick="btn_ent_curr_bal_acc_ServerClick"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>
                                </div>


                                <div class="row">
                                    <div class="col-md-3 col-md-offset-3">
                                        <asp:CheckBox ID="chk_use_csh" runat="server" CssClass="checkbox" Text="Use Cash Basis Accounting" />
                                    </div>

                                    <div class="col-md-4">
                                        <asp:CheckBox ID="chk_bal_subledg_ent" runat="server" CssClass="checkbox" Text="Balance Subledger Entries by Ledger Currency" />
                                    </div>
                                </div>
                                <hr />
                                <div class="row" style="padding-top: 05px">
                                    <label class="control-label col-md-3">Retained Earning Account </label>
                                    <div class="col-md-6">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_ret_earn" runat="server" />
                                            <asp:TextBox ID="txt_ret_earn" runat="server" CssClass="form-control"></asp:TextBox>
                                            
                                            <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" ID="RequiredFieldValidator4" ControlToValidate="txt_ret_earn" ErrorMessage="Retained Earning Account is Required!" />
                                            <span class="input-group-btn">
                                                <button id="btn_ret_earn" type="button" runat="server" onserverclick="btn_ret_earn_ServerClick" class="btn btn-white"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>



                                    <div class="col-md-3">
                                        <asp:CheckBox ID="chk_nt_cl_bal" runat="server" CssClass="checkbox" Text="Net Closing Balance Flag" />
                                    </div>
                                </div>



                                <hr />
                                <div class="row" style="padding-top: 05px">
                                    <label class="control-label col-md-3">Suspense Account </label>
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_susp_acc" runat="server" />
                                            <asp:TextBox ID="txt_susp_acc" runat="server" CssClass="form-control"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button id="btn_susp_acc" type="button" runat="server" class="btn btn-white"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>



                                     
                                </div>

                                <div class="row">
                                    <label class="control-label col-md-3">Rounding Differences Tracking Account </label>
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_round_dif" runat="server" />
                                            <asp:TextBox ID="txt_round_dif" runat="server" CssClass="form-control"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button id="btn_round_dif" type="button" onserverclick="btn_round_dif_ServerClick" runat="server" class="btn btn-white"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>
                                </div>

                                <div class="row" style="padding-top:10px">
                                     <div class="col-md-3 col-md-offset-2">
                                        <asp:CheckBox ID="chk_enb_intra_bal" runat="server" CssClass="checkbox" Text="Enable Intracompany Balancing" />
                                    </div>

                                    <div class="col-md-3">
                                        <asp:CheckBox ID="chk_enb_jr_app" runat="server" CssClass="checkbox" Text="Enable Journal Approval" />
                                    </div>

                                     <div class="col-md-3">
                                        <asp:CheckBox ID="chk_enb_jr_ent_tx" runat="server" CssClass="checkbox" Text="Enable Journal Entry Tax" />
                                    </div>
                                </div>


                                 <hr />
                                <div class="row" style="padding-top: 05px">
                                    <label class="control-label col-md-3">Default Period End Rate Type</label>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_def_pr_endrr_typ" runat="server" />
                                            <asp:TextBox ID="txt_def_pr_endrr_typ" runat="server" CssClass="form-control"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button id="btn_def_pr_endrr_typ" type="button" runat="server" class="btn btn-white" onserverclick="btn_def_pr_endrr_typ_ServerClick"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>



                                     <label class="control-label col-md-3">Default Period Average Rate Type</label>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_def_avg_rt_typ" runat="server" />
                                            <asp:TextBox ID="txt_def_avg_rt_typ" runat="server" CssClass="form-control"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button id="btn_def_avg_rt_typ" type="button" runat="server" onserverclick="btn_def_avg_rt_typ_ServerClick" class="btn btn-white"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>
                                </div>

                                <div class="row">
                                 <label class="control-label col-md-4">Cumulative Transaction Adjustment Account</label>
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_cuml_trans" runat="server" />
                                            <asp:TextBox ID="txt_cuml_trans" runat="server" CssClass="form-control"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button id="btn_cuml_trans" type="button" runat="server" class="btn btn-white" onserverclick="btn_cuml_trans_ServerClick"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </div>

                                    </div>

                                <hr />
                                <div class="row">
                                      <div class="col-md-3 col-md-offset-1">
                                        <asp:CheckBox ID="chk_enb_recn" runat="server" CssClass="checkbox" Text="Enable Journal Reconciliation" />
                                    </div>

                                    <div class="col-md-3">
                                        <asp:CheckBox ID="chk_enb_bdgt_ctrl" runat="server" CssClass="checkbox" Text="Enable Budgetary Control" />
                                    </div>

                                     <div class="col-md-3">
                                        <asp:CheckBox ID="chk_req_bdgt_jr" runat="server" CssClass="checkbox" Text="Require Budgetary Journals" />
                                    </div>
                                </div>

                                  <div class="row">
                                 <label class="control-label col-md-4">Reserve for Encumbrance Account</label>
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_resrv_ecumb_acc" runat="server" />
                                            <asp:TextBox ID="txt_resrv_ecumb_acc" runat="server" CssClass="form-control"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button id="btn_resrv_ecumb_acc" type="button" runat="server" class="btn btn-white"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>

                                    </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>
