¨4.0.1¨
This commit is contained in:
@@ -4,13 +4,13 @@ export default class {
|
||||
constructor() {
|
||||
this.rateCount = 0;
|
||||
|
||||
this.addTaxRates(FleetCart.data['tax_rates']);
|
||||
this.addTaxRates(FleetCart.data["tax_rates"]);
|
||||
|
||||
if (this.rateCount === 0) {
|
||||
this.addTaxRate();
|
||||
}
|
||||
|
||||
this.addTaxRatesErrors(FleetCart.errors['tax_rates']);
|
||||
this.addTaxRatesErrors(FleetCart.errors["tax_rates"]);
|
||||
|
||||
this.eventListeners();
|
||||
this.sortable();
|
||||
@@ -18,14 +18,14 @@ export default class {
|
||||
|
||||
addTaxRates(rates) {
|
||||
for (let rate of rates) {
|
||||
this.addTaxRate(rate)
|
||||
this.addTaxRate(rate);
|
||||
}
|
||||
}
|
||||
|
||||
addTaxRate(rate = {}) {
|
||||
let textRate = new TaxRate(this.rateCount++, rate);
|
||||
|
||||
$('#tax-rates').append(textRate.html());
|
||||
$("#tax-rates").append(textRate.html());
|
||||
|
||||
textRate.updateState();
|
||||
|
||||
@@ -37,18 +37,18 @@ export default class {
|
||||
let id = $.escapeSelector(key);
|
||||
let parent = $(`#${id}`).parent();
|
||||
|
||||
parent.addClass('has-error');
|
||||
parent.addClass("has-error");
|
||||
parent.append(`<span class="help-block">${errors[key][0]}</span>`);
|
||||
}
|
||||
}
|
||||
|
||||
eventListeners() {
|
||||
$('#add-new-rate').on('click', () => this.addTaxRate());
|
||||
$("#add-new-rate").on("click", () => this.addTaxRate());
|
||||
}
|
||||
|
||||
sortable() {
|
||||
Sortable.create(document.getElementById('tax-rates'), {
|
||||
handle: '.drag-icon',
|
||||
Sortable.create(document.getElementById("tax-rates"), {
|
||||
handle: ".drag-handle",
|
||||
animation: 150,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ use Modules\Tax\Entities\TaxClass;
|
||||
return [
|
||||
'tax' => 'Tax',
|
||||
'taxes' => 'Taxes',
|
||||
|
||||
'table' => [
|
||||
'tax_class' => 'Tax Class',
|
||||
],
|
||||
|
||||
'tabs' => [
|
||||
'group' => [
|
||||
'tax_information' => 'Tax Information',
|
||||
@@ -15,9 +17,11 @@ return [
|
||||
'general' => 'General',
|
||||
'rates' => 'Rates',
|
||||
],
|
||||
|
||||
'form' => [
|
||||
'add_new_rate' => 'Add New Rate',
|
||||
'delete_rate' => 'Delete Rate',
|
||||
|
||||
'based_on' => [
|
||||
TaxClass::SHIPPING_ADDRESS => 'Shipping Address',
|
||||
TaxClass::BILLING_ADDRESS => 'Billing Address',
|
||||
|
||||
@@ -16,3 +16,10 @@
|
||||
@endsection
|
||||
|
||||
@include('tax::admin.taxes.partials.shortcuts')
|
||||
|
||||
@push('globals')
|
||||
@vite([
|
||||
'Modules/Tax/Resources/assets/admin/sass/main.scss',
|
||||
'Modules/Tax/Resources/assets/admin/js/main.js'
|
||||
])
|
||||
@endpush
|
||||
@@ -18,3 +18,10 @@
|
||||
@endsection
|
||||
|
||||
@include('tax::admin.taxes.partials.shortcuts')
|
||||
|
||||
@push('globals')
|
||||
@vite([
|
||||
'Modules/Tax/Resources/assets/admin/sass/main.scss',
|
||||
'Modules/Tax/Resources/assets/admin/js/main.js'
|
||||
])
|
||||
@endpush
|
||||
@@ -25,7 +25,7 @@
|
||||
@endcomponent
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
<script type="module">
|
||||
new DataTable('#taxes-table .table', {
|
||||
columns: [
|
||||
{ data: 'checkbox', orderable: false, searchable: false, width: '3%' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
<script type="module">
|
||||
keypressAction([
|
||||
{ key: 'b', route: "{{ route('admin.taxes.index') }}" }
|
||||
]);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script type="text/html" id="tax-rate-template">
|
||||
<tr class="tax-rate">
|
||||
<td class="text-center">
|
||||
<span class="drag-icon">
|
||||
<span class="drag-handle">
|
||||
<i class="fa"></i>
|
||||
<i class="fa"></i>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user