{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="float-end">
        <button type="submit" form="form-tax-rate" formaction="{{ save }}" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
        <a href="{{ back }}" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
      <h1>{{ heading_title }}</h1>
      <ol class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
          <li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
      </ol>
    </div>
  </div>
  <div class="container-fluid">
    <div class="card">
      <div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
      <div class="card-body">
        <form id="form-tax-rate" action="{{ save }}" method="post" data-oc-toggle="ajax">
          <div class="row mb-3">
            <label for="input-name" class="col-sm-2 col-form-label">{{ entry_name }}</label>
            <div class="col-sm-10">
              <input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control" required/>
              <div id="error-name" class="invalid-feedback"></div>
            </div>
          </div>
          <div class="row mb-3">
            <label for="input-rate" class="col-sm-2 col-form-label">{{ entry_rate }}</label>
            <div class="col-sm-10">
              <input type="text" name="rate" value="{{ rate }}" placeholder="{{ entry_rate }}" id="input-rate" class="form-control" required/>
              <div id="error-rate" class="invalid-feedback"></div>
            </div>
          </div>
          <div class="row mb-3">
            <label for="input-type" class="col-sm-2 col-form-label">{{ entry_type }}</label>
            <div class="col-sm-10">
              <select name="type" id="input-type" class="form-select">
                <option value="P"{% if type == 'P' %} selected{% endif %}>{{ text_percent }}</option>
                <option value="F"{% if type == 'F' %} selected{% endif %}>{{ text_amount }}</option>
              </select>
            </div>
          </div>
          <div class="row mb-3">
            <label class="col-sm-2 col-form-label">{{ entry_customer_group }}</label>
            <div class="col-sm-10">
              <div id="product-store" class="form-control" style="height: 150px; overflow: auto;">
                {% for customer_group in customer_groups %}
                  <div class="form-check">
                    <input type="checkbox" name="tax_rate_customer_group[]" value="{{ customer_group.customer_group_id }}" id="input-customer-group-{{ customer_group.customer_group_id }}" class="form-check-input"{% if customer_group.customer_group_id in tax_rate_customer_group %} checked{% endif %}/> <label for="input-customer-group-{{ customer_group.customer_group_id }}" class="form-check-label">{{ customer_group.name }}</label>
                  </div>
                {% endfor %}
              </div>
            </div>
          </div>
          <div class="row mb-3">
            <label for="input-geo-zone" class="col-sm-2 col-form-label">{{ entry_geo_zone }}</label>
            <div class="col-sm-10">
              <select name="geo_zone_id" id="input-geo-zone" class="form-select">
                {% for geo_zone in geo_zones %}
                  <option value="{{ geo_zone.geo_zone_id }}"{% if geo_zone.geo_zone_id == geo_zone_id %} selected{% endif %}>{{ geo_zone.name }}</option>
                {% endfor %}
              </select>
            </div>
          </div>
          <input type="hidden" name="tax_rate_id" value="{{ tax_rate_id }}" id="input-tax-rate-id"/>
        </form>
      </div>
    </div>
  </div>
</div>
{{ footer }}
