Merge branch 'akaunting:master' into master
This commit is contained in:
commit
e0452ddc7f
@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers\Settings;
|
namespace App\Http\Controllers\Settings;
|
||||||
|
|
||||||
use App\Abstracts\Http\SettingController;
|
use App\Abstracts\Http\SettingController;
|
||||||
|
use App\Models\Banking\Account;
|
||||||
use App\Models\Setting\Category;
|
use App\Models\Setting\Category;
|
||||||
use App\Models\Setting\Tax;
|
use App\Models\Setting\Tax;
|
||||||
|
|
||||||
@ -10,6 +11,8 @@ class Defaults extends SettingController
|
|||||||
{
|
{
|
||||||
public function edit()
|
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();
|
$sales_categories = Category::income()->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||||
|
|
||||||
$sale_category_id = setting('default.income_category');
|
$sale_category_id = setting('default.income_category');
|
||||||
@ -37,6 +40,7 @@ class Defaults extends SettingController
|
|||||||
$taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id');
|
$taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id');
|
||||||
|
|
||||||
return view('settings.default.edit', compact(
|
return view('settings.default.edit', compact(
|
||||||
|
'accounts',
|
||||||
'sales_categories',
|
'sales_categories',
|
||||||
'purchases_categories',
|
'purchases_categories',
|
||||||
'taxes',
|
'taxes',
|
||||||
|
@ -32,7 +32,7 @@ class Tax extends FormRequest
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'rate' => 'required|min:0|max:100',
|
'rate' => 'required|numeric|min:0|max:100',
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'enabled' => $enabled,
|
'enabled' => $enabled,
|
||||||
];
|
];
|
||||||
|
@ -31,6 +31,13 @@ class DeleteCategory extends Job implements ShouldDelete
|
|||||||
*/
|
*/
|
||||||
public function authorize(): void
|
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
|
// Can not delete the last category by type
|
||||||
if (Category::where('type', $this->model->type)->count() == 1) {
|
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))]);
|
$message = trans('messages.error.last_category', ['type' => strtolower(trans_choice('general.' . $this->model->type . 's', 1))]);
|
||||||
|
@ -331,7 +331,7 @@ trait Import
|
|||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'company_id' => company_id(),
|
'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'],
|
'name' => $row['item_name'],
|
||||||
'description' => !empty($row['item_description']) ? $row['item_description'] : null,
|
'description' => !empty($row['item_description']) ? $row['item_description'] : null,
|
||||||
'sale_price' => !empty($row['sale_price']) ? $row['sale_price'] : (!empty($row['price']) ? $row['price'] : 0),
|
'sale_price' => !empty($row['sale_price']) ? $row['sale_price'] : (!empty($row['price']) ? $row['price'] : 0),
|
||||||
|
@ -130,7 +130,7 @@ class Menu extends Presenter
|
|||||||
{
|
{
|
||||||
$id = Str::slug($item->title);
|
$id = Str::slug($item->title);
|
||||||
|
|
||||||
return '<details class="relative">
|
return '<details class="relative" ' . $this->getActiveStateOnChild($item) . '>
|
||||||
<summary class="' . $this->getClass($item). '" href="#navbar-' . $id . '" aria-controls="navbar-' . $id . '">
|
<summary class="' . $this->getClass($item). '" href="#navbar-' . $id . '" aria-controls="navbar-' . $id . '">
|
||||||
<div class="pb-2.5 flex items-center cursor-pointer text-purple text-sm '. $this->getActiveState($item) .'">
|
<div class="pb-2.5 flex items-center cursor-pointer text-purple text-sm '. $this->getActiveState($item) .'">
|
||||||
' . $this->getIcon($item) . '
|
' . $this->getIcon($item) . '
|
||||||
|
Binary file not shown.
@ -22,6 +22,7 @@
|
|||||||
:config="dateConfig"
|
: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"
|
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"
|
v-model="real_model"
|
||||||
|
:placeholder="placeholder"
|
||||||
@input="change"
|
@input="change"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:disabled="disabled">
|
:disabled="disabled">
|
||||||
|
@ -13,7 +13,7 @@ export default {
|
|||||||
new BrowserTracing({
|
new BrowserTracing({
|
||||||
tracingOrigins: [],
|
tracingOrigins: [],
|
||||||
}),
|
}),
|
||||||
new Sentry.Replay()
|
//new Sentry.Replay()
|
||||||
],
|
],
|
||||||
// Set tracesSampleRate to 1.0 to capture 100%
|
// Set tracesSampleRate to 1.0 to capture 100%
|
||||||
// of transactions for performance monitoring.
|
// 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
|
// 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
|
// 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
|
// If the entire session is not sampled, use the below sample rate to sample
|
||||||
// sessions when an error occurs.
|
// 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({
|
Sentry.setUser({
|
||||||
|
@ -25,7 +25,8 @@ return [
|
|||||||
'not_user_company' => 'Error: You are not allowed to manage this company!',
|
'not_user_company' => 'Error: You are not allowed to manage this company!',
|
||||||
'customer' => 'Error: User not created! :name already uses this email address.',
|
'customer' => 'Error: User not created! :name already uses this email address.',
|
||||||
'no_file' => 'Error: No file selected!',
|
'no_file' => 'Error: No file selected!',
|
||||||
'last_category' => 'Error: Can not delete the last :type category!',
|
'last_category' => 'Error: Can not delete the last <b>:type</b> category!',
|
||||||
|
'transfer_category' => 'Error: Can not delete the transfer <b>:type</b> category!',
|
||||||
'change_type' => 'Error: Can not change the type because it has :text related!',
|
'change_type' => 'Error: Can not change the type because it has :text related!',
|
||||||
'invalid_apikey' => 'Error: The API Key entered is invalid!',
|
'invalid_apikey' => 'Error: The API Key entered is invalid!',
|
||||||
'import_column' => 'Error: :message Column name: :column. Line number: :line.',
|
'import_column' => 'Error: :message Column name: :column. Line number: :line.',
|
||||||
|
@ -8,7 +8,14 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div data-swiper="{{ $slides }}" x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }">
|
<div
|
||||||
|
data-swiper="{{ $slides }}"
|
||||||
|
@if(! $attributes->has('ignore-hash'))
|
||||||
|
x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }"
|
||||||
|
@else
|
||||||
|
x-data="{ active: '{{ $active }}' }"
|
||||||
|
@endif
|
||||||
|
>
|
||||||
<div data-tabs-swiper>
|
<div data-tabs-swiper>
|
||||||
<ul data-tabs-swiper-wrapper {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'inline-flex overflow-x-scroll large-overflow-unset']) : $attributes }}>
|
<ul data-tabs-swiper-wrapper {{ ((! $attributes->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 !!}
|
{!! $navs !!}
|
||||||
|
@ -17,21 +17,23 @@
|
|||||||
<x-form.group.color name="color" label="{{ trans('general.color') }}" />
|
<x-form.group.color name="color" label="{{ trans('general.color') }}" />
|
||||||
|
|
||||||
@if ($type_disabled)
|
@if ($type_disabled)
|
||||||
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" disabled />
|
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" v-disabled="true" />
|
||||||
|
|
||||||
<input type="hidden" name="type" value="{{ $category->type }}" />
|
<input type="hidden" name="type" value="{{ $category->type }}" />
|
||||||
@else
|
@else
|
||||||
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" change="updateParentCategories" />
|
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" change="updateParentCategories" />
|
||||||
@endif
|
|
||||||
|
|
||||||
<x-form.group.select name="parent_id" label="{{ trans('general.parent') . ' ' . trans_choice('general.categories', 1) }}" :options="$parent_categories" not-required dynamicOptions="categoriesBasedTypes" sort-options="false" />
|
<x-form.group.select name="parent_id" label="{{ trans('general.parent') . ' ' . trans_choice('general.categories', 1) }}" :options="$parent_categories" not-required dynamicOptions="categoriesBasedTypes" sort-options="false" />
|
||||||
|
|
||||||
<x-form.input.hidden name="parent_category_id" value="{{ $category->parent_id }}" />
|
<x-form.input.hidden name="parent_category_id" value="{{ $category->parent_id }}" />
|
||||||
<x-form.input.hidden name="categories" value="{{ json_encode($categories) }}" />
|
<x-form.input.hidden name="categories" value="{{ json_encode($categories) }}" />
|
||||||
|
@endif
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-form.section>
|
</x-form.section>
|
||||||
|
|
||||||
|
@if (! $type_disabled)
|
||||||
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
|
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
|
||||||
|
@endif
|
||||||
|
|
||||||
@can('update-settings-categories')
|
@can('update-settings-categories')
|
||||||
<x-form.section>
|
<x-form.section>
|
||||||
|
@ -67,7 +67,11 @@
|
|||||||
@foreach($categories as $item)
|
@foreach($categories as $item)
|
||||||
<x-table.tr href="{{ route('categories.edit', $item->id) }}">
|
<x-table.tr href="{{ route('categories.edit', $item->id) }}">
|
||||||
<x-table.td kind="bulkaction">
|
<x-table.td kind="bulkaction">
|
||||||
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
|
<x-index.bulkaction.single
|
||||||
|
id="{{ $item->id }}"
|
||||||
|
name="{{ $item->name }}"
|
||||||
|
:disabled="($item->isTransferCategory()) ? true : false"
|
||||||
|
/>
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
|
|
||||||
<x-table.td class="w-5/12">
|
<x-table.td class="w-5/12">
|
||||||
|
@ -10,7 +10,13 @@
|
|||||||
</x-slot>
|
</x-slot>
|
||||||
|
|
||||||
<x-slot name="body">
|
<x-slot name="body">
|
||||||
<x-form.group.account name="account" not-required without-change />
|
<x-form.group.select
|
||||||
|
name="account"
|
||||||
|
label="{{ trans_choice('general.accounts', 1) }}"
|
||||||
|
:options="$accounts"
|
||||||
|
:selected="setting('default.account')"
|
||||||
|
not-required
|
||||||
|
/>
|
||||||
|
|
||||||
<x-form.group.currency name="currency" not-required />
|
<x-form.group.currency name="currency" not-required />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user