<%@ Page Title="Tax Master " Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true" CodeBehind="TaxMaster.aspx.cs" Inherits="SUNWEB.TaxMaster" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <link rel="stylesheet" href="../assets/vendor/bootstrap/css/bootstrap.min.css">
    <link href="../assets/vendor/fonts/circular-std/style.css" rel="stylesheet">
    <link rel="stylesheet" href="../assets/libs/css/style.css">
    <link rel="stylesheet" href="../assets/vendor/fonts/fontawesome/css/fontawesome-all.css">
    <link rel="stylesheet" href="../assets/vendor/datepicker/tempusdominus-bootstrap-4.css" />
    <link rel="stylesheet" href="../assets/vendor/inputmask/css/inputmask.css" />

    <script type="text/javascript" language="javascript"><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    function AllowOnlyNumeric() {
        // Get the ASCII value of the key that the user entered
        var key = window.event.keyCode;

        // Verify if the key entered was a numeric character (0-9) or a decimal (.)
        if ((key > 47 && key < 58) || key == 46)
        // If it was, then allow the entry to continue
            return;

        else
        // If it was not, then dispose the key and continue with entry
            window.event.returnValue = null;
        alert("Number Only Allowed")
    }



    function isNumberKey(evt, obj) {

        var charCode = (evt.which) ? evt.which : event.keyCode
        var value = obj.value;
        var dotcontains = value.indexOf(".") != -1;
        if (dotcontains)
            if (charCode == 46) return false;
        if (charCode == 46) return true;
        if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;
        return true;
    }

    </script>

    <style type="text/css">
    @media only screen and (max-width: 600px)
     {
      div 
       {
       text-align:left;        
       }
     }
  </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>

<%--   <table style="width:100%;padding-bottom:2px;">
       <tr>
       <td>
        
       </td>
       <td align="right" style="padding-bottom:7px;">
           <label for="validationCustom05">
           Branch
           <asp:Label ID="Label1" runat="server"></asp:Label>
           </label>
           <asp:DropDownList ID="cmbBranches" CssClass="custom-select"  
           Width="250px" runat="server" AutoPostBack="true" 
           onselectedindexchanged="cmbBranches_SelectedIndexChanged"></asp:DropDownList>
       </td>
       </tr>
       
       </table>--%>

    <div class="d-flex justify-content-end align-items-center mb-2">
    <label for="cmbBranches" class="form-label mb-0 me-2">
        Branch
        <asp:Label ID="Label1" runat="server" CssClass="ms-1 text-muted" />
    </label>

    <asp:DropDownList ID="cmbBranches" runat="server"
        CssClass="form-select"
        AutoPostBack="true"
        Style="width: 250px;"
        OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged" />
</div>




             <div class="row">


                      <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
  
                        <div class="card">
                        <h7 class="card-header" style="background-color: #4c4c4c; color: White;">TAX MASTER</h7>
                        <div class="card-body">
                        <form class="needs-validation" novalidate>
                       

                            <div class="form-group row align-items-center">

                                  <!-- Service Tax Name -->
                                  <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 mb-2">
                                    <asp:TextBox ID="txtServiceTax" runat="server" CssClass="form-control" placeholder="Service Tax Name"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="Valid1" runat="server" ValidationGroup="Taxform"
                                        ControlToValidate="txtServiceTax" ForeColor="Red" Text="Not Allowed to be Empty" Display="Dynamic" />
                                  </div>

                                  <!-- Tax Value -->
                                  <div class="col-lg-3 col-md-6 col-sm-12 mb-2">
                                    <div class="input-group">
                                      <asp:TextBox ID="txtServiceTaxValue" runat="server" CssClass="form-control w-25"
                                          onkeypress="return isNumberKey(event,this)" MaxLength="2" placeholder="Tax Value"></asp:TextBox>
                                      <span class="input-group-text">%</span>
                                    </div>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="Taxform"
                                        runat="server" ControlToValidate="txtServiceTaxValue" ForeColor="Red"
                                        Text="Not Allowed to be Empty" Display="Dynamic" />
                                  </div>

                                  <!-- Add-On Checkbox -->
                                  <div class="col-auto mb-2">
                                    <div class="form-check">
                                      <asp:CheckBox ID="chkSERVICECAddon" runat="server" CssClass="form-check-input" />
                                      <label class="form-check-label" for="chkSERVICECAddon">Add-On</label>
                                    </div>
                                  </div>

                                  <!-- Hidden Tax-on-Tax Checkbox -->
                                  <asp:CheckBox ID="chkSERVICETaxon" runat="server" CssClass="form-check-input d-none" Checked="true" />

                                </div>

                            <div class="form-group row align-items-center">

                                  <!-- GST Label + Name -->
                                  <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 mb-2">
                                    <asp:TextBox ID="txtGST" runat="server" CssClass="form-control" placeholder="GST Name"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                                        ControlToValidate="txtGST" ValidationGroup="Taxform"
                                        ForeColor="Red" Text=" Not Allowed to be Empty" Display="Dynamic" />
                                  </div>

                                  <!-- GST % Value -->
                                  <div class="col-lg-3 col-md-6 col-sm-12 mb-2">
                                    <div class="input-group">
                                      <asp:TextBox ID="txtGSTTaxValue" runat="server" CssClass="form-control"
                                          onkeypress="return isNumberKey(event,this)" MaxLength="2" placeholder="Tax %" />
                                      <span class="input-group-text">%</span>
                                    </div>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                        ControlToValidate="txtGSTTaxValue" ValidationGroup="Taxform"
                                        ForeColor="Red" Text="Not Allowed to be Empty" Display="Dynamic" />
                                  </div>

                                  <!-- GST Add-On Checkbox -->
                                  <div class="col-auto mb-2">
                                    <div class="form-check">
                                      <asp:CheckBox ID="chkGSTAddon" runat="server" CssClass="form-check-input" />
                                      <label class="form-check-label" for="chkGSTAddon">Add-On</label>
                                    </div>
                                  </div>

                                  <!-- GST Tax-on-Tax Checkbox (Hidden) -->
                                  <asp:CheckBox ID="chkGSTTaxon" runat="server" CssClass="d-none" Checked="true" />

                           </div>
                     
                            <div class="form-group row align-items-center">

                              <!-- Tax3 Name -->
                              <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 mb-2">
                                <asp:TextBox ID="txtTax3" runat="server" CssClass="form-control" placeholder="Tax Name"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                                    ValidationGroup="Taxform" ControlToValidate="txtTax3"
                                    ForeColor="Red" Text=" Not Allowed to be Empty" Display="Dynamic" />
                              </div>

                              <!-- Tax3 Value (%) -->
                              <div class="col-lg-3 col-md-6 col-sm-12 mb-2">
                                <div class="input-group">
                                  <asp:TextBox ID="txtTax3TaxValue" runat="server" CssClass="form-control"
                                      onkeypress="return isNumberKey(event,this)" MaxLength="2" placeholder="Tax %" />
                                  <span class="input-group-text">%</span>
                                </div>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                                    ValidationGroup="Taxform" ControlToValidate="txtTax3TaxValue"
                                    ForeColor="Red" Text="Not Allowed to be Empty" Display="Dynamic" />
                              </div>

                              <!-- Tax3 Add-On Checkbox -->
                              <div class="col-auto mb-2">
                                <div class="form-check">
                                  <asp:CheckBox ID="chkTax3AddOn" runat="server" CssClass="form-check-input" />
                                  <label class="form-check-label" for="chkTax3AddOn">Add-On</label>
                                </div>
                              </div>

                              <!-- Tax3 Tax-on-Tax (Hidden Checkbox) -->
                              <asp:CheckBox ID="chkTax3TaxOn" runat="server" CssClass="d-none" Checked="true" />

                            </div>


                            <div class="form-group row align-items-center">

                          <!-- Tax4 Name -->
                          <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 mb-2">
                            <asp:TextBox ID="txtTax4" runat="server" CssClass="form-control" placeholder="Tax Name"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                                ValidationGroup="Taxform" ControlToValidate="txtTax4"
                                ForeColor="Red" Text=" Not Allowed to be Empty" Display="Dynamic" />
                          </div>

                          <!-- Tax4 Value (%) -->
                          <div class="col-lg-3 col-md-6 col-sm-12 mb-2">
                            <div class="input-group">
                              <asp:TextBox ID="txtTax4Taxvalue" runat="server" CssClass="form-control"
                                  onkeypress="return isNumberKey(event,this)" MaxLength="2" placeholder="Tax %" />
                              <span class="input-group-text">%</span>
                            </div>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
                                ValidationGroup="Taxform" ControlToValidate="txtTax4Taxvalue"
                                ForeColor="Red" Text="Not Allowed to be Empty" Display="Dynamic" />
                          </div>

                          <!-- Add-On Checkbox -->
                          <div class="col-auto mb-2">
                            <div class="form-check">
                              <asp:CheckBox ID="chkTax4Addpn" runat="server" CssClass="form-check-input" />
                              <label class="form-check-label" for="chkTax4Addpn">Add-On</label>
                            </div>
                          </div>

                          <!-- Tax-on-Tax Checkbox (Hidden) -->
                          <asp:CheckBox ID="chkTax4Taxon" runat="server" CssClass="d-none" Checked="true" />

                        </div>

                            <div class="form-group row align-items-center">

                              <!-- Tax5 Name -->
                              <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 mb-2">
                                <asp:TextBox ID="txtTax5" runat="server" CssClass="form-control" placeholder="Tax Name"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
                                    ValidationGroup="Taxform" ControlToValidate="txtTax5"
                                    ForeColor="Red" Text=" Not Allowed to be Empty" Display="Dynamic" />
                              </div>

                              <!-- Tax5 Value (%) -->
                              <div class="col-lg-3 col-md-6 col-sm-12 mb-2">
                                <div class="input-group">
                                  <asp:TextBox ID="txtTax5TaxValue" runat="server" CssClass="form-control"
                                      onkeypress="return isNumberKey(event,this)" MaxLength="2" placeholder="Tax %" />
                                  <span class="input-group-text">%</span>
                                </div>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
                                    ValidationGroup="Taxform" ControlToValidate="txtTax5TaxValue"
                                    ForeColor="Red" Text="Not Allowed to be Empty" Display="Dynamic" />
                              </div>

                              <!-- Add-On Checkbox -->
                              <div class="col-auto mb-2">
                                <div class="form-check">
                                  <asp:CheckBox ID="chkTax5Addon" runat="server" CssClass="form-check-input" />
                                  <label class="form-check-label" for="chkTax5Addon">Add-On</label>
                                </div>
                              </div>

                              <!-- Hidden Tax-on-Tax Checkbox -->
                              <div class="d-none">
                                <asp:CheckBox ID="chk5TaxOn" runat="server" Checked="true" />
                              </div>

                            </div>


                            <div class="form-group row align-items-center">

                          <!-- Tax6 Name -->
                          <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 mb-2">
                            <asp:TextBox ID="txtTax6" runat="server" CssClass="form-control" placeholder="Tax Name"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server"
                                ValidationGroup="Taxform" ControlToValidate="txtTax6"
                                ForeColor="Red" Text="Not Allowed to be Empty" Display="Dynamic" />
                          </div>

                          <!-- Tax6 Value (%) -->
                          <div class="col-lg-3 col-md-6 col-sm-12 mb-2">
                            <div class="input-group">
                              <asp:TextBox ID="txtTax6TaxValue" runat="server" CssClass="form-control"
                                  onkeypress="return isNumberKey(event,this)" MaxLength="2" placeholder="Tax %" />
                              <span class="input-group-text">%</span>
                            </div>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"
                                ValidationGroup="Taxform" ControlToValidate="txtTax6TaxValue"
                                ForeColor="Red" Text=" Not Allowed to be Empty" Display="Dynamic" />
                          </div>

                          <!-- Add-On Checkbox -->
                          <div class="col-auto mb-2">
                            <div class="form-check">
                              <asp:CheckBox ID="chkTax6Addon" runat="server" CssClass="form-check-input" />
                              <label class="form-check-label" for="chkTax6Addon">Add-On</label>
                            </div>
                          </div>

                          <!-- Hidden Tax-on-Tax Checkbox -->
                          <div class="d-none">
                            <asp:CheckBox ID="chkTax6TaxOn" runat="server" Checked="true" />
                          </div>

                        </div>



                                   <div class="form-group row">
                                        <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                <label for="validationCustom03">
                                                    Tax Identifier </label>
                                                <asp:DropDownList ID="cmbClass" CssClass="custom-select" runat="server">
                                                    <asp:ListItem Text="Inclusive of Tax" Value="0"></asp:ListItem>
                                                    <asp:ListItem Text="Inclusive Tax Exclusive ServiceTax" Value="1"></asp:ListItem>
                                                    <asp:ListItem Text="Exclusive Tax Exclusive ServiceTax" Value="2"></asp:ListItem>
                                                    <asp:ListItem Text="Exclusive ServiceTax Inclusive Tax " Value="3"></asp:ListItem>
                                                    <asp:ListItem Text="Exclusive ServiceTax Exclusive Tax " Value="4"></asp:ListItem>
                                                    
                                                </asp:DropDownList>
                                            </div>
                                            </div>
                                 </form>


                                 <div align="left">
                                 <asp:Button ID="btnSubmit" runat="server" Text="Save" class="btn btn-primary" 
                                  onclick="btnSubmit_Click" ValidationGroup="Taxform"   />
                                 </div>
                                    
                                </div>
                                
                            </div>

                      
 </div>
                        
 </div>
 </ContentTemplate>
 </asp:UpdatePanel>

 <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css?v=1.1" rel="stylesheet" />
  <!-- Bootstrap 5 -->
 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
 <!-- Optional Bootstrap Icons -->
 <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet" />

</asp:Content>
