akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@ -1,54 +1,43 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.categories', 1)]) }}
</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.categories', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.categories', 1)]) }}"
icon="folder"
route="categories.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'categories.store',
'id' => 'category',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<x-slot name="content">
<x-form.container>
<x-form id="category" route="categories.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('categories.form_description.general') }}" />
</x-slot>
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
<x-slot name="body">
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, config('general.types')) }}
<x-form.group.color name="color" label="{{ trans('general.color') }}" />
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'form-control-label']) !!}
<div class="input-group input-group-merge" id="category-color-picker">
<div class="input-group-prepend">
<span class="input-group-text">
<el-color-picker v-model="color" size="mini" :predefine="predefineColors" @change="onChangeColor"></el-color-picker>
</span>
</div>
{!! Form::text('color', '#55588b', ['v-model' => 'form.color', '@input' => 'onChangeColorInput', 'id' => 'color', 'class' => 'form-control color-hex', 'required' => 'required']) !!}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" :selected="config('general.types')" change="updateParentCategories" />
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
</div>
</div>
<x-form.group.select name="parent_id" label="{{ trans('general.parent') . ' ' . trans_choice('general.categories', 1) }}" :options="[]" not-required dynamicOptions="categoriesBasedTypes" sort-options="false" disabled="isParentCategoryDisabled" />
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('categories.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
<x-form.input.hidden name="categories" :value="json_encode($categories)" />
</x-slot>
</x-form.section>
@push('scripts_start')
<script src="{{ asset('public/js/settings/categories.js?v=' . version('short')) }}"></script>
@endpush
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="categories.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<x-script folder="settings" file="categories" />
</x-layouts.admin>

View File

@ -1,62 +1,48 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.categories', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.categories', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="category" method="PATCH" :route="['categories.update', $category->id]" :model="$category">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('categories.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($category, [
'id' => 'category',
'method' => 'PATCH',
'route' => ['categories.update', $category->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<x-slot name="body">
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
<x-form.group.color name="color" label="{{ trans('general.color') }}" />
@if ($type_disabled)
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, $category->type, ['required' => 'required', 'disabled' => 'true']) }}
<input type="hidden" name="type" value="{{ $category->type }}" />
@else
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, $category->type) }}
@endif
@if ($type_disabled)
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" disabled />
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'form-control-label']) !!}
<div class="input-group input-group-merge" id="category-color-picker">
<div class="input-group-prepend">
<span class="input-group-text">
<el-color-picker v-model="color" size="mini" :predefine="predefineColors" @change="onChangeColor"></el-color-picker>
</span>
</div>
{!! Form::text('color', $category->color, ['@input' => 'onChangeColorInput', 'id' => 'color', 'class' => 'form-control color-hex', 'required' => 'required']) !!}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
<input type="hidden" name="type" value="{{ $category->type }}" />
@else
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" change="updateParentCategories" />
@endif
{{ Form::radioGroup('enabled', trans('general.enabled'), $category->enabled) }}
</div>
</div>
<x-form.group.select name="parent_id" label="{{ trans('general.parent') . ' ' . trans_choice('general.categories', 1) }}" :options="$categories[$category->type]" not-required dynamicOptions="categoriesBasedTypes" sort-options="false" />
@can('update-settings-categories')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('categories.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
<x-form.input.hidden name="categories" :value="json_encode($categories)" />
<x-form.input.hidden name="parent_category_id" :value="$category->parent_id" />
</x-slot>
</x-form.section>
@push('scripts_start')
<script src="{{ asset('public/js/settings/categories.js?v=' . version('short')) }}"></script>
@endpush
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
@can('update-settings-categories')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="categories.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
<x-script folder="settings" file="categories" />
</x-layouts.admin>

View File

@ -1,95 +1,122 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.categories', 2) }}
</x-slot>
@section('title', trans_choice('general.categories', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.categories', 2) }}"
icon="folder"
route="categories.index"
></x-slot>
@section('new_button')
@can('create-settings-categories')
<a href="{{ route('categories.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
<a href="{{ route('import.create', ['settings', 'categories']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
@endcan
<a href="{{ route('categories.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
@endsection
<x-slot name="buttons">
@can('create-settings-categories')
<x-link href="{{ route('categories.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.categories', 1)]) }}
</x-link>
@endcan
</x-slot>
@section('content')
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'categories.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Setting\Category" />
</div>
<x-slot name="moreButtons">
<x-dropdown id="dropdown-more-actions">
<x-slot name="trigger">
<span class="material-icons">more_horiz</span>
</x-slot>
{{ Form::bulkActionRowGroup('general.categories', $bulk_actions, ['group' => 'settings', 'type' => 'categories']) }}
{!! Form::close() !!}
</div>
@can('create-settings-categories')
<x-dropdown.link href="{{ route('import.create', ['settings', 'categories']) }}">
{{ trans('import.import') }}
</x-dropdown.link>
@endcan
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 col-lg-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-4">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-sm-2 col-md-2 col-lg-2 d-none d-sm-block">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-md-2 col-lg-2 d-none d-md-block">{{ trans('general.color') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-dropdown.link href="{{ route('categories.export', request()->input()) }}">
{{ trans('general.export') }}
</x-dropdown.link>
</x-dropdown>
</x-slot>
<tbody>
@foreach($categories as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-4"><a class="col-aka" href="{{ route('categories.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-sm-2 col-md-2 col-lg-2 d-none d-sm-block">{{ $types[$item->type] ?? trans('general.na') }}</td>
<td class="col-md-2 col-lg-2 d-none d-md-block"><i class="fa fa-2x fa-circle" style="color:{{ $item->color }};"></i></td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2">
@if (user()->can('update-settings-categories'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('categories.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@if ($item->id != $transfer_id)
@can('delete-settings-categories')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'categories.destroy') !!}
@endcan
@endif
<x-slot name="content">
<x-index.container>
<x-index.search
search-string="App\Models\Setting\Category"
bulk-action="App\BulkActions\Settings\Categories"
/>
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
<x-index.bulkaction.all />
</x-table.th>
<x-table.th class="w-5/12">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</x-table.th>
<x-table.th class="w-5/12">
<x-sortablelink column="type" title="{{ trans_choice('general.types', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12">
{{ trans('general.color') }}
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($categories as $category)
<x-table.tr href="{{ route('categories.edit', $category->id) }}" class="relative flex items-center border-b hover:bg-gray-100 px-1 group transition-all">
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
<x-index.bulkaction.single id="{{ $category->id }}" name="{{ $category->name }}" />
</x-table.td>
<x-table.td class="w-5/12 truncate">
@if ($category->sub_categories->count())
<div class="flex items-center font-bold">
{{ $category->name }}
<x-tooltip id="tooltip-category-{{ $category->id }}" placement="bottom" message="{{ trans('categories.collapse') }}">
<button
type="button"
class="w-4 h-4 flex items-center justify-center mx-2 leading-none align-text-top rounded-lg bg-gray-500 hover:bg-gray-700"
node="child-{{ $category->id }}"
onClick="toggleSub('child-{{ $category->id }}', event)"
>
<span class="material-icons transform transition-all text-lg leading-none align-middle text-white">navigate_next</span>
</button>
</x-tooltip>
</div>
</div>
</td>
</tr>
@else
<span class="font-bold">{{ $category->name }}</span>
@endif
</x-table.td>
<x-table.td class="w-5/12 truncate">
@if (! empty($types[$category->type]))
{{ $types[$category->type] }}
@else
<x-empty-data />
@endif
</x-table.td>
<x-table.td class="w-2/12 relative">
<span class="material-icons" class="text-3xl" style="color:{{ $category->color }};">circle</span>
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$category" />
</x-table.td>
</x-table.tr>
@foreach($category->sub_categories as $sub_category)
@include('settings.categories.sub_category', ['parent_category' => $category, 'sub_category' => $sub_category, 'tree_level' => 1])
@endforeach
@endforeach
</tbody>
</table>
</div>
</x-table.tbody>
</x-table>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $categories])
</div>
</div>
</div>
@endsection
<x-pagination :items="$categories" />
</x-index.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/settings/categories.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="categories" />
</x-layouts.admin>

View File

@ -0,0 +1,58 @@
@if ($sub_category->sub_categories)
<x-table.tr data-collapse="child-{{ $parent_category->id }}" data-animation class="relative flex items-center hover:bg-gray-100 px-1 group border-b transition-all collapse-sub" href="{{ route('categories.edit', $sub_category->id) }}">
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
<x-index.bulkaction.single id="{{ $sub_category->id }}" name="{{ $sub_category->name }}" />
</x-table.td>
<x-table.td class="w-5/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-medium text-black truncate" style="padding-left: {{ $tree_level * 15 }}px;">
@if ($sub_category->sub_categories->count())
<div class="flex items-center font-bold">
<span class="material-icons transform mr-1 text-lg leading-none">subdirectory_arrow_right</span>
{{ $sub_category->name }}
<x-tooltip id="tooltip-category-{{ $parent_category->id }}" placement="bottom" message="{{ trans('categories.collapse') }}">
<button
type="button"
class="w-4 h-4 flex items-center justify-center mx-2 leading-none align-text-top rounded-lg bg-gray-500 hover:bg-gray-700"
node="child-{{ $sub_category->id }}"
onClick="toggleSub('child-{{ $sub_category->id }}', event)"
>
<span class="material-icons transform transition-all text-lg leading-none align-middle text-white">navigate_next</span>
</button>
</x-tooltip>
</div>
@else
<div class="flex items-center font-bold">
<span class="material-icons transform mr-1 text-lg leading-none">subdirectory_arrow_right</span>
{{ $sub_category->name }}
</div>
@endif
</x-table.td>
<x-table.td class="w-5/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-normal text-black cursor-pointer truncate">
@if (! empty($types[$category->type]))
{{ $types[$category->type] }}
@else
<x-empty-data />
@endif
</x-table.td>
<x-table.td class="ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-normal text-black cursor-pointer w-2/12 relative">
<span class="material-icons" class="text-3xl" style="color:{{ $sub_category->color }};">circle</span>
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$sub_category" />
</x-table.td>
</x-table.tr>
@php
$parent_category = $sub_category;
$tree_level++;
@endphp
@foreach($sub_category->sub_categories as $sub_category)
@include('settings.categories.sub_category', ['parent_category' => $parent_category, 'sub_category' => $sub_category, 'tree_level' => $tree_level])
@endforeach
@endif

View File

@ -1,59 +1,61 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.companies', 1) }}</x-slot>
@section('title', trans_choice('general.companies', 1))
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" route="settings.company.update">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('settings.company.form_description.general') }}" />
</x-slot>
@section('content')
{!! Form::open([
'id' => 'setting',
'method' => 'PATCH',
'route' => 'settings.update',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<x-slot name="body">
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 grid-rows-4">
<x-form.group.text name="name" label="{{ trans('settings.company.name') }}" value="{{ setting('company.name') }}" />
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('settings.company.name'), 'building', ['required' => 'required'], setting('company.name')) }}
<x-form.group.text name="email" label="{{ trans('settings.company.email') }}" value="{{ setting('company.email') }}" />
{{ Form::textGroup('email', trans('settings.company.email'), 'envelope', ['required' => 'required'], setting('company.email')) }}
<x-form.group.text name="phone" label="{{ trans('settings.company.phone') }}" value="{{ setting('company.phone') }}" not-required />
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', [], setting('company.tax_number')) }}
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" value="{{ setting('company.tax_number') }}" not-required />
</div>
{{ Form::textGroup('phone', trans('settings.company.phone'), 'phone', [], setting('company.phone')) }}
<div class="sm:col-span-3">
<x-form.group.file name="logo" label="{{ trans('settings.company.logo') }}" :value="setting('company.logo')" not-required />
</div>
</x-slot>
</x-form.section>
{{ Form::textareaGroup('address', trans('settings.company.address'), null, setting('company.address')) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.address') }}" description="{{ trans('settings.company.form_description.address') }}" />
</x-slot>
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', [], setting('company.city')) }}
<x-slot name="body">
<x-form.group.textarea name="address" label="{{ trans('settings.company.address') }}" :value="setting('company.address')" />
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', [], setting('company.zip_code')) }}
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ setting('company.city') }}" not-required />
{{ Form::textGroup('state', trans('general.state'), 'city', [], setting('company.state')) }}
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" value="{{ setting('company.zip_code') }}" not-required />
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), setting('company.country'), []) }}
<x-form.group.text name="state" label="{{ trans('general.state') }}" value="{{ setting('company.state') }}" not-required />
{{ Form::fileGroup('logo', trans('settings.company.logo'), 'file-image-o', [], setting('company.logo')) }}
</div>
</div>
<x-form.group.country />
</x-slot>
</x-form.section>
@can('update-settings-settings')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('settings.index') }}
</div>
</div>
@endcan
</div>
@can('update-settings-company')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
{!! Form::hidden('_prefix', 'company') !!}
<x-form.input.hidden name="_prefix" value="company" />
</x-form>
</x-form.container>
</x-slot>
{!! Form::close() !!}
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/settings.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="settings" />
</x-layouts.admin>

View File

@ -1,53 +1,51 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.currencies', 1)]) }}
</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.currencies', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.currencies', 1)]) }}"
icon="paid"
route="currencies.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'currencies.store',
'id' => 'currency',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<x-slot name="content">
<x-form.container>
<x-form id="currency" route="currencies.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('currencies.form_description.general') }}" />
</x-slot>
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'chart-bar') }}
<x-slot name="body">
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, null, ['required' => 'required', 'change' => 'onChangeCode']) }}
<x-form.group.select name="code" label="{{ trans('currencies.code') }}" :options="$codes" change="onChangeCode" />
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'onChangeRate', 'required' => 'required']) }}
<x-form.group.text name="rate" label="{{ trans('currencies.rate') }}" @input="onChangeRate" />
{{ Form::selectGroup('precision', trans('currencies.precision'), 'dot-circle', $precisions, null, ['model' => 'form.precision']) }}
<x-form.group.select name="precision" label="{{ trans('currencies.precision') }}" :options="$precisions" model="form.precision" />
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}
<x-form.group.text name="symbol" label="{{ trans('currencies.symbol.symbol') }}" />
{{ Form::selectGroup('symbol_first', trans('currencies.symbol.position'), 'text-width', ["1" => trans('currencies.symbol.before'), "0" => trans('currencies.symbol.after')], null, ['model' => 'form.symbol_first']) }}
<x-form.group.select name="symbol_first" label="{{ trans('currencies.symbol.position') }}" :options="['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')]" not-required model="form.symbol_first" />
{{ Form::textGroup('decimal_mark', trans('currencies.decimal_mark'), 'sign') }}
<x-form.group.text name="decimal_mark" label="{{ trans('currencies.decimal_mark') }}" />
{{ Form::textGroup('thousands_separator', trans('currencies.thousands_separator'), 'slash', []) }}
<x-form.group.text name="thousands_separator" label="{{ trans('currencies.thousands_separator') }}" not-required />
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
<x-form.group.toggle name="default_currency" label="{{ trans('currencies.default') }}" :value="false" />
</x-slot>
</x-form.section>
{{ Form::radioGroup('default_currency', trans('currencies.default'), false) }}
</div>
</div>
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="currencies.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('currencies.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/currencies.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="currencies" />
</x-layouts.admin>

View File

@ -1,57 +1,49 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.currencies', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.currencies', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="currency" method="PATCH" :route="['currencies.update', $currency->id]" :model="$currency">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('currencies.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($currency, [
'id' => 'currency',
'method' => 'PATCH',
'route' => ['currencies.update', $currency->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<x-slot name="body">
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'chart-bar') }}
<x-form.group.select name="code" label="{{ trans('currencies.code') }}" :options="$codes" change="onChangeCode" />
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, $currency->code, ['required' => 'required', 'change' => 'onChangeCode']) }}
<x-form.group.text name="rate" label="{{ trans('currencies.rate') }}" @input="onChangeRate" />
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'onChangeRate', 'required' => 'required']) }}
<x-form.group.select name="precision" label="{{ trans('currencies.precision') }}" :options="$precisions" model="form.precision" />
{{ Form::selectGroup('precision', trans('currencies.precision'), 'dot-circle', $precisions, $currency->precision, ['model' => 'form.precision']) }}
<x-form.group.text name="symbol" label="{{ trans('currencies.symbol.symbol') }}" />
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}
<x-form.group.select name="symbol_first" label="{{ trans('currencies.symbol.position') }}" :options="['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')]" not-required model="form.symbol_first" />
{{ Form::selectGroup('symbol_first', trans('currencies.symbol.position'), 'text-width', ['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')], $currency->symbol_first, ['model' => 'form.symbol_first']) }}
<x-form.group.text name="decimal_mark" label="{{ trans('currencies.decimal_mark') }}" />
{{ Form::textGroup('decimal_mark', trans('currencies.decimal_mark'), 'sign') }}
<x-form.group.text name="thousands_separator" label="{{ trans('currencies.thousands_separator') }}" not-required />
{{ Form::textGroup('thousands_separator', trans('currencies.thousands_separator'), 'slash', []) }}
<x-form.group.toggle name="default_currency" label="{{ trans('currencies.default') }}" :value="$currency->default_currency" :disabled="(setting('default.currency') == $currency->code)" />
</x-slot>
</x-form.section>
{{ Form::radioGroup('enabled', trans('general.enabled'), $currency->enabled) }}
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
{{ Form::radioGroup('default_currency', trans('currencies.default'), $currency->default_currency, '', '', ['disabled' => (setting('default.currency') == $currency->code) ? 'disabled': false]) }}
</div>
</div>
@can('update-settings-currencies')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="currencies.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
@can('update-settings-currencies')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('currencies.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/currencies.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="currencies" />
</x-layouts.admin>

View File

@ -1,91 +1,100 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.currencies', 2) }}
</x-slot>
@section('title', trans_choice('general.currencies', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.currencies', 2) }}"
icon="paid"
route="currencies.index"
></x-slot>
@can('create-settings-currencies')
@section('new_button')
<a href="{{ route('currencies.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endsection
@endcan
<x-slot name="buttons">
@can('create-settings-currencies')
<x-link href="{{ route('currencies.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.currencies', 1)]) }}
</x-link>
@endcan
</x-slot>
@section('content')
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'currencies.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Setting\Currency" />
</div>
<x-slot name="content">
<x-index.container>
<x-index.search
search-string="App\Models\Setting\Currency"
bulk-action="App\BulkActions\Settings\Currencies"
/>
{{ Form::bulkActionRowGroup('general.currencies', $bulk_actions, ['group' => 'settings', 'type' => 'currencies']) }}
{!! Form::close() !!}
</div>
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
<x-index.bulkaction.all />
</x-table.th>
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 col-lg-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-4">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 d-none d-md-block">@sortablelink('code', trans('currencies.code'))</th>
<th class="col-sm-2 col-md-2 col-lg-2 d-none d-sm-block">@sortablelink('rate', trans('currencies.rate'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-table.th class="w-6/12 sm:w-4/12">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</x-table.th>
<tbody>
<x-table.th class="w-6/12 sm:w-3/12">
<x-sortablelink column="code" title="{{ trans('currencies.code') }}" />
</x-table.th>
<x-table.th class="w-3/12 hidden sm:table-cell">
{{ trans('currencies.symbol.symbol') }}
</x-table.th>
<x-table.th class="w-2/12">
<x-sortablelink column="type" title="{{ trans('currencies.rate') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($currencies as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-4"><a class="col-aka" href="{{ route('currencies.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-md-2 col-lg-2 d-none d-md-block">{{ $item->code }}</td>
<td class="col-sm-2 col-md-2 col-lg-2 long-texts d-none d-sm-block">{{ $item->rate }}</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2">
@if (user()->can('update-settings-currencies'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('currencies.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-settings-currencies')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'currencies.destroy') !!}
@endcan
<x-table.tr href="{{ route('currencies.edit', $item->id) }}">
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
</x-table.td>
<x-table.td class="w-6/12 sm:w-4/12">
<x-slot name="first" class="flex" override="class">
<div class="font-bold truncate">
{{ $item->name }}
</div>
</div>
</td>
</tr>
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.currencies', 1) }}" />
@endif
@if ($item->code == setting("default.currency"))
<x-index.default text="{{ trans('currencies.default') }}" />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-6/12 sm:w-3/12 truncate">
{{ $item->code }}
</x-table.td>
<x-table.td class="w-3/12 hidden sm:table-cell">
{{ $item->symbol }}
</x-table.td>
<x-table.td class="w-2/12 relative truncate">
{{ $item->rate }}
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</tbody>
</table>
</div>
</x-table.tbody>
</x-table>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $currencies])
</div>
</div>
</div>
@endsection
<x-pagination :items="$currencies" />
</x-index.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/settings/currencies.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="currencies" />
</x-layouts.admin>

View File

@ -1,57 +1,61 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.defaults', 1) }}</x-slot>
@section('title', trans_choice('general.defaults', 1))
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" route="settings.default.update">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('settings.default.form_description.general') }}" />
</x-slot>
@section('content')
{!! Form::open([
'id' => 'setting',
'method' => 'PATCH',
'route' => 'settings.update',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<x-slot name="body">
<x-form.group.account name="account" not-required without-change :selected="setting('default.account')" />
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::selectGroup('account', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), []) }}
<x-form.group.currency name="currency" not-required />
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), []) }}
<x-form.group.select name="tax" label="{{ trans_choice('general.taxes', 1) }}" :options="$taxes" :selected="setting('default.tax')" not-required />
{{ Form::selectRemoteGroup('income_category', trans('settings.default.income_category'), 'folder', $sales_categories, setting('default.income_category'), ['remote_action' => route('categories.index'). '?search=type:income enabled:1']) }}
<x-form.group.payment-method not-required />
</x-slot>
</x-form.section>
{{ Form::selectRemoteGroup('expense_category', trans('settings.default.expense_category'), 'folder', $purchases_categories, setting('default.expense_category'), ['remote_action' => route('categories.index'). '?search=type:expense enabled:1']) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.categories', 1) }}" description="{{ trans('settings.default.form_description.category') }}" />
</x-slot>
{{ Form::selectGroup('tax', trans_choice('general.taxes', 1), 'percent', $taxes, setting('default.tax'), []) }}
<x-slot name="body">
<x-form.group.select remote name="income_category" label="{{ trans('settings.default.income_category') }}" :options="$sales_categories" :selected="setting('default.income_category')" remote_action="{{ route('categories.index'). '?search=type:income enabled:1' }}" sort-options="false" />
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method'), []) }}
<x-form.group.select remote name="expense_category" label="{{ trans('settings.default.expense_category') }}" :options="$purchases_categories" :selected="setting('default.expense_category')" remote_action="{{ route('categories.index'). '?search=type:expense enabled:1' }}" sort-options="false" />
</x-slot>
</x-form.section>
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('default.locale'), []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('settings.default.form_description.other') }}" />
</x-slot>
{{ Form::selectGroup('list_limit', trans('settings.default.list_limit'), 'columns', ['10' => '10', '25' => '25', '50' => '50', '100' => '100'], setting('default.list_limit'), []) }}
<x-slot name="body">
<x-form.group.locale not-required />
{{ Form::radioGroup('use_gravatar', trans('settings.default.use_gravatar'), setting('default.use_gravatar')) }}
</div>
</div>
<x-form.group.select name="list_limit" label="{{ trans('settings.default.list_limit') }}" :options="['10' => '10', '25' => '25', '50' => '50', '100' => '100']" :selected="setting('default.list_limit')" not-required />
</x-slot>
</x-form.section>
@can('update-settings-settings')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('settings.index') }}
</div>
</div>
@endcan
</div>
@can('update-settings-defaults')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
{!! Form::hidden('_prefix', 'default') !!}
<x-form.input.hidden name="_prefix" value="default" />
</x-form>
</x-form.container>
</x-slot>
{!! Form::close() !!}
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/settings.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="settings" />
</x-layouts.admin>

View File

@ -0,0 +1,90 @@
<x-layouts.admin>
<x-slot name="title">{{ trans('settings.email.email_templates') }}</x-slot>
<x-slot name="content">
<div class="flex flex-col lg:flex-row">
<div class="relative flex flex-col lg:flex-row mt-4 gap-12 sm:divide-x-2 lg:w-full">
<div class="w-full lg:w-1/3">
@foreach ($templates as $group => $template)
<div>
<div class="pb-2">
<x-form.section.head title="{{ trans_choice($group, 2) }}" description="" />
</div>
<div class="flex flex-col">
<div class="mb-3">
@foreach ($template as $item)
<button class="text-xs truncate text-left border-b border-transparent transition-all hover:border-purple hover:text-purple" @click="onEditEmailTemplate({{ $item->id }}, $event)" >
{{ trans($item->name) }}
</button>
@endforeach
</div>
</div>
</div>
@endforeach
</div>
<div class="w-full lg:w-2/3 flex-col xl:m-0 lg:pl-12 justify-evenly xl:w-2/3">
@php
$first = Arr::first($templates);
$template = Arr::first($first);
@endphp
<x-form id="setting" method="PATCH" route="settings.email-templates.update" :model="$template">
<div class="mb-14">
<div class="border-b-2 border-gray-200 pb-2">
<h2 class="lg:text-lg font-medium text-black" v-if="template_title" v-html="template_title"></h2>
<h2 class="lg:text-lg font-light text-black" v-else>
{{ trans($template->name) }}
</h2>
</div>
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.text name="subject" label="{{ trans('settings.email.templates.subject') }}" form-group-class="sm:col-span-6" />
<div class="form-group sm:col-span-6 required" v-if='form.body != null'>
<x-form.label for="body" class="form-control-label">
{{ trans('settings.email.templates.body') }}
</x-form.label>
<akaunting-html-editor
name="body"
v-model='form.body'
:model='form.body'
></akaunting-html-editor>
</div>
<div class="form-group sm:col-span-6 required" v-if='form.body == null'>
<x-form.group.editor name="body" label="{{ trans('settings.email.templates.body') }}" value="{!! $template->body !!}" v-model='form.body' rows="5" />
</div>
<div class="sm:col-span-6">
<div class="bg-gray-200 rounded-md p-3">
<small v-html='tags' v-if='tags != null'></small>
<small v-if='tags == null'>
{!! trans('settings.email.templates.tags', ['tag_list' => implode(', ', app($template->class)->getTags())]) !!}
</small>
</div>
</div>
<x-form.input.hidden name="id" :value="$template->id" />
</div>
</div>
@can('update-settings-email-templates')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
<x-form.input.hidden name="_prefix" value="email" />
</x-form>
</div>
</div>
</div>
</x-slot>
<x-script folder="settings" file="settings" />
</x-layouts.admin>

View File

@ -1,114 +1,43 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('settings.email.email_service') }}</x-slot>
@section('title', trans('general.email'))
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" route="settings.email.update">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('settings.email.form_description.general') }}" />
</x-slot>
@section('content')
{!! Form::open([
'id' => 'setting',
'method' => 'PATCH',
'route' => 'settings.email.update',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<x-slot name="body">
<x-form.group.select name="protocol" label="{{ trans('settings.email.protocol') }}" :options="$email_protocols" :selected="setting('email.protocol')" not-required change="onChangeProtocol" />
@php $card = 1; @endphp
<x-form.group.text name="sendmail_path" label="{{ trans('settings.email.sendmail_path') }}" value="{{ setting('email.sendmail_path') }}" ::disabled="email.sendmailPath" not-required />
<div class="row">
<x-form.group.text name="smtp_host" label="{{ trans('settings.email.smtp.host') }}" value="{{ setting('email.smtp_host') }}" ::disabled="email.smtpHost" not-required />
@foreach($templates as $template)
@php
if (!class_exists($template->class)) {
continue;
}
$aria_expanded_status = in_array($card, [1, 2]) ? 'true' : 'false';
$collapse_status = in_array($card, [1, 2]) ? 'show' : '';
@endphp
<x-form.group.text name="smtp_port" label="{{ trans('settings.email.smtp.port') }}" value="{{ setting('email.smtp_port') }}" ::disabled="email.smtpPort" not-required />
<div class="col-md-6">
<div class="accordion" id="accordion-{{ $card }}">
<div class="card">
<div class="card-header" id="heading-{{ $card }}" data-toggle="collapse" data-target="#collapse-{{ $card }}" aria-expanded="{{ $aria_expanded_status }}" aria-controls="collapse-{{ $card }}">
<div class="align-items-center">
<h4 class="mb-0">{{ trans($template->name) }}</h4>
</div>
</div>
<x-form.group.text name="smtp_username" label="{{ trans('settings.email.smtp.username') }}" value="{{ setting('email.smtp_username') }}" ::disabled="email.smtpUsername" not-required />
<div id="collapse-{{ $card }}" class="collapse {{ $collapse_status }}" aria-labelledby="heading-{{ $card }}" data-parent="#accordion-{{ $card }}">
<div class="card-body">
<div class="row">
{{ Form::textGroup('template_' . $template->alias . '_subject', trans('settings.email.templates.subject'), 'font', ['required' => 'required'], $template->subject, 'col-md-12') }}
<x-form.group.password name="smtp_password" label="{{ trans('settings.email.smtp.password') }}" value="{{ setting('email.smtp_password') }}" ::disabled="email.smtpPassword" not-required />
{{ Form::textEditorGroup('template_' . $template->alias . '_body', trans('settings.email.templates.body'), null, $template->body, ['required' => 'required', 'rows' => '5', 'data-toggle' => 'quill'], 'col-md-12 mb-0') }}
<x-form.group.select name="smtp_encryption" label="{{ trans('settings.email.smtp.encryption') }}" :options="['' => trans('settings.email.smtp.none'), 'ssl' => 'SSL', 'tls' => 'TLS']" :selected="setting('email.smtp_encryption', null)" v-disabled="email.smtpEncryption" not-required />
</x-slot>
</x-form.section>
<div class="col-md-12">
<div class="bg-secondary border-radius-default border-1 p-2">
<small class="text-default">{!! trans('settings.email.templates.tags', ['tag_list' => implode(', ', app($template->class)->getTags())]) !!}</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@can('update-settings-email')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
@php $card++; @endphp
@endforeach
<x-form.input.hidden name="_prefix" value="email" />
</x-form>
</x-form.container>
</x-slot>
<div class="col-md-12">
<div class="accordion" id="accordion-{{ $card }}">
<div class="card">
<div class="card-header" id="heading-{{ $card }}" data-toggle="collapse" data-target="#collapse-{{ $card }}" aria-expanded="false" aria-controls="collapse-{{ $card }}">
<div class="align-items-center">
<h4 class="mb-0">{{ trans('settings.email.protocol') }}</h4>
</div>
</div>
<div id="collapse-{{ $card }}" class="collapse hide" aria-labelledby="heading-{{ $card }}" data-parent="#accordion-{{ $card }}">
<div class="card-body">
<div class="row">
{{ Form::selectGroup('protocol', trans('settings.email.protocol'), 'share', $email_protocols, setting('email.protocol'), ['change' => 'onChangeProtocol']) }}
{{ Form::textGroup('sendmail_path', trans('settings.email.sendmail_path'), 'road', [':disabled'=> 'email.sendmailPath'], setting('email.sendmail_path')) }}
{{ Form::textGroup('smtp_host', trans('settings.email.smtp.host'), 'paper-plane', [':disabled' => 'email.smtpHost'], setting('email.smtp_host')) }}
{{ Form::textGroup('smtp_port', trans('settings.email.smtp.port'), 'paper-plane', [':disabled' => 'email.smtpPort'], setting('email.smtp_port')) }}
{{ Form::textGroup('smtp_username', trans('settings.email.smtp.username'), 'paper-plane', [':disabled' => 'email.smtpUsername'], setting('email.smtp_username')) }}
{{ Form::textGroup('smtp_password', trans('settings.email.smtp.password'), 'paper-plane', ['type' => 'password', ':disabled' => 'email.smtpPassword'], setting('email.smtp_password')) }}
{{ Form::selectGroup('smtp_encryption', trans('settings.email.smtp.encryption'), 'paper-plane', ['' => trans('settings.email.smtp.none'), 'ssl' => 'SSL', 'tls' => 'TLS'], setting('email.smtp_encryption', null), ['disabled' => 'email.smtpEncryption']) }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@can('update-settings-settings')
<div class="row ml-0 mr-0">
<div class="card col-md-12">
<div class="card-body mr--3">
<div class="row save-buttons">
{{ Form::saveButtons('settings.index') }}
</div>
</div>
</div>
</div>
@endcan
{!! Form::hidden('_prefix', 'email') !!}
{!! Form::close() !!}
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/settings.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="settings" />
</x-layouts.admin>

View File

@ -1,108 +1,143 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.invoices', 1) }}
</x-slot>
@section('title', trans_choice('general.invoices', 1))
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" route="settings.invoice.update">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('settings.invoice.form_description.general') }}" />
</x-slot>
@section('content')
{!! Form::open([
'id' => 'setting',
'method' => 'PATCH',
'route' => 'settings.update',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<x-slot name="body">
<x-form.group.text name="number_prefix" label="{{ trans('settings.invoice.prefix') }}" value="{{ setting('invoice.number_prefix') }}" not-required />
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::textGroup('number_prefix', trans('settings.invoice.prefix'), 'font', [], setting('invoice.number_prefix')) }}
<x-form.group.text name="number_digit" label="{{ trans('settings.invoice.digit') }}" value="{{ setting('invoice.number_digit') }}" not-required />
{{ Form::textGroup('number_digit', trans('settings.invoice.digit'), 'text-width', [], setting('invoice.number_digit')) }}
<x-form.group.text name="number_next" label="{{ trans('settings.invoice.next') }}" value="{{ setting('invoice.number_next') }}" not-required />
{{ Form::textGroup('number_next', trans('settings.invoice.next'), 'chevron-right', [], setting('invoice.number_next')) }}
<x-form.group.select name="payment_terms" label="{{ trans('settings.invoice.payment_terms') }}" :options="$payment_terms" :selected="setting('invoice.payment_terms')" not-required />
</x-slot>
</x-form.section>
{{ Form::selectGroup('payment_terms', trans('settings.invoice.payment_terms'), 'calendar', $payment_terms, setting('invoice.payment_terms'), []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title=" {{ trans_choice('general.templates', 1) }}" description="{{ trans('settings.invoice.form_description.template') }}" />
</x-slot>
{{ Form::textGroup('title', trans('settings.invoice.title'), 'font', [], setting('invoice.title')) }}
{{ Form::textGroup('subheading', trans('settings.invoice.subheading'), 'font', [], setting('invoice.subheading')) }}
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2), 'sticky-note-o', setting('invoice.notes'), ['rows' => 3], 'col-md-6') }}
{{ Form::textareaGroup('footer', trans('general.footer'), 'sticky-note-o', setting('invoice.footer'), ['rows' => 3], 'col-md-6') }}
{{ Form::invoice_text('item_name', trans('settings.invoice.item_name'), 'font', $item_names, setting('invoice.item_name'), [], 'item_name_input', setting('invoice.item_name_input')) }}
{{ Form::radioGroup('hide_item_name', trans('settings.invoice.hide.item_name'), setting('invoice.hide_item_name')) }}
{{ Form::invoice_text('price_name', trans('settings.invoice.price_name'), 'font', $price_names, setting('invoice.price_name'), [], 'price_name_input', setting('invoice.price_name_input')) }}
{{ Form::radioGroup('hide_price', trans('settings.invoice.hide.price'), setting('invoice.hide_price')) }}
{{ Form::invoice_text('quantity_name', trans('settings.invoice.quantity_name'), 'font', $quantity_names, setting('invoice.quantity_name'), [], 'quantity_name_input', setting('invoice.quantity_name_input')) }}
{{ Form::radioGroup('hide_quantity', trans('settings.invoice.hide.quantity'), setting('invoice.hide_quantity')) }}
{{ Form::radioGroup('hide_item_description', trans('settings.invoice.hide.item_description'), setting('invoice.hide_item_description')) }}
{{ Form::radioGroup('hide_amount', trans('settings.invoice.hide.amount'), setting('invoice.hide_amount')) }}
<div class="form-group col-md-6">
{!! Form::label('invoice_template', trans_choice('general.templates', 1), ['class' => 'form-control-label']) !!}
<div class="input-group">
<button type="button" class="btn btn-block btn-outline-primary" @click="onTemplate">
{{ trans('settings.invoice.choose_template') }}
</button>
<x-slot name="body">
<div class="sm:col-span-2 rounded-lg cursor-pointer text-center py-2 px-2">
<label class="cursor-pointer">
<div @click="form.template='default'">
<img src="{{ asset('public/img/invoice_templates/default.png') }}" class="h-60 my-3" alt="Default" />
<input type="radio" name="template" value="default" v-model="form._template">
{{ trans('settings.invoice.default') }}
</div>
</label>
</div>
</div>
</div>
</div>
@can('update-settings-settings')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('settings.index') }}
</div>
</div>
@endcan
</div>
<div class="sm:col-span-2 rounded-lg cursor-pointer text-center py-2 px-2">
<label class="cursor-pointer">
<div @click="form.template='classic'">
<img src="{{ asset('public/img/invoice_templates/classic.png') }}" class="h-60 my-3" alt="Classic" />
<input type="radio" name="template" value="classic" v-model="form._template">
{{ trans('settings.invoice.classic') }}
</div>
</label>
</div>
{!! Form::hidden('_prefix', 'invoice') !!}
<div class="sm:col-span-2 rounded-lg cursor-pointer text-center py-2 px-2">
<label class="cursor-pointer">
<div @click="form.template='modern'">
<img src="{{ asset('public/img/invoice_templates/modern.png') }}" class="h-60 my-3" alt="Modern" />
<input type="radio" name="template" value="modern" v-model="form._template">
{{ trans('settings.invoice.modern') }}
</div>
</label>
</div>
{!! Form::close() !!}
@endsection
<x-form.group.color name="color" label="{{ trans('general.color') }}" />
</x-slot>
</x-form.section>
@push('content_content_end')
<akaunting-modal
:show="template.modal"
@cancel="template.modal = false"
:title="'{{ trans('settings.invoice.choose_template') }}'"
:message="template.html"
:button_cancel="'{{ trans('general.button.save') }}'"
:button_delete="'{{ trans('general.button.cancel') }}'">
<template #modal-body>
@include('modals.settings.invoice_template')
</template>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.defaults', 2) }}" description="{{ trans('settings.invoice.form_description.default') }}" />
</x-slot>
<template #card-footer>
<div class="float-right">
<button type="button" class="btn btn-outline-secondary" @click="closeTemplate">
{{ trans('general.cancel') }}
</button>
<x-slot name="body">
<x-form.group.text name="title" label="{{ trans('settings.invoice.title') }}" value="{{ setting('invoice.title') }}" not-required />
<button :disabled="form.loading" type="button" class="btn btn-success button-submit" @click="addTemplate">
<span v-if="form.loading" class="btn-inner--icon"><i class="aka-loader"></i></span>
<span :class="[{'ml-0': form.loading}]" class="btn-inner--text">{{ trans('general.confirm') }}</span>
</button>
</div>
</template>
</akaunting-modal>
@endpush
<x-form.group.text name="subheading" label="{{ trans('settings.invoice.subheading') }}" value="{{ setting('invoice.subheading') }}" not-required />
@push('scripts_start')
<script src="{{ asset('public/js/settings/settings.js?v=' . version('short')) }}"></script>
@endpush
<x-form.group.textarea name="notes" label="{{ trans_choice('general.notes', 2) }}" :value="setting('invoice.notes')" form-group-class="sm:col-span-3" not-required />
<x-form.group.textarea name="footer" label="{{ trans('general.footer') }}" :value="setting('invoice.footer')" form-group-class="sm:col-span-3" not-required />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('settings.invoice.column', 2) }}" description="{{ trans('settings.invoice.form_description.column') }}" />
</x-slot>
<x-slot name="body">
<div class="grid col-span-6 grid-rows-3">
<x-form.group.invoice-text
name="item_name"
label="{{ trans('settings.invoice.item_name') }}"
:options="$item_names"
:selected="setting('invoice.item_name')"
change="settingsInvoice"
input-name="item_name_input"
:input-value="setting('invoice.item_name_input')"
form-group-class="sm:col-span-6 sm:gap-0"
/>
<x-form.group.invoice-text
name="price_name"
label="{{ trans('settings.invoice.price_name') }}"
:options="$price_names"
:selected="setting('invoice.price_name')"
change="settingsInvoice"
input-name="price_name_input"
:input-value="setting('invoice.price_name_input')"
form-group-class="sm:col-span-6 sm:gap-0"
/>
<x-form.group.invoice-text
name="quantity_name"
label="{{ trans('settings.invoice.quantity_name') }}"
:options="$quantity_names"
:selected="setting('invoice.quantity_name')"
change="settingsInvoice"
input-name="quantity_name_input"
:input-value="setting('invoice.quantity_name_input')"
form-group-class="sm:col-span-6 sm:gap-0"
/>
</div>
<x-form.group.toggle name="hide_item_description" label="{{ trans('settings.invoice.hide.item_description') }}" :value="setting('invoice.hide_item_description')" not-required form-group-class="sm:col-span-6" />
<x-form.group.toggle name="hide_amount" label="{{ trans('settings.invoice.hide.amount') }}" :value="setting('invoice.hide_amount')" not-required form-group-class="sm:col-span-6" />
</x-slot>
</x-form.section>
@can('update-settings-invoice')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
<x-form.input.hidden name="_template" :value="setting('invoice.template')" />
<x-form.input.hidden name="_prefix" value="invoice" />
</x-form>
</x-form.container>
</x-slot>
<x-script folder="settings" file="settings" />
</x-layouts.admin>

View File

@ -1,53 +1,59 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.localisations', 1) }}</x-slot>
@section('title', trans_choice('general.localisations', 1))
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" route="settings.localisation.update">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.financial_year') }}" description="{{ trans('settings.localisation.form_description.fiscal') }}" />
</x-slot>
@section('content')
{!! Form::open([
'id' => 'setting',
'method' => 'PATCH',
'route' => 'settings.update',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<x-slot name="body">
<x-form.group.date name="financial_start" label="{{ trans('settings.localisation.financial_start') }}" icon="calendar_today" value="{{ setting('localisation.financial_start') }}" show-date-format="j F" date-format="d-m" autocomplete="off" hidden_year />
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::dateGroup('financial_start', trans('settings.localisation.financial_start'), 'calendar', ['id' => 'financial_start', 'class' => 'form-control datepicker', 'show-date-format' => 'j F', 'date-format' => 'd-m', 'autocomplete' => 'off', 'hidden_year' => true], setting('localisation.financial_start')) }}
<x-form.group.select name="financial_denote" label="{{ trans('settings.localisation.financial_denote.title') }}" :options="$financial_denote_options" :selected="setting('localisation.financial_denote')" not-required />
</x-slot>
</x-form.section>
{{ Form::selectGroup('financial_denote', trans('settings.localisation.financial_denote.title'), 'calendar', $financial_denote_options, setting('localisation.financial_denote'), []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('settings.localisation.preferred_date') }}" description="{{ trans('settings.localisation.form_description.date') }}" />
</x-slot>
{{ Form::selectGroupGroup('timezone', trans('settings.localisation.timezone'), 'globe', $timezones, setting('localisation.timezone'), []) }}
<x-slot name="body">
<x-form.group.select name="date_format" label="{{ trans('settings.localisation.date.format') }}" :options="$date_formats" :selected="setting('localisation.date_format')" autocomplete="off" />
{{ Form::selectGroup('date_format', trans('settings.localisation.date.format'), 'calendar', $date_formats, setting('localisation.date_format'), ['autocomplete' => 'off']) }}
<x-form.group.select name="date_separator" label="{{ trans('settings.localisation.date.separator') }}" :options="$date_separators" :selected="setting('localisation.date_separator')" />
</x-slot>
</x-form.section>
{{ Form::selectGroup('date_separator', trans('settings.localisation.date.separator'), 'minus', $date_separators, setting('localisation.date_separator'), []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('settings.localisation.form_description.other') }}" />
</x-slot>
{{ Form::selectGroup('percent_position', trans('settings.localisation.percent.title'), 'percent', $percent_positions, setting('localisation.percent_position'), []) }}
<x-slot name="body">
<x-form.group.select group name="timezone" label="{{ trans('settings.localisation.timezone') }}" :options="$timezones" :selected="setting('localisation.timezone')" />
{{ Form::selectGroup('discount_location', trans('settings.localisation.discount_location.name'), 'percent', $discount_locations, setting('localisation.discount_location'), []) }}
</div>
</div>
<x-form.group.select name="percent_position" label="{{ trans('settings.localisation.percent.title') }}" :options="$percent_positions" :selected="setting('localisation.percent_position')" not-required />
@can('update-settings-settings')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('settings.index') }}
</div>
</div>
@endcan
</div>
<x-form.group.select name="discount_location" label="{{ trans('settings.localisation.discount_location.name') }}" :options="$discount_locations" :selected="setting('localisation.discount_location')" not-required />
</x-slot>
</x-form.section>
{!! Form::hidden('_prefix', 'localisation') !!}
@can('update-settings-localisation')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
{!! Form::close() !!}
@endsection
<x-form.input.hidden name="_prefix" value="localisation" />
</x-form>
</x-form.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/settings/settings.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="settings" />
</x-layouts.admin>

161
resources/views/settings/modules/edit.blade.php Executable file → Normal file
View File

@ -1,63 +1,114 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ $module->getName() }}</x-slot>
@section('title', $module->getName())
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" :route="['settings.module.update', $module->getAlias()]" :model="$setting">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{!! trans($module->getAlias() . '::general.description') !!}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($setting, [
'id' => 'module',
'method' => 'PATCH',
'route' => ['settings.module.update', $module->getAlias()],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<x-slot name="body">
@foreach($module->get('settings') as $field)
@php $type = $field['type']; @endphp
<div class="card-body">
<div class="row">
@foreach($module->get('settings') as $field)
@php $type = $field['type']; @endphp
@switch($type)
@case('textarea')
@case('textareaGroup')
<x-form.group.textarea
name="{{ $field['name'] }}"
label="{{ trans($field['title']) }}"
:dynamic-attributes="$field['attributes']"
/>
@break
@case('select')
@case('selectGroup')
<x-form.group.select
name="{{ $field['name'] }}"
label="{{ trans($field['title']) }}"
:options="$field['values']"
:selected="setting($module->getAlias() . '.' . $field['name'], $field['selected'])"
:dynamic-attributes="$field['attributes']"
/>
@break
@case('radio')
@case('radioGroup')
<x-form.group.radio
name="{{ $field['name'] }}"
label="{{ trans($field['title']) }}"
:dynamic-attributes="$field['attributes']"
/>
@break
@case('checkbox')
@case('checkboxGroup')
<x-form.group.checkbox
name="{{ $field['name'] }}"
label="{{ trans($field['title']) }}"
:dynamic-attributes="$field['attributes']"
/>
@break
@case('file')
@case('fileGroup')
<x-form.group.file
name="{{ $field['name'] }}"
label="{{ trans($field['title']) }}"
:dynamic-attributes="$field['attributes']"
/>
@break
@case('date')
@case('dateGroup')
<x-form.group.date
name="{{ $field['name'] }}"
label="{{ trans($field['title']) }}"
:value="Date::parse($setting[$field['name']] ?? now())->toDateString()"
:dynamic-attributes="$field['attributes']"
/>
@break
@case('account')
@case('accountSelectGroup')
@php $account = setting($module->getAlias() . '.' . $field['name']); @endphp
@if (($type == 'textGroup') || ($type == 'emailGroup') || ($type == 'passwordGroup') || ($type == 'numberGroup'))
{{ Form::$type($field['name'], trans($field['title']), $field['icon'], $field['attributes']) }}
@elseif ($type == 'textareaGroup')
{{ Form::$type($field['name'], trans($field['title'])) }}
@elseif ($type == 'selectGroup')
{{ Form::$type($field['name'], trans($field['title']), $field['icon'], $field['values'], isset($setting[$field['name']]) ? $setting[$field['name']] : $field['selected'], $field['attributes']) }}
@elseif ($type == 'radioGroup')
{{ Form::$type($field['name'], trans($field['title']), isset($setting[$field['name']]) ? $setting[$field['name']] : 1, trans($field['enable']), trans($field['disable']), $field['attributes']) }}
@elseif ($type == 'checkboxGroup')
{{ Form::$type($field['name'], trans($field['title']), $field['items'], $field['value'], $field['id'], $field['selected'], $field['attributes']) }}
@elseif ($type == 'fileGroup')
{{ Form::$type($field['name'], trans($field['title']), $field['attributes']) }}
@elseif ($type == 'dateGroup')
{{ Form::$type($field['name'], trans($field['title']), $field['icon'], array_merge(['id' => $field['name'], 'date-format' => 'Y-m-d', 'show-date-format' => company_date_format(), 'autocomplete' => 'off'], $field['attributes']), Date::parse($setting[$field['name']] ?? now())->toDateString()) }}
@elseif ($type == 'accountSelectGroup')
{{ Form::selectGroup($field['name'], trans_choice('general.accounts', 1), 'university', $accounts, setting($module->getAlias() . '.' . $field['name']), $field['attributes']) }}
@elseif ($type == 'categorySelectGroup')
{{ Form::selectGroup($field['name'], trans_choice('general.categories', 1), 'folder', $categories, setting($module->getAlias() . '.' . $field['name']), $field['attributes']) }}
@endif
@endforeach
<x-form.group.account
:selected="$account"
:dynamic-attributes="$field['attributes']"
without-add-new
/>
@break
@case('category')
@case('categorySelectGroup')
@php $category = setting($module->getAlias() . '.' . $field['name']); @endphp
{{ Form::hidden('module_alias', $module->getAlias(), ['id' => 'module_alias']) }}
</div>
</div>
<x-form.group.category
:value="$category"
:dynamic-attributes="$field['attributes']"
without-add-new
/>
@break
@default
@php
$type = str_replace('Group', '', $type);
$componentName = 'form.group.' . $type;
@endphp
@can('update-' . $module->getAlias() . '-settings')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('settings.index') }}
</div>
</div>
@endcan
<x-dynamic-component :component="$componentName" name="{{ $field['name'] }}" label="{{ trans($field['title']) }}" :dynamic-attributes="$field['attributes']" />
@endswitch
@endforeach
{!! Form::close() !!}
</div>
@endsection
<x-form.input.hidden name="module_alias" :value="$module->getAlias()" />
</x-slot>
</x-form.section>
@push('scripts_start')
<script src="{{ asset('public/js/settings/modules.js?v=' . version('short')) }}"></script>
@endpush
@can('update-' . $module->getAlias() . '-settings')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
<x-script folder="settings" file="settings" />
</x-layouts.admin>

View File

@ -1,54 +1,62 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('settings.scheduling.name') }}</x-slot>
@section('title', trans('settings.scheduling.name'))
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" route="settings.schedule.update">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.invoices', 1) }}" description="{{ trans('settings.scheduling.form_description.invoice') }}" />
</x-slot>
@section('content')
{!! Form::open([
'id' => 'setting',
'method' => 'PATCH',
'route' => 'settings.update',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<x-slot name="body">
<x-form.group.toggle name="send_invoice_reminder" label="{{ trans('settings.scheduling.send_invoice') }}" :value="setting('schedule.send_invoice_reminder')" not-required />
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::radioGroup('send_invoice_reminder', trans('settings.scheduling.send_invoice'), setting('schedule.send_invoice_reminder')) }}
<x-form.group.text name="invoice_days" label="{{ trans('settings.scheduling.invoice_days') }}" value="{{ setting('schedule.invoice_days') }}" not-required />
</x-slot>
</x-form.section>
{{ Form::textGroup('invoice_days', trans('settings.scheduling.invoice_days'), 'calendar', [], setting('schedule.invoice_days')) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.bills', 1) }}" description="{{ trans('settings.scheduling.form_description.bill') }}" />
</x-slot>
{{ Form::radioGroup('send_bill_reminder', trans('settings.scheduling.send_bill'), setting('schedule.send_bill_reminder')) }}
<x-slot name="body">
<x-form.group.toggle name="send_bill_reminder" label="{{ trans('settings.scheduling.send_bill') }}" :value="setting('schedule.send_bill_reminder')" not-required />
{{ Form::textGroup('bill_days', trans('settings.scheduling.bill_days'), 'calendar', [], setting('schedule.bill_days')) }}
<x-form.group.text name="bill_days" label="{{ trans('settings.scheduling.bill_days') }}" value="{{ setting('schedule.bill_days') }}" not-required />
</x-slot>
</x-form.section>
<div class="col-sm-6">
<label for="cron_command" class="form-control-label">{{ trans('settings.scheduling.cron_command') }}</label>
<input type="text" class="form-control form-control-muted" value="php {{ base_path('artisan') }} schedule:run >> /dev/null 2>&1">
</div>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('settings.scheduling.cron_command') }}" description="{{ trans('settings.scheduling.form_description.cron') }}" />
</x-slot>
{{ Form::textGroup('time', trans('settings.scheduling.schedule_time'), 'clock', [], setting('schedule.time')) }}
</div>
</div>
<x-slot name="body">
<div class="sm:col-span-6">
<label for="cron_command" class="form-control-label">
{{ trans('settings.scheduling.command') }}
</label>
<input type="text" class="form-element form-element-muted" disabled value="php {{ base_path('artisan') }} schedule:run >> /dev/null 2>&1">
</div>
@can('update-settings-settings')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('settings.index') }}
</div>
</div>
@endcan
</div>
<x-form.group.text name="time" label="{{ trans('settings.scheduling.schedule_time') }}" value="{{ setting('schedule.time') }}" not-required />
</x-slot>
</x-form.section>
{!! Form::hidden('_prefix', 'schedule') !!}
@can('update-settings-schedule')
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
@endcan
{!! Form::close() !!}
@endsection
<x-form.input.hidden name="_prefix" value="schedule" />
</x-form>
</x-form.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/settings/settings.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="settings" />
</x-layouts.admin>

View File

@ -1,216 +0,0 @@
@extends('layouts.admin')
@section('title', trans_choice('general.settings',2))
@section('content')
<div class="card shadow">
<div class="card-body">
<div class="row">
@can('read-settings-company')
<div class="col-md-4">
<a href="{{ route('settings.company.edit') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fa fa-building" ></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans_choice('general.companies', 1) }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.company.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-localisation')
<div class="col-md-4">
<a href="{{ route('settings.localisation.edit') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fas fa-map-marker-alt"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans_choice('general.localisations', 1) }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.localisation.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-invoice')
<div class="col-md-4">
<a href="{{ route('settings.invoice.edit') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fas fa-file-alt"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans_choice('general.invoices', 1) }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.invoice.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-defaults')
<div class="col-md-4">
<a href="{{ route('settings.default.edit') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fa fa-sliders-h"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans_choice('general.defaults', 1) }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.default.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-email')
<div class="col-md-4">
<a href="{{ route('settings.email.edit') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fa fa-envelope"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans('general.email') }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.email.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-schedule')
<div class="col-md-4">
<a href="{{ route('settings.schedule.edit') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fas fa-history"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans('settings.scheduling.name') }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.scheduling.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-categories')
<div class="col-md-4">
<a href="{{ route('categories.index') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fa fa-folder"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans_choice('general.categories', 2) }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.categories.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-currencies')
<div class="col-md-4">
<a href="{{ route('currencies.index') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fa fa-dollar-sign"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans_choice('general.currencies', 2) }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.currencies.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@can('read-settings-taxes')
<div class="col-md-4">
<a href="{{ route('taxes.index') }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="fas fa-percent"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ trans_choice('general.taxes', 2) }}</h4>
<p class="text-sm text-muted mb-0">{{ trans('settings.taxes.description') }}</p>
</div>
</div>
</button>
</a>
</div>
@endcan
@foreach($modules as $module)
<div class="col-md-4">
<a href="{{ url($module['url']) }}">
<button type="button" class="btn-icon-clipboard p-2">
<div class="row mx-0">
<div class="col-auto">
<div class="badge badge-secondary settings-icons">
<i class="{{ $module['icon'] }}"></i>
</div>
</div>
<div class="col ml--2">
<h4 class="mb-0">{{ $module['name'] }}</h4>
<p class="text-sm text-muted mb-0">{{ $module['description'] }}</p>
</div>
</div>
</button>
</a>
</div>
@endforeach
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/settings.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -1,41 +1,39 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}
</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}"
icon="percent"
route="tax_rates.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'taxes.store',
'id' => 'tax',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<x-slot name="content">
<x-form.container>
<x-form id="tax" route="taxes.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('taxes.form_description.general') }}" />
</x-slot>
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
<x-slot name="body">
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent', ['@input' => 'onChangeTaxRate']) }}
<x-form.group.text name="rate" label="{{ trans('taxes.rate_percent') }}" not-required @input="onChangeTaxRate" />
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, 'normal', ['disabledOptions' => $disable_options]) }}
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" selected="normal" :disabledOptions="$disable_options" />
</x-slot>
</x-form.section>
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
</div>
</div>
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="taxes.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('taxes.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/taxes.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="taxes" />
</x-layouts.admin>

View File

@ -1,44 +1,37 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.tax_rates', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.tax_rates', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="tax" method="PATCH" :route="['taxes.update', $tax->id]" :model="$tax">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('taxes.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($tax, [
'id' => 'tax',
'method' => 'PATCH',
'route' => ['taxes.update', $tax->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<x-slot name="body">
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
<x-form.group.text name="rate" label="{{ trans('taxes.rate_percent') }}" not-required @input="onChangeTaxRate" />
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent', ['@input' => 'onChangeTaxRate']) }}
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" :disabledOptions="$disable_options" />
</x-slot>
</x-form.section>
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, $tax->type, ['disabledOptions' => $disable_options]) }}
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
{{ Form::radioGroup('enabled', trans('general.enabled'), $tax->enabled) }}
</div>
</div>
@can('update-settings-taxes')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="taxes.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
@can('update-settings-taxes')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('taxes.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/settings/taxes.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="taxes" />
</x-layouts.admin>

View File

@ -1,95 +1,110 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.tax_rates', 2) }}
</x-slot>
@section('title', trans_choice('general.tax_rates', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.tax_rates', 2) }}"
icon="percent"
route="tax_rates.index"
></x-slot>
@can('create-settings-taxes')
@section('new_button')
<a href="{{ route('taxes.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endsection
@endcan
<x-slot name="buttons">
@can('create-settings-taxes')
<x-link href="{{ route('taxes.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.taxes', 1)]) }}
</x-link>
@endcan
</x-slot>
@section('content')
@if ($taxes->count() || request()->get('search', false))
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'taxes.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Setting\Tax" />
</div>
<x-slot name="moreButtons">
<x-dropdown id="dropdown-more-actions">
<x-slot name="trigger">
<span class="material-icons">more_horiz</span>
</x-slot>
{{ Form::bulkActionRowGroup('general.taxes', $bulk_actions, ['group' => 'settings', 'type' => 'taxes']) }}
{!! Form::close() !!}
</div>
@can('create-settings-taxes')
<x-dropdown.link href="{{ route('import.create', ['settings', 'taxes']) }}">
{{ trans('import.import') }}
</x-dropdown.link>
@endcan
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 col-lg-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-4">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 d-none d-md-block">@sortablelink('rate', trans('taxes.rate_percent'))</th>
<th class="col-sm-2 col-md-2 col-lg-2 d-none d-sm-block">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-dropdown.link href="{{ route('taxes.export', request()->input()) }}">
{{ trans('general.export') }}
</x-dropdown.link>
</x-dropdown>
</x-slot>
<tbody>
<x-slot name="content">
@if ($taxes->count() || request()->get('search', false))
<x-index.container>
<x-index.search
search-string="App\Models\Setting\Tax"
bulk-action="App\BulkActions\Settings\Taxes"
/>
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
<x-index.bulkaction.all />
</x-table.th>
<x-table.th class="w-5/12">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</x-table.th>
<x-table.th class="w-4/12">
<x-sortablelink column="type" title="{{ trans_choice('general.types', 1) }}" />
</x-table.th>
<x-table.th class="w-3/12">
<x-sortablelink column="rate" title="{{ trans('taxes.rate_percent') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($taxes as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-4"><a class="col-aka" href="{{ route('taxes.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-md-2 col-lg-2 d-none d-md-block">{{ $item->rate }}</td>
<td class="col-sm-2 col-md-2 col-lg-2 d-none d-sm-block">{{ $types[$item->type] }}</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2">
@if (user()->can('update-settings-taxes'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('taxes.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-settings-taxes')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'taxes.destroy', 'tax_rates') !!}
@endcan
<x-table.tr href="{{ route('taxes.edit', $item->id) }}">
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
</x-table.td>
<x-table.td class="w-5/12 truncate">
<x-slot name="first" class="flex" override="class">
<div class="font-bold truncate">
{{ $item->name }}
</div>
</div>
</td>
</tr>
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.tax_rates', 1) }}" />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 truncate">
{{ $types[$item->type] }}
</x-table.td>
<x-table.td class="w-3/12 relative">
{{ $item->rate }}
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</tbody>
</table>
</div>
</x-table.tbody>
</x-table>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $taxes])
</div>
</div>
</div>
@else
<x-empty-page group="settings" page="taxes" />
@endif
@endsection
<x-pagination :items="$taxes" />
</x-index.container>
@else
<x-empty-page group="settings" page="taxes" />
@endif
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/settings/taxes.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="settings" file="taxes" />
</x-layouts.admin>