diff --git a/app/Http/Controllers/Settings/Defaults.php b/app/Http/Controllers/Settings/Defaults.php index e0e163d8c..2970a72f1 100644 --- a/app/Http/Controllers/Settings/Defaults.php +++ b/app/Http/Controllers/Settings/Defaults.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Settings; use App\Abstracts\Http\SettingController; +use App\Models\Banking\Account; use App\Models\Setting\Category; use App\Models\Setting\Tax; @@ -10,6 +11,8 @@ class Defaults extends SettingController { public function edit() { + $accounts = Account::enabled()->orderBy('name')->get()->pluck('title', 'id'); + $sales_categories = Category::income()->enabled()->orderBy('name')->take(setting('default.select_limit'))->get(); $sale_category_id = setting('default.income_category'); @@ -37,6 +40,7 @@ class Defaults extends SettingController $taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id'); return view('settings.default.edit', compact( + 'accounts', 'sales_categories', 'purchases_categories', 'taxes', diff --git a/app/Http/Requests/Setting/Tax.php b/app/Http/Requests/Setting/Tax.php index b0afe079a..7f257a4b3 100644 --- a/app/Http/Requests/Setting/Tax.php +++ b/app/Http/Requests/Setting/Tax.php @@ -32,7 +32,7 @@ class Tax extends FormRequest return [ 'name' => 'required|string', - 'rate' => 'required|min:0|max:100', + 'rate' => 'required|numeric|min:0|max:100', 'type' => $type, 'enabled' => $enabled, ]; diff --git a/app/Jobs/Setting/DeleteCategory.php b/app/Jobs/Setting/DeleteCategory.php index 24e855f33..e8a3be56d 100644 --- a/app/Jobs/Setting/DeleteCategory.php +++ b/app/Jobs/Setting/DeleteCategory.php @@ -31,6 +31,13 @@ class DeleteCategory extends Job implements ShouldDelete */ public function authorize(): void { + // Can not delete transfer category + if ($this->model->isTransferCategory()) { + $message = trans('messages.error.transfer_category', ['type' => $this->model->name]); + + throw new \Exception($message); + } + // Can not delete the last category by type if (Category::where('type', $this->model->type)->count() == 1) { $message = trans('messages.error.last_category', ['type' => strtolower(trans_choice('general.' . $this->model->type . 's', 1))]); diff --git a/app/Traits/Import.php b/app/Traits/Import.php index 5af5dc13c..b289dcf2c 100644 --- a/app/Traits/Import.php +++ b/app/Traits/Import.php @@ -331,7 +331,7 @@ trait Import $data = [ 'company_id' => company_id(), - 'type' => $row['item_type'], + 'type' => !empty($row['item_type']) ? $row['item_type'] : (!empty($row['type']) ? $row['type'] : 'product'), 'name' => $row['item_name'], 'description' => !empty($row['item_description']) ? $row['item_description'] : null, 'sale_price' => !empty($row['sale_price']) ? $row['sale_price'] : (!empty($row['price']) ? $row['price'] : 0), diff --git a/app/View/Presenters/Menu.php b/app/View/Presenters/Menu.php index 2d87b555d..8c28cb582 100644 --- a/app/View/Presenters/Menu.php +++ b/app/View/Presenters/Menu.php @@ -130,7 +130,7 @@ class Menu extends Presenter { $id = Str::slug($item->title); - return '
+ return '
getActiveStateOnChild($item) . '>
' . $this->getIcon($item) . ' diff --git a/public/files/import/items.xlsx b/public/files/import/items.xlsx index be028ee45..ec676b2e9 100644 Binary files a/public/files/import/items.xlsx and b/public/files/import/items.xlsx differ diff --git a/resources/assets/js/components/AkauntingDate.vue b/resources/assets/js/components/AkauntingDate.vue index 7e5665406..12f92313c 100644 --- a/resources/assets/js/components/AkauntingDate.vue +++ b/resources/assets/js/components/AkauntingDate.vue @@ -22,6 +22,7 @@ :config="dateConfig" class="datepicker w-full text-sm px-3 py-2.5 mt-1 rounded-lg border border-light-gray text-black placeholder-light-gray bg-white disabled:bg-gray-200 focus:outline-none focus:ring-transparent focus:border-purple" v-model="real_model" + :placeholder="placeholder" @input="change" :readonly="readonly" :disabled="disabled"> diff --git a/resources/assets/js/exceptions/trackers/sentry.js b/resources/assets/js/exceptions/trackers/sentry.js index 1e656686b..569f74c0f 100644 --- a/resources/assets/js/exceptions/trackers/sentry.js +++ b/resources/assets/js/exceptions/trackers/sentry.js @@ -13,7 +13,7 @@ export default { new BrowserTracing({ tracingOrigins: [], }), - new Sentry.Replay() + //new Sentry.Replay() ], // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. @@ -22,11 +22,11 @@ export default { // This sets the sample rate to be 10%. You may want this to be 100% while // in development and sample at a lower rate in production - replaysSessionSampleRate: exception_tracker.params.replays_session_sample_rate, + //replaysSessionSampleRate: exception_tracker.params.replays_session_sample_rate, // If the entire session is not sampled, use the below sample rate to sample // sessions when an error occurs. - replaysOnErrorSampleRate: exception_tracker.params.replays_on_error_sample_rate, + //replaysOnErrorSampleRate: exception_tracker.params.replays_on_error_sample_rate, }); Sentry.setUser({ diff --git a/resources/lang/en-GB/messages.php b/resources/lang/en-GB/messages.php index 4652bc0cc..c29678f85 100644 --- a/resources/lang/en-GB/messages.php +++ b/resources/lang/en-GB/messages.php @@ -25,7 +25,8 @@ return [ 'not_user_company' => 'Error: You are not allowed to manage this company!', 'customer' => 'Error: User not created! :name already uses this email address.', 'no_file' => 'Error: No file selected!', - 'last_category' => 'Error: Can not delete the last :type category!', + 'last_category' => 'Error: Can not delete the last :type category!', + 'transfer_category' => 'Error: Can not delete the transfer :type category!', 'change_type' => 'Error: Can not change the type because it has :text related!', 'invalid_apikey' => 'Error: The API Key entered is invalid!', 'import_column' => 'Error: :message Column name: :column. Line number: :line.', diff --git a/resources/views/components/tabs/index.blade.php b/resources/views/components/tabs/index.blade.php index f2d33fb8c..fb05cf596 100644 --- a/resources/views/components/tabs/index.blade.php +++ b/resources/views/components/tabs/index.blade.php @@ -8,7 +8,14 @@ } @endphp -
+
has('ignore-hash')) + x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }" + @else + x-data="{ active: '{{ $active }}' }" + @endif +>
    has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'inline-flex overflow-x-scroll large-overflow-unset']) : $attributes }}> {!! $navs !!} diff --git a/resources/views/settings/categories/edit.blade.php b/resources/views/settings/categories/edit.blade.php index 9ffc7fc75..f3ad8fefd 100644 --- a/resources/views/settings/categories/edit.blade.php +++ b/resources/views/settings/categories/edit.blade.php @@ -17,21 +17,23 @@ @if ($type_disabled) - + @else + + + + + @endif - - - - - + @if (! $type_disabled) + @endif @can('update-settings-categories') diff --git a/resources/views/settings/categories/index.blade.php b/resources/views/settings/categories/index.blade.php index cc8d40158..c67bcf8ed 100644 --- a/resources/views/settings/categories/index.blade.php +++ b/resources/views/settings/categories/index.blade.php @@ -67,7 +67,11 @@ @foreach($categories as $item) - + diff --git a/resources/views/settings/default/edit.blade.php b/resources/views/settings/default/edit.blade.php index 3c9623a12..aa197e970 100644 --- a/resources/views/settings/default/edit.blade.php +++ b/resources/views/settings/default/edit.blade.php @@ -10,7 +10,13 @@ - +