Merge branch '2.1-dev' of github.com:akaunting/akaunting into search-filter

# Conflicts:
#	resources/assets/js/components/AkauntingSearch.vue
This commit is contained in:
Cüneyt Şentürk 2020-11-10 22:25:03 +03:00
commit d4a3f9c1a3
35 changed files with 764 additions and 1526 deletions

View File

@ -58,7 +58,7 @@ class Users extends Controller
return $r->hasPermission('read-client-portal');
});
$companies = user()->companies()->take(10)->get()->sortBy('name')->pluck('name', 'id');
$companies = user()->companies()->take(setting('default.select_limit'))->get()->sortBy('name')->pluck('name', 'id');
return view('auth.users.create', compact('roles', 'companies', 'landing_pages'));
}
@ -123,7 +123,7 @@ class Users extends Controller
});
}
$companies = user()->companies()->take(10)->get()->sortBy('name')->pluck('name', 'id');
$companies = user()->companies()->take(setting('default.select_limit'))->get()->sortBy('name')->pluck('name', 'id');
return view('auth.users.edit', compact('user', 'companies', 'roles', 'landing_pages'));
}

View File

@ -22,7 +22,7 @@ class Transactions extends Controller
{
$accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');
$types = collect(['expense' => 'Expense', 'income' => 'Income'])
$types = collect(['expense' => trans_choice('general.expenses', 1), 'income' => trans_choice('general.incomes', 1)])
->prepend(trans('general.all_type', ['type' => trans_choice('general.types', 2)]), '');
$request_type = !request()->has('type') ? ['income', 'expense'] : request('type');

View File

@ -50,9 +50,9 @@ class Items extends Controller
*/
public function create()
{
$categories = Category::item()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::item()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id');
$taxes = Tax::enabled()->orderBy('name')->get()->take(setting('default.select_limit'))->pluck('title', 'id');
return view('common.items.create', compact('categories', 'taxes'));
}

View File

@ -30,7 +30,7 @@ class Items extends Controller
*/
public function create(IRequest $request)
{
$categories = Category::item()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::item()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id');

View File

@ -39,13 +39,7 @@ class Bills extends Controller
{
$bills = Bill::with('contact', 'transactions')->collect(['billed_at'=> 'desc']);
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->pluck('name', 'id');
$statuses = $this->getBillStatuses();
return $this->response('purchases.bills.index', compact('bills', 'vendors', 'categories', 'statuses'));
return $this->response('purchases.bills.index', compact('bills'));
}
/**
@ -96,7 +90,7 @@ class Bills extends Controller
*/
public function create()
{
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
$vendors = Contact::vendor()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
@ -106,7 +100,7 @@ class Bills extends Controller
$taxes = Tax::enabled()->orderBy('name')->get();
$categories = Category::expense()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$number = $this->getNextBillNumber();
@ -192,7 +186,7 @@ class Bills extends Controller
*/
public function edit(Bill $bill)
{
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
$vendors = Contact::vendor()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
@ -202,7 +196,7 @@ class Bills extends Controller
$taxes = Tax::enabled()->orderBy('name')->get();
$categories = Category::expense()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
return view('purchases.bills.edit', compact('bill', 'vendors', 'currencies', 'currency', 'items', 'taxes', 'categories'));
}

View File

@ -32,13 +32,7 @@ class Payments extends Controller
{
$payments = Transaction::with('account', 'bill', 'category', 'contact')->expense()->isNotTransfer()->collect(['paid_at'=> 'desc']);
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->pluck('name', 'id');
$accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');
return $this->response('purchases.payments.index', compact('payments', 'vendors', 'categories', 'accounts'));
return $this->response('purchases.payments.index', compact('payments'));
}
/**
@ -66,9 +60,9 @@ class Payments extends Controller
$currency = Currency::where('code', $account_currency_code)->first();
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
$vendors = Contact::vendor()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$payment_methods = Modules::getPaymentMethods();
@ -154,9 +148,9 @@ class Payments extends Controller
$currency = Currency::where('code', $payment->currency_code)->first();
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
$vendors = Contact::vendor()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::expense()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$payment_methods = Modules::getPaymentMethods();

View File

@ -40,13 +40,7 @@ class Invoices extends Controller
{
$invoices = Invoice::with('contact', 'transactions')->collect(['invoice_number'=> 'desc']);
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');
$statuses = $this->getInvoiceStatuses();
return $this->response('sales.invoices.index', compact('invoices', 'customers', 'categories', 'statuses'));
return $this->response('sales.invoices.index', compact('invoices'));
}
/**
@ -99,7 +93,7 @@ class Invoices extends Controller
*/
public function create()
{
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
$customers = Contact::customer()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
@ -109,7 +103,7 @@ class Invoices extends Controller
$taxes = Tax::enabled()->orderBy('name')->get();
$categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$number = $this->getNextInvoiceNumber();
@ -195,7 +189,7 @@ class Invoices extends Controller
*/
public function edit(Invoice $invoice)
{
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
$customers = Contact::customer()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
@ -205,7 +199,7 @@ class Invoices extends Controller
$taxes = Tax::enabled()->orderBy('name')->get();
$categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
return view('sales.invoices.edit', compact('invoice', 'customers', 'currencies', 'currency', 'items', 'taxes', 'categories'));
}

View File

@ -32,13 +32,7 @@ class Revenues extends Controller
{
$revenues = Transaction::with('account', 'category', 'contact', 'invoice')->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');
$accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');
return $this->response('sales.revenues.index', compact('revenues', 'customers', 'categories', 'accounts'));
return $this->response('sales.revenues.index', compact('revenues'));
}
/**
@ -66,9 +60,9 @@ class Revenues extends Controller
$currency = Currency::where('code', $account_currency_code)->first();
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
$customers = Contact::customer()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$payment_methods = Modules::getPaymentMethods();
@ -154,9 +148,9 @@ class Revenues extends Controller
$currency = Currency::where('code', $revenue->currency_code)->first();
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
$customers = Contact::customer()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');
$categories = Category::income()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$payment_methods = Modules::getPaymentMethods();

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Settings;
use App\Abstracts\Http\Controller;
use App\Models\Banking\Account;
use App\Models\Setting\Category;
use App\Models\Setting\Currency;
use App\Models\Setting\Tax;
use App\Utilities\Modules;
@ -16,6 +17,9 @@ class Defaults extends Controller
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code');
$sales_categories = Category::income()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$purchases_categories = Category::expense()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
$taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id');
$payment_methods = Modules::getPaymentMethods();
@ -23,6 +27,8 @@ class Defaults extends Controller
return view('settings.default.edit', compact(
'accounts',
'currencies',
'sales_categories',
'purchases_categories',
'taxes',
'payment_methods'
));

View File

@ -4,6 +4,9 @@ namespace App\Listeners\Update\V21;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Models\Setting\Category;
use App\Models\Common\Company;
use App\Utilities\Overrider;
use Illuminate\Support\Facades\Artisan;
class Version210 extends Listener
@ -24,6 +27,42 @@ class Version210 extends Listener
return;
}
$this->updateCompanies();
Artisan::call('migrate', ['--force' => true]);
}
protected function updateCompanies()
{
$company_id = session('company_id');
$companies = Company::cursor();
foreach ($companies as $company) {
session(['company_id' => $company->id]);
$this->updateSettings($company);
}
setting()->forgetAll();
session(['company_id' => $company_id]);
Overrider::load('settings');
}
public function updateSettings($company)
{
$income_category = Category::income()->enabled()->first();
$expense_category = Category::expense()->enabled()->first();
// Set the active company settings
setting()->setExtraColumns(['company_id' => $company->id]);
setting()->forgetAll();
setting()->load(true);
setting()->set(['default.income_category' => setting('default.income_category', $income_category->id)]);
setting()->set(['default.expense_category' => setting('default.expense_category', $expense_category->id)]);
setting()->save();
}
}

View File

@ -59,6 +59,10 @@ class Form extends Provider
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('multiSelectRemoteAddNewGroup', 'partials.form.multi_select_remote_add_new_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required', 'path' => ''], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('selectGroup', 'partials.form.select_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
@ -79,6 +83,10 @@ class Form extends Provider
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('selectRemoteAddNewGroup', 'partials.form.select_remote_add_new_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required', 'path' => ''], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('textareaGroup', 'partials.form.textarea_group', [
'name', 'text', 'icon', 'value' => null, 'attributes' => ['rows' => '3'], 'col' => 'col-md-12', 'group_class' => null
]);

View File

@ -120,6 +120,7 @@ return [
'locale' => env('SETTING_FALLBACK_DEFAULT_LOCALE', 'en-GB'),
'list_limit' => env('SETTING_FALLBACK_DEFAULT_LIST_LIMIT', '25'),
'payment_method' => env('SETTING_FALLBACK_DEFAULT_PAYMENT_METHOD', 'offline-payments.cash.1'),
'select_limit' => env('SETTING_FALLBACK_DEFAULT_SELECT_LIMIT', '10'),
],
'email' => [
'protocol' => env('SETTING_FALLBACK_EMAIL_PROTOCOL', 'mail'),

View File

@ -64,8 +64,26 @@ class Categories extends Seeder
],
];
$income_category = $expense_category = false;
foreach ($rows as $row) {
Category::create($row);
$category = Category::create($row);
switch ($category->type) {
case 'income':
if (empty($income_category)) {
$income_category = $category;
}
break;
case 'expense':
if (empty($expense_category)) {
$expense_category = $category;
}
break;
}
}
setting()->set('default.income_category', $income_category->id);
setting()->set('default.expense_category', $expense_category->id);
}
}

View File

@ -151,7 +151,7 @@ export default {
onInput(evt) {
this.search = evt.target.value;
let option_url = this.selected_options[this.filter_index].url;
if (this.search) {
@ -202,7 +202,7 @@ export default {
args += this.selected_options[index].key + ':' + this.selected_values[index].key + ' ';
serach_string[path][this.selected_options[index].key] = {
'key': this.selected_values[index].key,
'value': this.selected_values[index].value
@ -300,7 +300,7 @@ export default {
this.filter_last_step = 'values';
},
onValueSelected(value) {
let select_value = false;
@ -453,7 +453,7 @@ export default {
return this.filter_list.filter(option => {
return option.value.toLowerCase().includes(this.search.toLowerCase())
});
});
},
filteredValues() {
@ -586,4 +586,4 @@ export default {
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
</style>
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,8 @@ return [
'description' => 'Default account, currency, language of your company',
'list_limit' => 'Records Per Page',
'use_gravatar' => 'Use Gravatar',
'income_category' => 'Income Category',
'expense_category' => 'Expense Category',
],
'email' => [

View File

@ -48,7 +48,7 @@
@endif
@can('read-common-companies')
{{ Form::multiSelectRemoteGroup('companies', trans_choice('general.companies', 2), 'user', $companies, [], ['required' => 'required', 'remote_action' => route('companies.autocomplete'), 'remote_type' => 'company']) }}
{{ Form::multiSelectRemoteGroup('companies', trans_choice('general.companies', 2), 'user', $companies, [], ['required' => 'required', 'remote_action' => route('companies.index')]) }}
@endcan
@can('read-auth-roles')

View File

@ -49,7 +49,7 @@
@endif
@can('read-common-companies')
{{ Form::multiSelectRemoteGroup('companies', trans_choice('general.companies', 2), 'user', $companies, $user->company_ids, ['required' => 'required', 'disabled' => (in_array('customer', $user->roles()->pluck('name')->toArray())) ? 'true' : 'false', 'remote_action' => route('companies.autocomplete'), 'remote_type' => 'company']) }}
{{ Form::multiSelectRemoteGroup('companies', trans_choice('general.companies', 2), 'user', $companies, $user->company_ids, ['required' => 'required', 'disabled' => (in_array('customer', $user->roles()->pluck('name')->toArray())) ? 'true' : 'false', 'remote_action' => route('companies.index')]) }}
@endcan
@can('read-auth-roles')

View File

@ -28,7 +28,7 @@
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['path' => route('modals.categories.create') . '?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'). '?type=item']) }}
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}

View File

@ -18,7 +18,7 @@
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null) }}
{{ Form::selectRemoteGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['remote_action' => route('categories.index'). '?type=item']) }}
{!! Form::hidden('enabled', '1', []) !!}
</div>

View File

@ -0,0 +1,97 @@
@stack($name . '_input_start')
<akaunting-select-remote
class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
id="form-select-{{ $name }}"
@if (!empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
@if (!empty($selected) || old($name))
:value="{{ json_encode(old($name, $selected)) }}"
@endif
@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
:multiple="true"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => [
'key' => isset($attributes['field']['key']) ? $attributes['field']['key'] : 'id',
'value' => isset($attributes['field']['value']) ? $attributes['field']['value'] : 'name'
],
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
]
])}}"
@if (!empty($attributes['collapse']))
:collapse="true"
@endif
@if (!empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (!empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event"
@endif
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (isset($attributes['readonly']))
:readonly="{{ $attributes['readonly'] }}"
@endif
@if (isset($attributes['disabled']))
:disabled="{{ $attributes['disabled'] }}"
@endif
@if (isset($attributes['show']))
v-if="{{ $attributes['show'] }}"
@endif
@if (isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
remote-action="{{ $attributes['remote_action'] }}"
@if (!empty($attributes['currecny_code']))
currency-code="{{ $attributes['currecny_code'] }}"
@endif
loading-text="{{ trans('general.loading') }}"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select-remote>
@stack($name . '_input_end')

View File

@ -62,9 +62,8 @@
@endif
remote-action="{{ $attributes['remote_action'] }}"
remote-type="{{ $attributes['remote_type'] }}"
@if (!empty($attributes['currecny_code']))
@if (!empty($attributes['currecny_code']))
currency-code="{{ $attributes['currecny_code'] }}"
@endif

View File

@ -0,0 +1,91 @@
@stack($name . '_input_start')
<akaunting-select-remote
class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
id="form-select-{{ $name }}"
@if (!empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
@if (isset($selected) || old($name))
value="{{ old($name, $selected) }}"
@endif
@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => [
'key' => isset($attributes['field']['key']) ? $attributes['field']['key'] : 'id',
'value' => isset($attributes['field']['value']) ? $attributes['field']['value'] : 'name'
],
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
]
])}}"
@if (!empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (!empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event"
@endif
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (isset($attributes['readonly']))
:readonly="{{ $attributes['readonly'] }}"
@endif
@if (isset($attributes['disabled']))
:disabled="{{ $attributes['disabled'] }}"
@endif
@if (isset($attributes['show']))
v-if="{{ $attributes['show'] }}"
@endif
@if (isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
remote-action="{{ $attributes['remote_action'] }}"
@if (!empty($attributes['currecny_code']))
currency-code="{{ $attributes['currecny_code'] }}"
@endif
loading-text="{{ trans('general.loading') }}"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select-remote>
@stack($name . '_input_end')

View File

@ -3,6 +3,8 @@
<akaunting-select-remote
class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
id="form-select-{{ $name }}"
@if (!empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
@ -54,9 +56,8 @@
@endif
remote-action="{{ $attributes['remote_action'] }}"
remote-type="'{{ $attributes['remote_type'] }}"
@if (!empty($attributes['currecny_code']))
@if (!empty($attributes['currecny_code']))
currency-code="{{ $attributes['currecny_code'] }}"
@endif

View File

@ -17,7 +17,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, config('general.vendors'), ['required' => 'required', 'path' => route('modals.vendors.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.contact'), ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => 'form.currency_code', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }}
@ -194,7 +194,7 @@
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?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'). '?type=expense']) }}
{{ Form::recurring('create') }}

View File

@ -18,7 +18,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'path' => route('modals.vendors.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $bill->currency_code, ['required' => 'required', 'model' => 'form.currency_code', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }}
@ -195,7 +195,7 @@
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $bill->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense']) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $bill->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?type=expense']) }}
{{ Form::recurring('edit', $bill) }}

View File

@ -64,7 +64,7 @@
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('bills.show', $item->id) }}">{{ trans('general.show') }}</a>
@if (!$item->reconciled)
@if (!$item->reconciled)""
<a class="dropdown-item" href="{{ route('bills.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@endif
<div class="dropdown-divider"></div>

View File

@ -26,11 +26,11 @@
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.vendor'), ['path' => route('modals.vendors.create')]) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.vendor'), ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?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'). '?type=expense']) }}
{{ Form::recurring('create') }}

View File

@ -45,11 +45,11 @@
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, ['path' => route('modals.vendors.create')]) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?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'). '?type=expense']) }}
{{ Form::recurring('edit', $payment) }}

View File

@ -17,7 +17,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, config('general.customers'), ['required' => 'required', 'path' => route('modals.customers.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.customers.create'), 'remote_action' => route('customers.index')]) }}
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => 'form.currency_code', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }}
@ -196,7 +196,7 @@
{{ Form::textareaGroup('footer', trans('general.footer'), '', setting('invoice.footer'), ['rows' => '3'], 'col-md-6') }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('defaults.category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?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'). '?type=income']) }}
{{ Form::recurring('create') }}

View File

@ -18,7 +18,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'path' => route('modals.customers.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.customers.create'), 'remote_action' => route('customers.index')]) }}
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $invoice->currency_code, ['required' => 'required', 'model' => 'form.currency_code', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }}
@ -197,7 +197,7 @@
{{ Form::textareaGroup('footer', trans('general.footer'), '', null, ['rows' => '3'], 'col-md-6') }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $invoice->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income']) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $invoice->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?type=income']) }}
{{ Form::recurring('edit', $invoice) }}

View File

@ -26,11 +26,11 @@
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), ['path' => route('modals.customers.create')]) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), ['path' => route('modals.customers.create'), 'remote_action' => route('customers.index')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?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'). '?type=income']) }}
{{ Form::recurring('create') }}

View File

@ -45,11 +45,11 @@
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $revenue->account_id, ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $revenue->contact_id, ['path' => route('modals.customers.create')]) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $revenue->contact_id, ['path' => route('modals.customers.create'), 'remote_action' => route('customers.index')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?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'). '?type=income']) }}
{{ Form::recurring('edit', $revenue) }}

View File

@ -22,6 +22,10 @@
{{ 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'). '?type=income']) }}
{{ Form::selectRemoteGroup('expense_category', trans('settings.default.expense_category'), 'folder', $purchases_categories, setting('default.expense_category'), ['remote_action' => route('categories.index'). '?type=expense']) }}
{{ Form::selectGroup('tax', trans_choice('general.taxes', 1), 'percent', $taxes, setting('default.tax'), []) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method'), []) }}