<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="TaxCode.aspx.cs" Inherits="HRMS.TaxCode" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
       <div class="main-panel">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading">
                        Tax Code
                                <div class="pull-right">
                            <asp:button text="Save" CssClass="btn btn-info" ID="btn_save"   ValidationGroup="save"
                                runat="server" onclick="btn_save_Click"/>
                            <asp:button text="Back" CssClass="btn btn-info" ID="btn_cancel" runat="server" onclick="btn_cancel_Click"/>
                        </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_taxcode" runat="server" />
                            <label class="control-label col-md-2">Operating Unit</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_ou" runat="server" CssClass="form-control"></asp:DropDownList>
                                <asp:RequiredFieldValidator runat="server" ID="rq4" ControlToValidate="ddl_ou" ErrorMessage="Operating Unit is required." setfocusonerror="true" ValidationGroup = "save"></asp:RequiredFieldValidator>
                            </div>

                            <label class="control-label col-md-2">Tax Authority</label>
                            <div class="col-md-4">
                                <asp:DropDownList ID="ddl_vendor" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl_vendor_SelectedIndexChanged" CssClass="form-control"></asp:DropDownList>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="ddl_vendor" ErrorMessage="Tax Authority is required." setfocusonerror="true" ValidationGroup = "save"></asp:RequiredFieldValidator>
                            </div>
                        </div>

                        <div class="row">
                            <label class="control-label col-md-2">Tax Code</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_taxcode" runat="server" CssClass="form-control"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="txt_taxcode" ErrorMessage="Tax Code is required." setfocusonerror="true" ValidationGroup = "save"></asp:RequiredFieldValidator>
                            </div>

                            <label class="control-label col-md-2">Site</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_site" runat="server" CssClass="form-control"></asp:DropDownList>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="ddl_site" ErrorMessage="Site is required." setfocusonerror="true" ValidationGroup = "save"></asp:RequiredFieldValidator>
                            </div>
                        </div>


                         <div class="row">
                            <label class="control-label col-md-2">Description</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_desc" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>

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


                        <div class="row">
                            <label class="control-label col-md-2">GL Account</label>
                            <div class="col-md-3">
                                 <div class="input-group">
                                        <asp:HiddenField ID="hid_account" runat="server" />
                                        <asp:TextBox ID="txt_account" runat="server" CssClass="form-control"></asp:TextBox>
                                          <span class="input-group-btn">
                                                            <button id="btn_lov_lgl_add" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_lgl_add_ServerClick">
                                                            <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:RadioButton ID="rd_lmt" runat="server" CssClass="radio" Text="Period Limit" GroupName="rd" />
                            </div>
                             <div class="col-md-3">
                                 <asp:RadioButton ID="rd_flat" runat="server" CssClass="radio" Text="Flat Rate" GroupName="rd" />
                            </div>
                             <div class="col-md-3">
                                 <asp:RadioButton ID="rd_amt" runat="server" CssClass="radio" Text="Amount Ranges" GroupName="rd" />
                            </div>
                        </div>
                        <br />

                         <div class="row">
                            <label class="control-label col-md-2">Period Basis</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_pr_basis" Enabled="false" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>


                            <label class="control-label col-md-2">Amount Basis</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_amt_basis" Enabled="false" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>
                        </div>

                         <div class="row">
                            <label class="control-label col-md-2">Calender</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_calender" runat="server" CssClass="form-control"></asp:DropDownList>
                            </div>


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

                        <div class="row" style="padding-top:10px">
                            <div class="col-md-5 col-md-offset-2">
                                <asp:CheckBox ID="chk_cr_zero" runat="server" CssClass="checkbox" Text="Don't Create Zero Amount Accounting or Invoices" />
                            </div>
                             <div class="col-md-3">
                                <asp:CheckBox ID="chk_tax_grp" runat="server" CssClass="checkbox" Text="Create Withholding Tax Group" />
                            </div>
                        </div>


                         <div class="row">
                                                   <div class="col-md-10">
                                                     <h6>Tax Rates</h6>
                                                     <hr style="margin-top:0px !important;"/>
                                                    </div>
                                               </div>

                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Visible="false"
                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound">
                                <Columns> 
                                <asp:TemplateField HeaderStyle-Width="10px">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hid_tax_dtl" runat="server" Value='<%# Bind("TAX_RATE_ID") %>' />
                                        <asp:HiddenField ID="hid_type" runat="server" Value='<%# Bind("RATE_TYPE") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>    

                            <asp:TemplateField HeaderText="Type" ItemStyle-Width="150px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_type" runat="server" CssClass="form-control"></asp:DropDownList>
                                        <asp:RequiredFieldValidator runat="server" ID="rq1" ControlToValidate="ddl_type" ErrorMessage="Type is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="From Date">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_frm_date" runat="server" CssClass="form-control datetime" Text='<%#Bind("START_DATE") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" ID="rq5" ControlToValidate="txt_frm_date" ErrorMessage="From Date is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="To Date">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_to_date" runat="server" Text='<%# Bind("END_DATE") %>' CssClass="form-control datetime"></asp:TextBox>
                                        <asp:RequiredFieldValidator Visible="false" runat="server" ID="rq6" ControlToValidate="txt_to_date" ErrorMessage="Site is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="Amount Range From">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_amt_rng_frm" runat="server" Text='<%# Bind("START_AMOUNT") %>' CssClass="form-control"></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" ID="rq7" ControlToValidate="txt_amt_rng_frm" ErrorMessage="Amount Range From is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="Amount Range To">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_amt_rng_to" runat="server" Text='<%# Bind("END_AMOUNT") %>' CssClass="form-control"></asp:TextBox>
                                        <asp:RequiredFieldValidator Visible="false" runat="server" ID="rq8" ControlToValidate="txt_amt_rng_to" ErrorMessage="Site is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="Rate">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_rate" runat="server" Text='<%# Bind("TAX_RATE") %>' CssClass="form-control"></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" ID="rq9" ControlToValidate="txt_rate" ErrorMessage="Rate is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="Comment" ItemStyle-Width="220px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_cmnt" runat="server" Text='<%# Bind("COMMENTS") %>' CssClass="form-control"></asp:TextBox>
                                        <asp:RequiredFieldValidator Visible="false" runat="server" ID="rq3" ControlToValidate="txt_cmnt" ErrorMessage="Site is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                    <asp:TemplateField HeaderText="Action" ItemStyle-Width="6%">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="linkedit" Visible="false" runat="server" CommandName="gEdit"><i class="fa fa-pencil" style="font-size:20px !important;"></i></asp:LinkButton>
                                            <asp:linkbutton ID="lnkadd" CommandName="gAdd" runat="server" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'><i class="fa fa-plus" style="font-size:20px !important"></i></asp:linkbutton>
                                        </ItemTemplate>
                                            <ItemStyle Width="6%"></ItemStyle>
                                    </asp:TemplateField>
                                </Columns>
                                    <%--<FooterStyle CssClass="footerStyle" />
                                    <HeaderStyle CssClass="headerStyle" />
                                    <RowStyle CssClass="rowStyle" />--%>
                            </asp:GridView>
                    </div>

                </section>
            </div>
        </div>
    </div>
</asp:Content>
