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

View File

@ -316,7 +316,7 @@ export default {
},
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 => {
this.contact_list = [];

View File

@ -331,7 +331,7 @@ export default {
},
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 => {
this.item_list = [];
let items = response.data.data;
@ -390,7 +390,7 @@ export default {
price: 0,
tax_ids: [],
};
this.newItems.push(item);
this.addItem(item, 'newItem');
@ -524,6 +524,7 @@ export default {
sortedItems() {
return this.sortItems();
},
currentIndex() {
return this.$root.form.items.length;
},
@ -559,6 +560,6 @@ export default {
<style scoped>
.highlightItem:first-child {
background-color: #F5F7FA;
background-color: #F5F7FA;
}
</style>

View File

@ -27,7 +27,7 @@
{{ 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']) }}

View File

@ -28,7 +28,7 @@
{{ 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) }}

View File

@ -23,7 +23,7 @@
@if (!$hideCategory)
<div class="{{ $more_class }}">
@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
</div>
@else

View File

@ -18,7 +18,7 @@
{{ 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', []) !!}
</div>

View File

@ -30,7 +30,7 @@
{{ 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') }}

View File

@ -49,7 +49,7 @@
{{ 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) }}

View File

@ -30,7 +30,7 @@
{{ 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') }}

View File

@ -49,7 +49,7 @@
{{ 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) }}

View File

@ -22,9 +22,9 @@
{{ 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'), []) }}