<div class="card">
    <div class="card-header">
        <h2 class="card-title ng-binding ng-scope" ng-if="!vm.isEditMode">{{::vm.translate.get('Create Tax Rate')}}</h2>
        <h2 class="card-title ng-binding ng-scope" ng-if="vm.isEditMode">{{::vm.translate.get('Edit Tax Rate')}}</h2>
    </div>
    <div class="card-body">
        <form name="taxRateForm" class="form-horizontal">
            <div class="col-sm-offset-2 bg-danger" ng-show="vm.validationErrors">
                <ul>
                    <li ng-repeat="error in vm.validationErrors">{{error}}</li>
                </ul>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Tax Class')}}</label>
                <div>
                    <select class="form-control" ng-model="vm.taxRate.taxClassId" ng-options="taxClass.id as taxClass.name for taxClass in vm.taxClasses"></select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Country')}}</label>
                <div>
                    <select class="form-control" ng-model="vm.taxRate.countryId" ng-options="country.id as country.name for country in vm.countries" ng-change="vm.reloadStatesOrProvinces()"></select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('State or Province')}}</label>
                <div>
                    <select class="form-control" ng-model="vm.taxRate.stateOrProvinceId" ng-options="stateOrProvince.id as stateOrProvince.name for stateOrProvince in vm.statesOrProvinces">
                        <option value="">All State or Province</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Zip Code')}}</label>
                <div>
                    <input name="zipCode" ng-model="vm.taxRate.zipCode" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Rate')}}</label>
                <div>
                    <div class="input-number">
                        <input id="rate" type="text" decimal maxlength="10" name="rate" ng-model="vm.taxRate.rate" required class="form-control" />
                        <label for="rate" class="form-control">{{vm.taxRate.rate | number}}</label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div>
                    <button class="btn btn-success float-right" ng-click="vm.save()"><span class="fa fa-save"></span> {{::vm.translate.get('Save')}}</button>
                    <button ui-sref="tax-rates" class="btn btn-default">{{::vm.translate.get('Cancel')}}</button>
                </div>
            </div>
        </form>
    </div>
</div>