<%@ page language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="System_TaxZones, MachSol.MachPanel.Web" %>

<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>

<asp:Content ID="Content7" ContentPlaceHolderID="CPH_Content" runat="Server">
    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h3><%= Resources.Content.strConfigTaxZones%>  </h3>
            </div>
            <div class="body">
                <div class="row">
                    <div class="col-xs-12">
                        <asp:RadioButton ID="RB_SystemTaxation" runat="server" Text="<%$ Resources:Content,strBuiltinTax%>" GroupName="TaxSettings" AutoPostBack="true" /><br />
                        <asp:RadioButton ID="RB_Avalara" runat="server" Text="<%$ Resources:Content,strAvalaraTax%>" GroupName="TaxSettings" AutoPostBack="true" />
                    </div>
                </div>
                <%--<div class="row">
                    <div class="col-xs-12">
                        <asp:Button class="btn btn-primary waves-effect" ID="Btn_SaveTaxConfig" CausesValidation="false" runat="server" Text="<%$ Resources:Content,GN0000654%>" />
                    </div>
                </div>--%>
            </div>
        </div>
        <br />
        <div class="card" id="Div_SystemTaxation" runat="server">
            <div class="header">
                <h3><%= Resources.Content.M0064%>  </h3>
            </div>
            <div class="body">
                <ajax:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="Pnl_Filter" runat="server" DefaultButton="Btn_Filter">
                            <div class="row">
                                <div class="panel-group search-panel" id="AS_TaxZones" role="tablist" aria-multiselectable="true">
                                    <div class="col-xs-12" role="tab" id="SH_TaxZones">
                                        <div class="card">
                                            <div class="header" role="button" data-toggle="collapse" data-parent="#AS_TaxZones" href="#<%= CSB_TaxZones.ClientID%>" aria-expanded="true" aria-controls="SH_TaxZones">
                                                <h3>
                                                    <%= Resources.Content.GN0000395%>
                                                </h3>
                                            </div>
                                            <div id="CSB_TaxZones" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_TaxZones" aria-expanded="false">
                                                <div class="row">
                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                        <div class="form-group form-float">
                                                            <asp:DropDownList ID="DDL_Status" runat="server">
                                                                <asp:ListItem Selected="True" Text='<%$ Resources:Content,SelectStatus %>' Value="-1"></asp:ListItem>
                                                                <asp:ListItem Text='<%$ Resources:Content,GN0000222 %>' Value="1"></asp:ListItem>
                                                                <asp:ListItem Text='<%$ Resources:Content,GN0000860 %>' Value="0"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                        <div class="form-group form-float">
                                                            <asp:DropDownList ID="DDL_Country" runat="server">
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>
                                                    <div class="col-xs-12">
                                                        <asp:Button CssClass="btn btn-primary waves-effect" ID="Btn_Filter" SkinID="filterButton" runat="server" Text='<%$ Resources:Content,GN0000395 %>' />
                                                        <asp:Button CssClass="btn btn-primary waves-effect" ID="Btn_Clear" Visible="false" SkinID="filterButton" runat="server"
                                                            Text='<%$ Resources:Content,String289  %>' />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </ajax:UpdatePanel>

                <div class="row Div_OpsRow" id="Div_OpsRow" runat="server">
                    <div class="col-xs-12">
                        <div class="card">
                            <div class="header">
                                <h3><%= Resources.Content.GN00001320%>  </h3>
                            </div>
                            <div class="body">
                                <asp:Button class="btn btn-primary waves-effect btnAction" ID="addZone" runat="server" PostBackUrl="AddTaxZone.aspx"
                                    Text="<%$ Resources:Content,GN00001354%>" />
                            </div>
                        </div>
                    </div>
                </div>


                <ajax:UpdatePanel ID="UP" runat="server">
                    <ContentTemplate>
                        <EM:TabContainer ID="TC_TaxZone" runat="server" OnClientActiveTabChanged="loadTabPanel">
                            <EM:TabPanel ID="Tab_Listing" runat="server" HeaderText='<%$ Resources:Content,M0064 %>'>
                                <ContentTemplate>
                                    <asp:Button ID="Btn_Tab0" runat="server" Style="display: none" />
                                    <asp:Panel ID="Pnl_TabContent0" runat="server">
                                        <asp:GridView ID="GV_TaxZones" AllowSorting="true" runat="server" AutoGenerateColumns="False"
                                            CssClass="table table-bordered table-striped table-hover table-responsive">
                                            <Columns>
                                                <asp:TemplateField SortExpression="Country_ISO_2" HeaderText='<%$ Resources:Content,GN0000882 %>'
                                                    HeaderStyle-CssClass="col-xs-3">
                                                    <ItemTemplate>
                                                        <div id="Div_Country" runat="server">
                                                        </div>
                                                        <input id="HTxBx_TId" runat="server" type="hidden" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField SortExpression="StateId" HeaderText='<%$ Resources:Content,GN00001313 %>'
                                                    HeaderStyle-CssClass="col-xs-3">
                                                    <ItemTemplate>
                                                        <div id="Div_State" runat="server">
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,GN00001016 %>' HeaderStyle-CssClass="col-xs-2">
                                                    <ItemTemplate>
                                                        <div id="Div_TaxType" runat="server">
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,GN00001019 %>' HeaderStyle-CssClass="col-xs-1">
                                                    <ItemTemplate>
                                                        <%#DataBinder.Eval(Container, "DataItem.Rate")%>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,String385 %>' HeaderStyle-CssClass="col-xs-1">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lbl_Status" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                                                    <ItemTemplate>
                                                        <asp:LinkButton CssClass="btn btn-primary waves-effect" SkinID="linkButtonEdit" ID="LinkButton1" runat="server" CausesValidation="False"
                                                            CommandName="change" CommandArgument='<%# DataBinder.Eval(Container,"DataItem.TId") %>'
                                                            Text='<%$ Resources:Content,GN0000276 %>'></asp:LinkButton>
                                                        <asp:LinkButton CssClass="btn btn-primary waves-effect btnAction" SkinID="linkButtonDelete" ID="LB_Delete" runat="server" CausesValidation="False"
                                                            CommandName="RowDelete" Text='<%$ Resources:Content,GN0000377 %>'></asp:LinkButton>
                                                        <EM:ConfirmButtonExtender ID="CBE_Remove" runat="server" ConfirmText="<%$Resources:Content,CBE001%>"
                                                            TargetControlID="LB_Delete">
                                                        </EM:ConfirmButtonExtender>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <%--PagerTemplate Start--%>
                                            <PagerTemplate>
                                                <EM:Pager ID="Pager1" runat="server" />
                                            </PagerTemplate>
                                            <%--PagerTemplate End--%>
                                        </asp:GridView>
                                    </asp:Panel>
                                </ContentTemplate>
                            </EM:TabPanel>
                            <EM:TabPanel ID="Tab_Edit" runat="server" HeaderText='<%$ Resources:Content,String324 %>'
                                Enabled="false">
                                <ContentTemplate>
                                    <asp:Button ID="Btn_Tab1" runat="server" Style="display: none" />
                                    <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="body">
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:Content,GN0000882%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_EditCountry" runat="server" AutoPostBack="True" data-label="Country">
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_State" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:Content,DEV1130%>" />
                                                                :
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_State" runat="server" data-label="State">
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                        <asp:Literal ID='Ltrl_T1Title' runat='server' Text='<%$ Resources:Content,USM0002 %>'></asp:Literal>
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID='TxBx_T1Title' runat="server" Text='<%$ Resources:Content,GN0000732 %>'
                                                                            MaxLength='100' data-label="Tax Title"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID='RFV_T1Title' runat="server" SetFocusOnError='true'
                                                                            ControlToValidate='TxBx_T1Title' Display='None' ValidationGroup='taxzone'></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal8" runat="server" Text="<%$ Resources:Content,GN00001016%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:RadioButtonList ID="RBL_TaxType" runat="server" data-label="Tax Type">
                                                                        <asp:ListItem Text='<%$ Resources:Content,GN00001017 %>' Value="0" Selected="True"></asp:ListItem>
                                                                        <asp:ListItem Text='<%$ Resources:Content,GN00001018 %>' Value="1"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                        <asp:Literal ID="Literal9" runat="server" Text="<%$ Resources:Content,GN00001019%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_Rate" runat="server" Text="0" data-label="Tax Rate"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="None"
                                                                            SetFocusOnError="True" ValidationGroup="taxzone" ControlToValidate="TxBx_Rate"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID='Ltrl_Tax2Title' runat="server" Text='<%$Resources:Content,USM0003 %>'></asp:Literal>
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID='TxBx_T2Title' runat="server" MaxLength="100" Text='<%$ Resources:Content,USM0006 %>' data-label="Tax 2 Title"></asp:TextBox>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID='Ltrl_T2Type' runat="server" Text='<%$Resources:Content,USM0005 %>'></asp:Literal>
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:RadioButtonList ID="Rbtnl_T2Type" runat="server" data-label="Tax 2 Type">
                                                                        <asp:ListItem Text='<%$ Resources:Content,GN00001017 %>' Value="0" Selected="True"></asp:ListItem>
                                                                        <asp:ListItem Text='<%$ Resources:Content,GN00001018 %>' Value="1"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID='Ltrl_T2Rate' runat="server" Text='<%$Resources:Content,USM0004 %>'></asp:Literal>
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID='TxBx_T2Rate' runat="server" Text='0' data-label="Tax 2 Rate"></asp:TextBox>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-sm-5 col-xs-12">
                                                                <asp:CheckBox ID='CB_Compound' runat="server" Text='<%$Resources:Content,USM0007 %>' data-label="Apply Tax 2 as Compound Tax"></asp:CheckBox>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal10" runat="server" Text="<%$ Resources:Content,GN0000597%>" />:
                                                            </div>
                                                            <div class="col-sm-10 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:TextBox ID="TxBx_Desc" runat="server" Rows="8" TextMode="MultiLine" CssClass="col-xs-12" data-label="Description"></asp:TextBox>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal11" runat="server" Text="<%$ Resources:Content,GN0000222%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:CheckBox Text=" " ID="ChBx_Active" runat="server" data-label="Is Active" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:Button CssClass="btn btn-primary waves-effect btnAction" ID="Btn_Save" runat="server" Text='<%$ Resources:Content,GN0000281 %>'
                                                                    ValidationGroup="taxzone" />
                                                                <asp:Button CssClass="btn btn-primary waves-effect" ID="Btn_Cancel" CausesValidation="false" runat="server"
                                                                    Text='<%$ Resources:Content,GN0000572 %>' />
                                                                <asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="taxzone" HeaderText="<%$ Resources:Content,EM000001 %>"
                                                                    runat="server" ShowSummary="false" ShowMessageBox="true" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </ContentTemplate>
                            </EM:TabPanel>
                        </EM:TabContainer>
                    </ContentTemplate>
                </ajax:UpdatePanel>
            </div>
        </div>

        <div class="card" id="Div_Avalara" runat="server">
            <div class="header">
                <h3><%= Resources.Content.AVALARAAVATAX%>  </h3>
            </div>
            <div class="body">
                <ajax:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <div class="row">
                            <div class="col-sm-2 col-xs-12 row-label">
                                *<asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Content,GN0000806%>" />:
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_AccountID" runat="server"></asp:TextBox>
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator ID='RFV_TxBx_AccountID' runat="server" SetFocusOnError='true'
                                    ControlToValidate='TxBx_AccountID' Display='None' ValidationGroup='avalaratax'></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-2 col-xs-12 row-label">
                                *<asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Content,strLicenseKey%>" />:
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_LicenseKey" runat="server"></asp:TextBox>
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator ID='RFV_TxBx_LicenseKey' runat="server" SetFocusOnError='true'
                                    ControlToValidate='TxBx_LicenseKey' Display='None' ValidationGroup='avalaratax'></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-2 col-xs-12 row-label">
                                *<asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:Content,APIUrl%>" />:
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_APIUrl" runat="server"></asp:TextBox>
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator ID='RFV_TxBx_APIUrl' runat="server" SetFocusOnError='true'
                                    ControlToValidate='TxBx_APIUrl' Display='None' ValidationGroup='avalaratax'></asp:RequiredFieldValidator>
                            </div>
                            <div class="col-sm-6 col-xs-12 row-label">
                                LIVE URL: https://rest.avatax.com
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-2 col-xs-12 row-label">
                                *<asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,FAM0023%>" />:
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <asp:DropDownList ID="DDL_AvalaraLocale" runat="server"></asp:DropDownList>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <asp:Button CssClass="btn btn-primary waves-effect btnAction" ID="Btn_UpdateAvalara" runat="server" Text='<%$ Resources:Content,GN0000281 %>'
                                    ValidationGroup="avalaratax" />
                                <asp:ValidationSummary ID="ValidationSummary2" ValidationGroup="avalaratax" HeaderText="<%$ Resources:Content,EM000001 %>"
                                    runat="server" ShowSummary="false" ShowMessageBox="true" />
                            </div>
                        </div>
                    </ContentTemplate>
                </ajax:UpdatePanel>
            </div>
        </div>
    </div>
</asp:Content>
