diff --git a/app/Listeners/Report/AddExpenseCategories.php b/app/Listeners/Report/AddExpenseCategories.php index fcd38dd08..321317b66 100644 --- a/app/Listeners/Report/AddExpenseCategories.php +++ b/app/Listeners/Report/AddExpenseCategories.php @@ -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']; } /** diff --git a/app/Listeners/Report/AddIncomeCategories.php b/app/Listeners/Report/AddIncomeCategories.php index 2896cc3f8..123a17738 100644 --- a/app/Listeners/Report/AddIncomeCategories.php +++ b/app/Listeners/Report/AddIncomeCategories.php @@ -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']; } /** diff --git a/app/Listeners/Report/AddIncomeExpenseCategories.php b/app/Listeners/Report/AddIncomeExpenseCategories.php index 010ca0589..36cf97347 100644 --- a/app/Listeners/Report/AddIncomeExpenseCategories.php +++ b/app/Listeners/Report/AddIncomeExpenseCategories.php @@ -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']; } /** diff --git a/config/search-string.php b/config/search-string.php index 9b070ba9d..1c9276edf 100644 --- a/config/search-string.php +++ b/config/search-string.php @@ -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' => [ diff --git a/resources/assets/js/components/AkauntingContactCard.vue b/resources/assets/js/components/AkauntingContactCard.vue index b170c48a5..bcff25a44 100644 --- a/resources/assets/js/components/AkauntingContactCard.vue +++ b/resources/assets/js/components/AkauntingContactCard.vue @@ -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 = []; diff --git a/resources/assets/js/components/AkauntingItemButton.vue b/resources/assets/js/components/AkauntingItemButton.vue index e85401ba3..ef5e0896d 100644 --- a/resources/assets/js/components/AkauntingItemButton.vue +++ b/resources/assets/js/components/AkauntingItemButton.vue @@ -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 { diff --git a/resources/views/common/items/create.blade.php b/resources/views/common/items/create.blade.php index 924561481..615bcb055 100644 --- a/resources/views/common/items/create.blade.php +++ b/resources/views/common/items/create.blade.php @@ -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']) }} diff --git a/resources/views/common/items/edit.blade.php b/resources/views/common/items/edit.blade.php index 9c79991b1..9c46a09d8 100644 --- a/resources/views/common/items/edit.blade.php +++ b/resources/views/common/items/edit.blade.php @@ -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) }} diff --git a/resources/views/components/documents/form/advanced.blade.php b/resources/views/components/documents/form/advanced.blade.php index 3cdb31fd0..9bb2dd439 100644 --- a/resources/views/components/documents/form/advanced.blade.php +++ b/resources/views/components/documents/form/advanced.blade.php @@ -23,7 +23,7 @@ @if (!$hideCategory)