Fixed autocomplete enabled issue

This commit is contained in:
Cüneyt Şentürk 2021-12-01 13:46:23 +03:00
parent 987373b022
commit d2149cbd3b
15 changed files with 42 additions and 41 deletions

View File

@ -27,7 +27,7 @@ class AddExpenseCategories extends Listener
// send true for add limit on search and filter.. // send true for add limit on search and filter..
$event->class->filters['categories'] = $this->getExpenseCategories(true); $event->class->filters['categories'] = $this->getExpenseCategories(true);
$event->class->filters['routes']['categories'] = ['categories.index', 'search=type:expense']; $event->class->filters['routes']['categories'] = ['categories.index', 'search=type:expense enabled:1'];
} }
/** /**

View File

@ -27,7 +27,7 @@ class AddIncomeCategories extends Listener
// send true for add limit on search and filter.. // send true for add limit on search and filter..
$event->class->filters['categories'] = $this->getIncomeCategories(true); $event->class->filters['categories'] = $this->getIncomeCategories(true);
$event->class->filters['routes']['categories'] = ['categories.index', 'search=type:income']; $event->class->filters['routes']['categories'] = ['categories.index', 'search=type:income enabled:1'];
} }
/** /**

View File

@ -27,7 +27,7 @@ class AddIncomeExpenseCategories extends Listener
} }
$event->class->filters['categories'] = $this->getIncomeExpenseCategories(true); $event->class->filters['categories'] = $this->getIncomeExpenseCategories(true);
$event->class->filters['routes']['categories'] = ['categories.index', 'search=type:income,expense']; $event->class->filters['routes']['categories'] = ['categories.index', 'search=type:income,expense enabled:1'];
} }
/** /**

View File

@ -74,7 +74,7 @@ return [
'bank_name' => ['searchable' => true], 'bank_name' => ['searchable' => true],
'bank_address' => ['searchable' => true], 'bank_address' => ['searchable' => true],
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'enabled' => ['boolean' => true], 'enabled' => ['boolean' => true],
], ],
@ -96,12 +96,12 @@ return [
'id', 'id',
'type', 'type',
'account_id' => [ 'account_id' => [
'route' => 'accounts.index' 'route' => ['accounts.index', 'search=enabled:1'],
], ],
'paid_at' => ['date' => true], 'paid_at' => ['date' => true],
'amount', 'amount',
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'document_id', 'document_id',
'contact_id', 'contact_id',
@ -109,7 +109,7 @@ return [
'payment_method', 'payment_method',
'reference', 'reference',
'category_id' => [ 'category_id' => [
'route' => 'categories.index' 'route' => ['categories.index', 'search=enabled:1'],
], ],
'parent_id', 'parent_id',
'recurring' => [ 'recurring' => [
@ -126,11 +126,11 @@ return [
'id', 'id',
'expense_account' => [ 'expense_account' => [
'relationship' => true, 'relationship' => true,
'route' => 'accounts.index', 'route' => ['accounts.index', 'search=enabled:1'],
], ],
'income_account' => [ 'income_account' => [
'relationship' => true, 'relationship' => true,
'route' => 'accounts.index', 'route' => ['accounts.index', 'search=enabled:1'],
], ],
], ],
], ],
@ -159,7 +159,7 @@ return [
'description' => ['searchable' => true], 'description' => ['searchable' => true],
'enabled' => ['boolean' => true], 'enabled' => ['boolean' => true],
'category_id' => [ 'category_id' => [
'route' => ['categories.index', 'search=type:item'] 'route' => ['categories.index', 'search=type:item enabled:1']
], ],
'sales_price', 'sales_price',
'purchase_price', 'purchase_price',
@ -177,7 +177,7 @@ return [
'address' => ['searchable' => true], 'address' => ['searchable' => true],
'website' => ['searchable' => true], 'website' => ['searchable' => true],
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'reference', 'reference',
'user_id', 'user_id',
@ -199,7 +199,7 @@ return [
'due_at' => ['date' => true], 'due_at' => ['date' => true],
'amount', 'amount',
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'contact_id', 'contact_id',
'contact_name' => ['searchable' => true], 'contact_name' => ['searchable' => true],
@ -208,7 +208,7 @@ return [
'contact_phone' => ['searchable' => true], 'contact_phone' => ['searchable' => true],
'contact_address' => ['searchable' => true], 'contact_address' => ['searchable' => true],
'category_id' => [ 'category_id' => [
'route' => 'categories.index' 'route' => ['categories.index', 'search=enabled:1'],
], ],
'parent_id', 'parent_id',
'recurring' => [ 'recurring' => [
@ -240,10 +240,10 @@ return [
'due_at' => ['date' => true], 'due_at' => ['date' => true],
'amount', 'amount',
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'contact_id' => [ 'contact_id' => [
'route' => 'vendors.index' 'route' => ['vendors.index', 'search=enabled:1'],
], ],
'contact_name' => ['searchable' => true], 'contact_name' => ['searchable' => true],
'contact_email' => ['searchable' => true], 'contact_email' => ['searchable' => true],
@ -251,7 +251,7 @@ return [
'contact_phone' => ['searchable' => true], 'contact_phone' => ['searchable' => true],
'contact_address' => ['searchable' => true], 'contact_address' => ['searchable' => true],
'category_id' => [ 'category_id' => [
'route' => ['categories.index', 'search=type:expense'] 'route' => ['categories.index', 'search=type:expense enabled:1']
], ],
'parent_id', 'parent_id',
'recurring' => [ 'recurring' => [
@ -268,22 +268,22 @@ return [
'id', 'id',
'type', 'type',
'account_id' => [ 'account_id' => [
'route' => 'accounts.index' 'route' => ['accounts.index', 'search=enabled:1'],
], ],
'paid_at' => ['date' => true], 'paid_at' => ['date' => true],
'amount', 'amount',
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'document_id', 'document_id',
'contact_id' => [ 'contact_id' => [
'route' => 'vendors.index' 'route' => ['vendors.index', 'search=enabled:1'],
], ],
'description' => ['searchable' => true], 'description' => ['searchable' => true],
'payment_method', 'payment_method',
'reference', 'reference',
'category_id' => [ 'category_id' => [
'route' => ['categories.index', 'search=type:expense'] 'route' => ['categories.index', 'search=type:expense enabled:1']
], ],
'parent_id', 'parent_id',
'recurring' => [ 'recurring' => [
@ -317,10 +317,10 @@ return [
'due_at' => ['date' => true], 'due_at' => ['date' => true],
'amount', 'amount',
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'contact_id' => [ 'contact_id' => [
'route' => 'customers.index' 'route' => ['customers.index', 'search=enabled:1'],
], ],
'contact_name' => ['searchable' => true], 'contact_name' => ['searchable' => true],
'contact_email' => ['searchable' => true], 'contact_email' => ['searchable' => true],
@ -328,7 +328,7 @@ return [
'contact_phone' => ['searchable' => true], 'contact_phone' => ['searchable' => true],
'contact_address' => ['searchable' => true], 'contact_address' => ['searchable' => true],
'category_id' => [ 'category_id' => [
'route' => ['categories.index', 'search=type:income'] 'route' => ['categories.index', 'search=type:income enabled:1']
], ],
'parent_id', 'parent_id',
'recurring' => [ 'recurring' => [
@ -345,22 +345,22 @@ return [
'id', 'id',
'type', 'type',
'account_id' => [ 'account_id' => [
'route' => 'accounts.index' 'route' => ['accounts.index', 'search=enabled:1'],
], ],
'paid_at' => ['date' => true], 'paid_at' => ['date' => true],
'amount', 'amount',
'currency_code' => [ 'currency_code' => [
'route' => 'currencies.index' 'route' => ['currencies.index', 'search=enabled:1'],
], ],
'document_id', 'document_id',
'contact_id' => [ 'contact_id' => [
'route' => 'customers.index' 'route' => ['customers.index', 'search=enabled:1'],
], ],
'description' => ['searchable' => true], 'description' => ['searchable' => true],
'payment_method', 'payment_method',
'reference', 'reference',
'category_id' => [ 'category_id' => [
'route' => ['categories.index', 'search=type:income'] 'route' => ['categories.index', 'search=type:income enabled:1'],
], ],
'parent_id', 'parent_id',
'recurring' => [ 'recurring' => [

View File

@ -316,7 +316,7 @@ export default {
}, },
onInput() { onInput() {
window.axios.get(this.searchRoute + '?search="' + this.search + '" limit:10') window.axios.get(this.searchRoute + '?search="' + this.search + '" enabled:1 limit:10')
.then(response => { .then(response => {
this.contact_list = []; this.contact_list = [];

View File

@ -331,7 +331,7 @@ export default {
}, },
async fetchMatchedItems() { async fetchMatchedItems() {
await window.axios.get(url + '/common/items?search=enabled:1 "' + this.search + '" limit:10') await window.axios.get(url + '/common/items?search="' + this.search + '" enabled:1 limit:10')
.then(response => { .then(response => {
this.item_list = []; this.item_list = [];
let items = response.data.data; let items = response.data.data;
@ -524,6 +524,7 @@ export default {
sortedItems() { sortedItems() {
return this.sortItems(); return this.sortItems();
}, },
currentIndex() { currentIndex() {
return this.$root.form.items.length; return this.$root.form.items.length;
}, },

View File

@ -27,7 +27,7 @@
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }} {{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item']) }} {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item enabled:1']) }}
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), 'plus', ['dropzone-class' => 'form-file']) }} {{ Form::fileGroup('picture', trans_choice('general.pictures', 1), 'plus', ['dropzone-class' => 'form-file']) }}

View File

@ -28,7 +28,7 @@
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }} {{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item']) }} {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item enabled:1']) }}
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file'], $item->picture) }} {{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file'], $item->picture) }}

View File

@ -23,7 +23,7 @@
@if (!$hideCategory) @if (!$hideCategory)
<div class="{{ $more_class }}"> <div class="{{ $more_class }}">
@if (!$hideCategory) @if (!$hideCategory)
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $document->category_id ?? setting('default.' . $categoryType . '_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=' . $categoryType, 'remote_action' => route('categories.index'). '?search=type:' . $categoryType], $more_form_class) }} {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $document->category_id ?? setting('default.' . $categoryType . '_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=' . $categoryType, 'remote_action' => route('categories.index'). '?search=type:' . $categoryType . ' enabled:1'], $more_form_class) }}
@endif @endif
</div> </div>
@else @else

View File

@ -18,7 +18,7 @@
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }} {{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
{{ Form::selectRemoteGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['remote_action' => route('categories.index'). '?search=type:item']) }} {{ Form::selectRemoteGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['remote_action' => route('categories.index'). '?search=type:item enabled:1']) }}
{!! Form::hidden('enabled', '1', []) !!} {!! Form::hidden('enabled', '1', []) !!}
</div> </div>

View File

@ -30,7 +30,7 @@
{{ Form::textareaGroup('description', trans('general.description')) }} {{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.expense_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?search=type:expense']) }} {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.expense_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?search=type:expense enabled:1']) }}
{{ Form::recurring('create') }} {{ Form::recurring('create') }}

View File

@ -49,7 +49,7 @@
{{ Form::textareaGroup('description', trans('general.description')) }} {{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?search=type:expense']) }} {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?search=type:expense enabled:1']) }}
{{ Form::recurring('edit', $payment) }} {{ Form::recurring('edit', $payment) }}

View File

@ -30,7 +30,7 @@
{{ Form::textareaGroup('description', trans('general.description')) }} {{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.income_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?search=type:income']) }} {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.income_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?search=type:income enabled:1']) }}
{{ Form::recurring('create') }} {{ Form::recurring('create') }}

View File

@ -49,7 +49,7 @@
{{ Form::textareaGroup('description', trans('general.description')) }} {{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?search=type:income']) }} {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?search=type:income enabled:1']) }}
{{ Form::recurring('edit', $revenue) }} {{ Form::recurring('edit', $revenue) }}

View File

@ -22,9 +22,9 @@
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), []) }} {{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), []) }}
{{ Form::selectRemoteGroup('income_category', trans('settings.default.income_category'), 'folder', $sales_categories, setting('default.income_category'), ['remote_action' => route('categories.index'). '?search=type:income']) }} {{ Form::selectRemoteGroup('income_category', trans('settings.default.income_category'), 'folder', $sales_categories, setting('default.income_category'), ['remote_action' => route('categories.index'). '?search=type:income enabled:1']) }}
{{ Form::selectRemoteGroup('expense_category', trans('settings.default.expense_category'), 'folder', $purchases_categories, setting('default.expense_category'), ['remote_action' => route('categories.index'). '?search=type:expense']) }} {{ Form::selectRemoteGroup('expense_category', trans('settings.default.expense_category'), 'folder', $purchases_categories, setting('default.expense_category'), ['remote_action' => route('categories.index'). '?search=type:expense enabled:1']) }}
{{ Form::selectGroup('tax', trans_choice('general.taxes', 1), 'percent', $taxes, setting('default.tax'), []) }} {{ Form::selectGroup('tax', trans_choice('general.taxes', 1), 'percent', $taxes, setting('default.tax'), []) }}