diff --git a/app/BulkActions/Settings/Categories.php b/app/BulkActions/Settings/Categories.php index ed63dd003..77afe39c0 100644 --- a/app/BulkActions/Settings/Categories.php +++ b/app/BulkActions/Settings/Categories.php @@ -39,6 +39,19 @@ class Categories extends BulkAction ], ]; + public function getSelectedRecords($request, $relationships = null) + { + if (empty($relationships)) { + $model = $this->model::query(); + } else { + $relationships = Arr::wrap($relationships); + + $model = $this->model::with($relationships); + } + + return $model->getWithoutChildren()->find($this->getSelectedInput($request)); + } + public function disable($request) { $categories = $this->getSelectedRecords($request); diff --git a/app/Http/Livewire/Menu/Notifications.php b/app/Http/Livewire/Menu/Notifications.php index 6b11c30dc..12b1df15b 100644 --- a/app/Http/Livewire/Menu/Notifications.php +++ b/app/Http/Livewire/Menu/Notifications.php @@ -91,7 +91,7 @@ class Notifications extends Component public function getNotifications(): array { $notifications = new \stdClass(); - $notifications->notifications = []; + $notifications->notifications = collect(); $notifications->keyword = $this->keyword; event(new NotificationsCreated($notifications)); diff --git a/app/Models/Common/Item.php b/app/Models/Common/Item.php index 2599e5e33..77091aac6 100644 --- a/app/Models/Common/Item.php +++ b/app/Models/Common/Item.php @@ -4,6 +4,7 @@ namespace App\Models\Common; use App\Abstracts\Model; use App\Models\Document\Document; +use App\Utilities\Str; use App\Traits\Currencies; use App\Traits\Media; use Bkwld\Cloner\Cloneable; @@ -138,6 +139,11 @@ class Item extends Model ->select('items.*'); } + public function getInitialsAttribute($value) + { + return Str::getInitials($this->name); + } + /** * Get the current balance. * diff --git a/app/View/Components/Layouts/Admin/Menu.php b/app/View/Components/Layouts/Admin/Menu.php index ff4a91b49..97c4ba382 100644 --- a/app/View/Components/Layouts/Admin/Menu.php +++ b/app/View/Components/Layouts/Admin/Menu.php @@ -41,7 +41,7 @@ class Menu extends Component { // Get nofitications $notifications = new \stdClass(); - $notifications->notifications = []; + $notifications->notifications = collect(); $notifications->keyword = ''; event(new NotificationsCreated($notifications)); diff --git a/resources/assets/js/components/AkauntingSearch.vue b/resources/assets/js/components/AkauntingSearch.vue index 2c27fe295..ebf00d8bd 100644 --- a/resources/assets/js/components/AkauntingSearch.vue +++ b/resources/assets/js/components/AkauntingSearch.vue @@ -385,12 +385,11 @@ export default { }, onOptionSelected(value) { - this.show_icon = false; this.current_value = value; this.range = false; - - this.dynamicPlaceholder = this.selectPlaceholder; + this.onChangeSearchAndFilterText(this.selectPlaceholder, false); + let option = false; let option_url = false; @@ -522,7 +521,7 @@ export default { this.show_close_icon = true; let select_value = false; - this.dynamicPlaceholder = this.enterPlaceholder; + this.onChangeSearchAndFilterText(this.enterPlaceholder, false); for (let i = 0; i < this.values.length; i++) { if (this.values[i].key == value) { @@ -582,7 +581,7 @@ export default { this.show_date = false; if (this.filter_index == 0) { - this.dynamicPlaceholder = this.defaultPlaceholder; + this.onChangeSearchAndFilterText(this.defaultPlaceholder, true); } this.filter_last_step = 'options'; @@ -597,6 +596,11 @@ export default { this.onInputConfirm(); }, + onChangeSearchAndFilterText(arg, param) { + this.dynamicPlaceholder = arg; + this.show_icon = param; + }, + convertOption(options) { let values = []; @@ -765,6 +769,9 @@ export default { }, mounted() { + if (this.filter_index > 0) { + this.onChangeSearchAndFilterText(this.enterPlaceholder, false); + } }, computed: { diff --git a/resources/assets/js/components/CreditCard/CardForm.vue b/resources/assets/js/components/CreditCard/CardForm.vue index fc9ab38ef..ca079669e 100644 --- a/resources/assets/js/components/CreditCard/CardForm.vue +++ b/resources/assets/js/components/CreditCard/CardForm.vue @@ -260,7 +260,7 @@ v-for="n in 12" v-bind:disabled="n < minCardMonth" v-bind:key="n" - >{{generateMonthValue(n)}} + >{{ generateMonthValue(n) }} @@ -278,7 +278,7 @@ v-bind:value="$index + minCardYear" v-for="(n, $index) in 12" v-bind:key="n" - >{{$index + minCardYear}} + >{{ $index + minCardYear }} @@ -312,7 +312,7 @@ - @else - {{ $category->name }} + + {{ $item->name }} + + @endif + + @if (! $item->enabled) + @endif - @if (! empty($types[$category->type])) - {{ $types[$category->type] }} + @if (! empty($types[$item->type])) + {{ $types[$item->type] }} @else @endif - circle + circle - + - @foreach($category->sub_categories as $sub_category) - @include('settings.categories.sub_category', ['parent_category' => $category, 'sub_category' => $sub_category, 'tree_level' => 1]) + @foreach($item->sub_categories as $sub_category) + @include('settings.categories.sub_category', ['parent_category' => $item, 'sub_category' => $sub_category, 'tree_level' => 1]) @endforeach @endforeach diff --git a/resources/views/settings/categories/sub_category.blade.php b/resources/views/settings/categories/sub_category.blade.php index be9afa002..4523c724e 100644 --- a/resources/views/settings/categories/sub_category.blade.php +++ b/resources/views/settings/categories/sub_category.blade.php @@ -28,18 +28,22 @@ {{ $sub_category->name }} @endif + + @if (! $sub_category->enabled) + + @endif - @if (! empty($types[$category->type])) - {{ $types[$category->type] }} + @if (! empty($types[$item->type])) + {{ $types[$item->type] }} @else @endif - circle + circle