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,38 +1,52 @@
@extends('layouts.auth')
<x-layouts.auth>
<x-slot name="title">
{{ trans('auth.reset_password') }}
</x-slot>
@section('title', trans('auth.reset_password'))
<x-slot name="content">
<div>
<img src="{{ asset('public/img/akaunting-logo-green.svg') }}" class="w-16" alt="Akaunting" />
@section('message', trans('auth.reset_password'))
@section('content')
<div role="alert" class="alert alert-success d-none" :class="(form.response.success) ? 'show' : ''" v-if="form.response.success" v-html="form.response.message"></div>
<div role="alert" class="alert alert-danger d-none" :class="(form.response.error) ? 'show' : ''" v-if="form.response.error" v-html="form.response.message"></div>
{!! Form::open([
'route' => 'forgot',
'id' => 'forgot',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
@stack('email_input_start')
{{ Form::emailGroup('email', false, 'envelope', ['placeholder' => trans('general.email')], null, 'has-feedback', 'input-group-alternative') }}
@stack('email_input_end')
<div class="row">
<div class="col-xs-12 col-sm-12">
{!! Form::button(
'<div class="aka-loader"></div> <span>' . trans('general.send') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-success float-right', 'data-loading-text' => trans('general.loading')]) !!}
</div>
<h1 class="text-lg my-3">
{{ trans('auth.reset_password') }}
</h1>
</div>
{!! Form::close() !!}
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/forgot.js?v=' . version('short')) }}"></script>
@endpush
<div :class="(form.response.success) ? 'w-full bg-green-100 text-green-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.success"
v-html="form.response.message"
v-cloak
></div>
<div :class="(form.response.error) ? 'w-full bg-red-100 text-red-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.error"
v-html="form.response.message"
v-cloak
></div>
<x-form id="auth" route="forgot">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 items-center my-3.5 lg:h-64">
<x-form.group.email
name="email"
label="{{ trans('general.email') }}"
placeholder="{{ trans('general.email') }}"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<x-button
type="submit"
::disabled="form.loading"
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100 sm:col-span-6"
override="class"
data-loading-text="{{ trans('general.loading') }}"
>
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': form.loading}]">{{ trans('general.send') }}</span>
</x-button>
</div>
</x-form>
</x-slot>
<x-script folder="auth" file="common" />
</x-layouts.auth>

View File

@ -1,58 +1,83 @@
@extends('layouts.auth')
<x-layouts.auth>
<x-slot name="title">
{{ trans('auth.login') }}
</x-slot>
@section('title', trans('auth.login'))
<x-slot name="content">
<div>
<img src="{{ asset('public/img/akaunting-logo-green.svg') }}" class="w-16" alt="Akaunting" />
@section('message', trans('auth.login_to'))
@section('content')
<div role="alert" class="alert alert-danger d-none" :class="(form.response.error) ? 'show' : ''" v-if="form.response.error" v-html="form.response.message"></div>
{!! Form::open([
'route' => 'login',
'id' => 'login',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
{{ Form::emailGroup('email', false, 'envelope', ['placeholder' => trans('general.email')], null, 'has-feedback', 'input-group-alternative') }}
{{ Form::passwordGroup('password', false, 'unlock-alt', ['placeholder' => trans('install.database.password')], 'has-feedback', 'input-group-alternative') }}
<div class="row align-items-center">
@stack('remember_input_start')
<div class="col-xs-12 col-sm-8">
<div class="custom-control custom-control-alternative custom-checkbox">
{{ Form::checkbox('remember', 1, null, [
'id' => 'checkbox-remember',
'class' => 'custom-control-input',
'v-model' => 'form.remember'
]) }}
<label class="custom-control-label" for="checkbox-remember">
<span class="text-white">{{ trans('auth.remember_me') }}</span>
</label>
</div>
</div>
@stack('remember_input_end')
<div class="col-xs-12 col-sm-4">
{!! Form::button(
'<div class="aka-loader"></div> <span>' . trans('auth.login') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-success float-right', 'data-loading-text' => trans('general.loading')]) !!}
</div>
<h1 class="text-lg my-3">
{{ trans('auth.login_to') }}
</h1>
</div>
@stack('forgotten-password-start')
<div class="mt-5 mb--4">
<a href="{{ route('forgot') }}" class="text-white"><small>{{ trans('auth.forgot_password') }}</small></a>
</div>
@stack('forgotten-password-end')
{!! Form::close() !!}
@endsection
<div :class="(form.response.success) ? 'w-full bg-green-100 text-green-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.success"
v-html="form.response.message"
v-cloak
></div>
@push('scripts_start')
<script src="{{ asset('public/js/auth/login.js?v=' . version('short')) }}"></script>
@endpush
<div :class="(form.response.error) ? 'w-full bg-red-100 text-red-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.error"
v-html="form.response.message"
v-cloak
></div>
<x-form id="auth" route="login">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5 lg:h-64">
<x-form.group.email
name="email"
label="{{ trans('general.email') }}"
placeholder="{{ trans('general.email') }}"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<x-form.group.password
name="password"
label="{{ trans('auth.password.pass') }}"
placeholder="********"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<div class="sm:col-span-6 flex flex-row justify-between items-center">
@stack('remember_input_start')
<div>
<x-form.input.checkbox
name="remember"
label="{{ trans('auth.remember_me') }}"
value="1"
v-model="form.remember"
id="checkbox-remember"
class="text-purple focus:outline-none focus:ring-purple focus:border-purple"
/>
</div>
@stack('remember_input_end')
@stack('forgotten-password-start')
<a href="{{ route('forgot') }}" class="text-black-400 hover:text-black-700 text-sm">
{{ trans('auth.forgot_password') }}
</a>
@stack('forgotten-password-end')
</div>
<x-button
type="submit"
::disabled="form.loading"
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100 sm:col-span-6"
override="class"
data-loading-text="{{ trans('general.loading') }}"
>
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': form.loading}]">
{{ trans('auth.login') }}
</span>
</x-button>
</div>
</x-form>
</x-slot>
<x-script folder="auth" file="common" />
</x-layouts.auth>

View File

@ -1,39 +0,0 @@
@extends('layouts.admin')
@section('title', trans('general.title.new', ['type' => trans_choice('general.permissions', 1)]))
@section('content')
<div class="card">
{!! Form::open([
'route' => 'permissions.store',
'id' => 'permission',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'font') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('permissions.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/permissions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -1,42 +0,0 @@
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.permissions', 1)]))
@section('content')
<div class="card">
{!! Form::model($permission, [
'id' => 'permission',
'method' => 'PATCH',
'route' => ['permissions.update', $permission->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'font') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
@can('update-auth-permissions')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('permissions.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/permissions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -1,77 +0,0 @@
@extends('layouts.admin')
@section('title', trans_choice('general.permissions', 2))
@can('create-auth-permissions')
@section('new_button')
<a href="{{ route('permissions.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endsection
@endcan
@section('content')
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'permissions.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Auth\Permission" />
</div>
{{ Form::bulkActionRowGroup('general.permissions', $bulk_actions, ['group' => 'auth', 'type' => 'permissions']) }}
{!! Form::close() !!}
</div>
<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-1 col-lg-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-4">@sortablelink('display_name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-3 long-texts">@sortablelink('name', trans('general.code'))</th>
<th class="col-md-2 col-lg-3 d-none d-md-block long-texts">@sortablelink('description', trans('general.description'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($permissions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->name) }}</td>
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-4"><a class="col-aka" href="{{ route('permissions.edit', $item->id) }}">{{ $item->display_name }}</a></td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-3 long-texts">{{ $item->name }}</td>
<td class="col-md-2 col-lg-3 d-none d-md-block long-texts">{{ $item->description }}</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('permissions.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-auth-permissions')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'permissions.destroy') !!}
@endcan
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $permissions])
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/permissions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -0,0 +1,64 @@
<x-layouts.auth>
<x-slot name="title">
{{ trans('auth.register_user') }}
</x-slot>
<x-slot name="content">
<div>
<img src="{{ asset('public/img/akaunting-logo-green.svg') }}" class="w-16" alt="Akaunting" />
<h1 class="text-lg my-3">
{{ trans('auth.register_user') }}
</h1>
</div>
<div :class="(form.response.success) ? 'w-full bg-green-100 text-green-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.success"
v-html="form.response.message"
v-cloak
></div>
<div :class="(form.response.error) ? 'w-full bg-red-100 text-red-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.error"
v-html="form.response.message"
v-cloak
></div>
<x-form id="auth" route="register.store">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5 lg:h-64">
<x-form.input.hidden name="token" value="{{ $token }}" />
<x-form.group.password
name="password"
label="{{ trans('auth.password.pass') }}"
placeholder="********"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<x-form.group.password
name="password_confirmation"
label="{{ trans('auth.password.pass_confirm') }}"
placeholder="********"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<x-button
type="submit"
::disabled="form.loading"
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100 sm:col-span-6"
override="class"
data-loading-text="{{ trans('general.loading') }}"
>
<i v-if="form.loading" class="submit-spin absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto"></i>
<span :class="[{'opacity-0': form.loading}]">
{{ trans('auth.register') }}
</span>
</x-button>
</div>
</x-form>
</x-slot>
<x-script folder="auth" file="common" />
</x-layouts.auth>

View File

@ -1,47 +1,69 @@
@extends('layouts.auth')
<x-layouts.auth>
<x-slot name="title">
{{ trans('auth.reset_password') }}
</x-slot>
@section('title', trans('auth.reset_password'))
<x-slot name="content">
<div>
<img src="{{ asset('public/img/akaunting-logo-green.svg') }}" class="w-16" alt="Akaunting" />
@section('message', trans('auth.reset_password'))
@section('content')
<div role="alert" class="alert alert-danger d-none" :class="(form.response.error) ? 'show' : ''" v-if="form.response.error" v-html="form.response.message"></div>
{!! Form::open([
'route' => 'reset.store',
'id' => 'reset',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<input type="hidden" name="token" value="{{ $token }}">
@stack('email_input_start')
{{ Form::emailGroup('email', false, 'envelope', ['placeholder' => trans('general.email')], null, 'has-feedback', 'input-group-alternative') }}
@stack('email_input_end')
@stack('password_input_start')
{{ Form::passwordGroup('password', false, 'unlock-alt', ['placeholder' => trans('auth.password.new')], 'has-feedback', 'input-group-alternative') }}
@stack('password_input_end')
@stack('password_confirmation_input_start')
{{ Form::passwordGroup('password_confirmation', false, 'unlock-alt', ['placeholder' => trans('auth.password.new_confirm')], 'has-feedback', 'input-group-alternative') }}
@stack('password_confirmation_input_end')
<div class="row">
<div class="col-xs-12 col-sm-12">
{!! Form::button(
'<div class="aka-loader"></div> <span>' . trans('auth.reset') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-success float-right', 'data-loading-text' => trans('general.loading')]) !!}
</div>
<h1 class="text-lg my-3">
{{ trans('auth.reset_password') }}
</h1>
</div>
{!! Form::close() !!}
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/reset.js?v=' . version('short')) }}"></script>
@endpush
<div :class="(form.response.success) ? 'w-full bg-green-100 text-green-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.success"
v-html="form.response.message"
v-cloak
></div>
<div :class="(form.response.error) ? 'w-full bg-red-100 text-red-600 p-3 rounded-sm font-semibold text-xs' : 'hidden'"
v-if="form.response.error"
v-html="form.response.message"
v-cloak
></div>
<x-form id="auth" route="reset.store">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 items-center my-3.5 lg:h-64">
<x-form.input.hidden name="token" value="{{ $token }}" />
<x-form.group.email
name="email"
label="{{ trans('general.email') }}"
placeholder="{{ trans('general.email') }}"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<x-form.group.password
name="password"
label="{{ trans('auth.password.new') }}"
placeholder="{{ trans('auth.password.new') }}"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<x-form.group.password
name="password_confirmation"
label="{{ trans('auth.password.new_confirm') }}"
form-group-class="sm:col-span-6"
input-group-class="input-group-alternative"
/>
<x-button
type="submit"
::disabled="form.loading"
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100 sm:col-span-6"
override="class"
data-loading-text="{{ trans('general.loading') }}"
>
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': form.loading}]">{{ trans('auth.reset') }}</span>
</x-button>
</div>
</x-form>
</x-slot>
<x-script folder="auth" file="common" />
</x-layouts.auth>

View File

@ -1,101 +0,0 @@
@extends('layouts.admin')
@section('title', trans('general.title.new', ['type' => trans_choice('general.roles', 1)]))
@section('content')
{!! Form::open([
'id' => 'role',
'route' => 'roles.store',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'font') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
</div>
<div id="role-permissions">
<label for="permissions" class="form-control-label d-block">{{trans_choice('general.permissions', 2)}}</label>
<span class="btn btn-outline-primary btn-sm" @click="permissionSelectAll">{{trans('general.select_all')}}</span>
<span class="btn btn-outline-primary btn-sm" @click="permissionUnselectAll">{{trans('general.unselect_all')}}</span>
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
@foreach($actions as $action)
@php $active_action_tab = ($action == 'read') ? 'active' : ''; @endphp
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 {{ $active_action_tab }}" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tab-{{ $action }}" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">{{ ucwords($action) }}</a>
</li>
@endforeach
</ul>
</div>
<div class="card">
<div class="card-body">
<div class="tab-content">
@foreach($permissions as $action => $action_permissions)
@php $active_action_tab = ($action == 'read') ? 'active' : ''; @endphp
<div class="tab-pane fade show {{ $active_action_tab }}" id="tab-{{ $action }}" ref="tab-{{ $action }}" role="tabpanel">
<span class="btn btn-primary btn-sm" @click="select('{{ $action }}')">{{ trans('general.select_all') }}</span>
<span class="btn btn-primary btn-sm" @click="unselect('{{ $action }}')">{{ trans('general.unselect_all') }}</span>
@stack('permissions_input_start')
<div class="form-group {{ $errors->has('permissions') ? 'has-error' : '' }}">
<div class="row pt-4">
@foreach($action_permissions as $item)
<div class="col-md-4 role-list">
<div class="custom-control custom-checkbox">
@if (($item->name == 'read-admin-panel'))
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions', ':disabled' => 'form.permissions.includes(permissions.read_client_portal)']) }}
@elseif (($item->name == 'read-client-portal'))
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions', ':disabled' => 'form.permissions.includes(permissions.read_admin_panel)']) }}
@else
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions']) }}
@endif
<label class="custom-control-label" for="permissions-{{ $item->id }}">
{{ $item->title }}
</label>
</div>
</div>
@if (($item->name == 'read-admin-panel') || ($item->name == 'read-client-portal'))
{{ Form::hidden($item->name, $item->id, ['id' => $item->name]) }}
@endif
@endforeach
{!! $errors->first('permissions', '<p class="help-block">:message</p>') !!}
</div>
</div>
@stack('permissions_input_end')
</div>
@endforeach
</div>
</div>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('roles.index') }}
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/roles.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -1,104 +0,0 @@
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.roles', 1)]))
@section('content')
{!! Form::model($role, [
'id' => 'role',
'method' => 'PATCH',
'route' => ['roles.update', $role->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true,
]) !!}
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'font') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
</div>
<div id="role-permissions">
<label for="permissions" class="form-control-label d-block">{{trans_choice('general.permissions', 2)}}</label>
<span class="btn btn-outline-primary btn-sm" @click="permissionSelectAll">{{trans('general.select_all')}}</span>
<span class="btn btn-outline-primary btn-sm" @click="permissionUnselectAll">{{trans('general.unselect_all')}}</span>
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
@foreach($actions as $action)
@php $active_action_tab = ($action == 'read') ? 'active' : ''; @endphp
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 {{ $active_action_tab }}" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tab-{{ $action }}" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">{{ ucwords($action) }}</a>
</li>
@endforeach
</ul>
</div>
<div class="card">
<div class="card-body">
<div class="tab-content">
@foreach($permissions as $action => $action_permissions)
@php $active_action_tab = ($action == 'read') ? 'active' : ''; @endphp
<div class="tab-pane fade show {{ $active_action_tab }}" id="tab-{{ $action }}" ref="tab-{{ $action }}" role="tabpanel">
<span class="btn btn-primary btn-sm" @click="select('{{ $action }}')">{{ trans('general.select_all') }}</span>
<span class="btn btn-primary btn-sm" @click="unselect('{{ $action }}')">{{ trans('general.unselect_all') }}</span>
@stack('permissions_input_start')
<div class="form-group {{ $errors->has('permissions') ? 'has-error' : '' }}">
<div class="row pt-4">
@foreach($action_permissions as $item)
<div class="col-md-4 role-list">
<div class="custom-control custom-checkbox">
@if (($item->name == 'read-admin-panel'))
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions', ':disabled' => 'form.permissions.includes(permissions.read_client_portal)']) }}
@elseif (($item->name == 'read-client-portal'))
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions', ':disabled' => 'form.permissions.includes(permissions.read_admin_panel)']) }}
@else
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions']) }}
@endif
<label class="custom-control-label" for="permissions-{{ $item->id }}">
{{ $item->title }}
</label>
</div>
</div>
@if (($item->name == 'read-admin-panel') || ($item->name == 'read-client-portal'))
{{ Form::hidden($item->name, $item->id, ['id' => $item->name]) }}
@endif
@endforeach
{!! $errors->first('permissions', '<p class="help-block">:message</p>') !!}
</div>
</div>
@stack('permissions_input_end')
</div>
@endforeach
</div>
</div>
@can('update-auth-roles')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('roles.index') }}
</div>
</div>
@endcan
</div>
</div>
{!! Form::close() !!}
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/roles.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -1,77 +0,0 @@
@extends('layouts.admin')
@section('title', trans_choice('general.roles', 2))
@can('create-auth-roles')
@section('new_button')
<a href="{{ route('roles.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endsection
@endcan
@section('content')
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'roles.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Auth\Role" />
</div>
{{ Form::bulkActionRowGroup('general.roles', $bulk_actions, ['group' => 'auth', 'type' => 'roles']) }}
{!! Form::close() !!}
</div>
<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-3 col-md-2 col-lg-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-4 col-lg-4">@sortablelink('display_name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-3 col-md-4 col-lg-3">@sortablelink('name', trans('general.code'))</th>
<th class="col-lg-3 d-none d-lg-block">@sortablelink('description', trans('general.description'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($roles as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-3 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-4 col-lg-4"><a class="col-aka" href="{{ route('roles.edit', $item->id) }}">{{ $item->display_name }}</a></td>
<td class="col-xs-4 col-sm-3 col-md-4 col-lg-3">{{ $item->name }}</td>
<td class="col-lg-3 d-none d-lg-block">{{ $item->description }}</td>
<td class="col-xs-4 col-sm-3 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('roles.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-auth-roles')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'roles.destroy') !!}
@endcan
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $roles])
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/roles.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -1,82 +1,73 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.invite', ['type' => trans_choice('general.users', 1)]) }}</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.users', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.invite', ['type' => trans_choice('general.users', 1)]) }}"
icon="people"
route="users.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'users.store',
'id' => 'user',
'@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="user" route="users.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('auth.personal_information') }}" description="{{ trans('auth.form_description.personal') }}" />
</x-slot>
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
<x-slot name="body">
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 grid-rows-2">
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
<x-form.group.email name="email" label="{{ trans('general.email') }}" />
</div>
{{ Form::passwordGroup('password', trans('auth.password.current'), 'key') }}
<div class="sm:col-span-3">
@if (setting('default.use_gravatar', '0') == '1')
<x-form.group.text name="fake_picture" label="{{ trans_choice('general.pictures', 1) }}" disabled placeholder="{{ trans('settings.default.use_gravatar') }}" />
@else
<x-form.group.file name="picture" label="{{ trans_choice('general.pictures', 1) }}" not-required />
@endif
</div>
</x-slot>
</x-form.section>
{{ Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key') }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{!! trans('auth.form_description.assign', ['url' => $roles_url]) !!}" />
</x-slot>
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('default.locale')) }}
<x-slot name="body">
@can('read-common-companies')
<x-form.group.select multiple remote name="companies" label="{{ trans_choice('general.companies', 2) }}" :options="$companies" remote_action="{{ route('companies.index') }}" form-group-class="sm:col-span-6" />
@endcan
{{ Form::selectGroup('landing_page', trans('auth.landing_page'), 'sign-in-alt', $landing_pages, 'dashboard') }}
@role('admin|manager')
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" />
@endrole
</x-slot>
</x-form.section>
@if (setting('default.use_gravatar', '0') == '1')
@stack('picture_input_start')
<div class="form-group col-md-6 disabled">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fa fa-image"></i>
</span>
</div>
{!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.default.use_gravatar')]) !!}
</div>
</div>
@stack('picture_input_end')
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file']) }}
@endif
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.preferences') }}" description="{{ trans('auth.form_description.preferences') }}" />
</x-slot>
@can('read-common-companies')
{{ Form::multiSelectRemoteGroup('companies', trans_choice('general.companies', 2), 'user', $companies, [], ['required' => 'required', 'remote_action' => route('companies.index')]) }}
@endcan
<x-slot name="body">
<x-form.group.select name="landing_page" label="{{ trans('auth.landing_page') }}" :options="$landing_pages" selected="dashboard" />
@can('read-auth-roles')
{{ Form::checkboxGroup('roles', trans_choice('general.roles', 2), $roles, 'display_name') }}
@endcan
<x-form.group.locale />
</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="users.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('users.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('stylesheet')
<style type="text/css">
.el-select .el-select__tags > span {
display: flex;
margin-bottom: -75px;
}
</style>
@endpush
@push('scripts_start')
<script src="{{ asset('public/js/auth/users.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="auth" file="users" />
</x-layouts.admin>

View File

@ -1,89 +1,87 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.users', 1)]) }}</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.users', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="user" method="PATCH" :route="[$route, $user->id]" :model="$user">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('auth.personal_information') }}" description="{{ trans('auth.form_description.personal') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($user, [
'id' => 'user',
'method' => 'PATCH',
'route' => ['users.update', $user->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">
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 {{ user()->id == $user->id ? 'grid-rows-3' : 'grid-rows-2' }}">
<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.email name="email" label="{{ trans('general.email') }}" />
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
@if (user()->id == $user->id)
<x-form.group.checkbox name="change_password" :options="['1' => trans('auth.change_password')]" form-group-class="sm:col-span-3" @input="onChangePassword($event)" />
{{ Form::passwordGroup('password', trans('auth.password.current'), 'key', []) }}
<x-form.group.password name="password" :label="trans('auth.password.new')" v-show="show_password" />
@endif
</div>
{{ Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', []) }}
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 {{ user()->id == $user->id ? 'grid-rows-3' : 'grid-rows-2' }}">
@if (setting('default.use_gravatar', '0') == '1')
<x-form.group.text name="fake_picture" label="{{ trans_choice('general.pictures', 1) }}" disabled placeholder="{{ trans('settings.default.use_gravatar') }}" form-group-class="sm:col-span-3 sm:row-span-2" />
@else
<x-form.group.file name="picture" label="{{ trans_choice('general.pictures', 1) }}" not-required form-group-class="sm:col-span-3 sm:row-span-2" />
@endif
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), $user->locale) }}
@if (user()->id == $user->id)
<x-form.group.password name="current_password" :label="trans('auth.password.current')" v-show="show_password" />
{{ Form::selectGroup('landing_page', trans('auth.landing_page'), 'sign-in-alt', $landing_pages, $user->landing_page) }}
<x-form.group.password name="password_confirmation" :label="trans('auth.password.new_confirm')" v-show="show_password" />
@endif
</div>
</x-slot>
</x-form.section>
@if (setting('default.use_gravatar', '0') == '1')
@stack('picture_input_start')
<div class="form-group col-md-6 disabled">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fa fa-image"></i>
</span>
</div>
{!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.default.use_gravatar')]) !!}
</div>
</div>
@stack('picture_input_end')
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file']) }}
@endif
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{!! trans('auth.form_description.assign', ['url' => $roles_url]) !!}" />
</x-slot>
@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.index')]) }}
@endcan
<x-slot name="body">
@can('read-common-companies')
<x-form.group.select multiple remote name="companies" label="{{ trans_choice('general.companies', 2) }}" :options="$companies" selected-key="company_ids" :remote_action="route('companies.index')" form-group-class="sm:col-span-6" />
@endcan
@can('read-auth-roles')
{{ Form::checkboxGroup('roles', trans_choice('general.roles', 2), $roles, 'display_name') }}
@endcan
@role('admin|manager')
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" selected-key="roles.id" />
@endrole
</x-slot>
</x-form.section>
{{ Form::radioGroup('enabled', trans('general.enabled'), $user->enabled) }}
</div>
</div>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.preferences') }}" description="{!! trans('auth.form_description.preferences') !!}" />
</x-slot>
@canany(['update-auth-users', 'update-auth-profile'])
<div class="card-footer">
<div class="row save-buttons">
<x-slot name="body">
<x-form.group.select name="landing_page" label="{{ trans('auth.landing_page') }}" :options="$landing_pages" />
<x-form.group.locale />
</x-slot>
</x-form.section>
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
@canany(['update-auth-users', 'update-auth-profile'])
<x-form.section>
<x-slot name="foot">
@if (user()->can('read-auth-users'))
{{ Form::saveButtons('users.index') }}
<x-form.buttons cancel-route="users.index" />
@else
{{ Form::saveButtons('dashboard') }}
<x-form.buttons cancel-route="dashboard" />
@endif
</div>
</div>
@endcanany
{!! Form::close() !!}
</div>
@endsection
</x-slot>
</x-form.section>
@endcanany
</x-form>
</x-form.container>
</x-slot>
@push('stylesheet')
<style type="text/css">
.el-select .el-select__tags > span {
display: flex;
margin-bottom: -75px;
}
</style>
@endpush
@push('scripts_start')
<script src="{{ asset('public/js/auth/users.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="auth" file="users" />
</x-layouts.admin>

View File

@ -1,106 +1,110 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.users', 2) }}</x-slot>
@section('title', trans_choice('general.users', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.users', 2) }}"
icon="people"
route="users.index"
></x-slot>
@can('create-auth-users')
@section('new_button')
<a href="{{ route('users.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endsection
@endcan
<x-slot name="buttons">
@can('create-auth-users')
<x-link href="{{ route('users.create') }}" kind="primary">
{{ trans('general.title.invite', ['type' => trans_choice('general.users', 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}]">
<x-slot name="content">
@if ($users->count() || request()->get('search', false))
<x-index.container>
<x-index.search
search-string="App\Models\Auth\User"
bulk-action="App\BulkActions\Auth\User"
/>
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Auth\User" />
</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>
{{ Form::bulkActionRowGroup('general.users', $bulk_actions, ['group' => 'auth', 'type' => 'users']) }}
</div>
<x-table.th class="w-5/12">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</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-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-sm-2 col-md-2 col-lg-3 d-none d-sm-block long-texts">@sortablelink('email', trans('general.email'))</th>
<th class="col-md-2 col-lg-2 d-none d-md-block">{{ trans_choice('general.roles', 2) }}</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-4/12">
<x-sortablelink column="email" title="{{ trans('general.email') }}" />
</x-table.th>
<tbody>
@foreach($users 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">
@if (user()->id != $item->id)
{{ Form::bulkActionGroup($item->id, $item->name) }}
@else
{{ Form::bulkActionGroup($item->id, $item->name, ['disabled' => 'true']) }}
@endif
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-3">
<a class="col-aka" href="{{ route('users.edit', $item->id) }}">
<x-table.th class="w-4/12 sm:w-3/12" kind="right">
{{ trans_choice('general.roles', 1) }}
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($users as $item)
<x-table.tr href="{{ route('users.edit', $item->id) }}">
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
@if (user()->id != $item->id)
<x-index.bulkaction.single
id="{{ $item->id }}"
name="{{ $item->name }}"
:disabled="($item->hasPendingInvitation() || $item->multiplexed) ? true : false"
/>
@else
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" disabled />
@endif
</x-table.td>
<x-table.td class="w-4/12 sm:w-5/12 flex items-center">
@if (setting('default.use_gravatar', '0') == '1')
<img src="{{ $item->picture }}" alt="{{ $item->name }}" class="rounded-circle user-img p-1 mr-3 d-none d-md-inline" title="{{ $item->name }}">
<img src="{{ $item->picture }}" class="w-6 h-6 rounded-full mr-2 hidden lg:block" title="{{ $item->name }}" alt="{{ $item->name }}">
@elseif (is_object($item->picture))
<img src="{{ Storage::url($item->picture->id) }}" class="rounded-circle user-img p-1 mr-3 d-none d-md-inline" alt="{{ $item->name }}" title="{{ $item->name }}">
<img src="{{ Storage::url($item->picture->id) }}" class="w-6 h-6 rounded-full mr-2 hidden lg:block" alt="{{ $item->name }}" title="{{ $item->name }}">
@else
<img src="{{ asset('public/img/user.svg') }}" class="user-img p-1 mr-3 d-none d-md-inline" alt="{{ $item->name }}"/>
<img src="{{ asset('public/img/user.svg') }}" class="w-6 h-6 rounded-full mr-2 hidden lg:block" alt="{{ $item->name }}"/>
@endif
{{ $item->name }}
</a>
</td>
<td class="col-sm-2 col-md-2 col-lg-3 d-none d-sm-block long-texts">{{ $item->email }}</td>
<td class="col-md-2 col-lg-2 d-none d-md-block">
@foreach($item->roles as $role)
<label class="badge badge-default">{{ $role->display_name }}</label>
@endforeach
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2">
@if ((user()->id != $item->id) && user()->can('update-auth-users'))
{{ 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>
{{ !empty($item->name) ? $item->name : trans('general.na') }}
@if ($item->hasPendingInvitation())
<x-index.status status="pending" background-color="bg-status-danger" text-color="text-black" />
@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('users.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@if (user()->id != $item->id)
@can('delete-auth-users')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'users.destroy') !!}
@endcan
@endif
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $users])
</div>
</div>
</div>
@endsection
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.users', 1) }}" />
@endif
</x-table.td>
@push('scripts_start')
<script src="{{ asset('public/js/auth/users.js?v=' . version('short')) }}"></script>
@endpush
<x-table.td class="w-4/12 hidden sm:table-cell">
{{ $item->email }}
</x-table.td>
<x-table.td class="relative w-4/12 sm:w-3/12" kind="right">
@foreach($item->roles as $role)
<span class="bg-lilac-900 px-3 py-1 test-sm rounded-lg text-black ltr:ml-3 rtl:mr-3">
{{ $role->display_name }}
</span>
@endforeach
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$users" />
</x-index.container>
@else
<x-empty-page group="auth" page="users" />
@endif
</x-slot>
<x-script folder="auth" file="users" />
</x-layouts.admin>

View File

@ -1,51 +1,68 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.accounts', 1)]) }}
</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.accounts', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.accounts', 1)]) }}"
icon="account_balance"
route="accounts.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'accounts.store',
'id' => 'account',
'@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="account" route="accounts.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('accounts.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.radio
name="type"
label="{{ trans_choice('general.types', 1) }}"
:options="[
'bank' => trans_choice('accounts.banks', 1),
'credit_card' => trans_choice('accounts.credit_cards', 1),
]"
checked="bank"
@input="onType($event)"
/>
{{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }}
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="sm:col-span-6" />
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }}
<x-form.group.text name="number" label="{{ trans('accounts.number') }}" form-group-class="sm:col-span-6" />
{{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0) }}
<x-form.group.currency />
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
<x-form.group.money name="opening_balance" label="{{ trans('accounts.opening_balance') }}" value="0" :currency="$currency" dynamicCurrency="currency" />
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
<x-form.group.toggle name="default_account" label="{{ trans('accounts.default_account') }}" :value="false" show="form.type != 'credit_card'" />
</x-slot>
</x-form.section>
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('accounts.banks', 1) }}" description="{{ trans('accounts.form_description.bank') }}" />
</x-slot>
{{ Form::radioGroup('default_account', trans('accounts.default_account'), false) }}
<x-slot name="body">
<x-form.group.text name="bank_name" label="{{ trans('accounts.bank_name') }}" not-required />
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
</div>
</div>
<x-form.group.text name="bank_phone" label="{{ trans('accounts.bank_phone') }}" not-required />
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('accounts.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
<x-form.group.textarea name="bank_address" label="{{ trans('accounts.bank_address') }}" not-required />
</x-slot>
</x-form.section>
@push('scripts_start')
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
@endpush
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="accounts.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<x-script folder="banking" file="accounts" />
</x-layouts.admin>

View File

@ -1,54 +1,66 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.accounts', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.accounts', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="account" method="PATCH" :route="['accounts.update', $account->id]" :model="$account">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('accounts.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($account, [
'id' => 'account',
'method' => 'PATCH',
'route' => ['accounts.update', $account->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.radio
name="type"
label="{{ trans_choice('general.types', 1) }}"
:options="[
'bank' => trans_choice('accounts.banks', 1),
'credit_card' => trans_choice('accounts.credit_cards', 1),
]"
checked="{{ $account->type }}"
@input="onType($event)"
/>
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="sm:col-span-6" />
{{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }}
<x-form.group.text name="number" label="{{ trans('accounts.number') }}" form-group-class="sm:col-span-6" />
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $account->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }}
<x-form.group.currency />
{{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency, 'dynamic-currency' => 'currency'], $account->opening_balance) }}
<x-form.group.money name="opening_balance" label="{{ trans('accounts.opening_balance') }}" :value="$account->opening_balance" :currency="$currency" dynamicCurrency="currency" />
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
<x-form.group.toggle name="default_account" label="{{ trans('accounts.default_account') }}" :value="$account->default_account" show="form.type != 'credit_card'" />
</x-slot>
</x-form.section>
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('accounts.banks', 1) }}" description="{{ trans('accounts.form_description.bank') }}" />
</x-slot>
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
<x-slot name="body">
<x-form.group.text name="bank_name" label="{{ trans('accounts.bank_name') }}" not-required />
{{ Form::radioGroup('default_account', trans('accounts.default_account'), $account->default_account) }}
<x-form.group.text name="bank_phone" label="{{ trans('accounts.bank_phone') }}" not-required />
{{ Form::radioGroup('enabled', trans('general.enabled'), $account->enabled) }}
</div>
</div>
<x-form.group.textarea name="bank_address" label="{{ trans('accounts.bank_address') }}" not-required />
</x-slot>
</x-form.section>
@can('update-banking-accounts')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('accounts.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
@push('scripts_start')
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
@endpush
@can('update-banking-accounts')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="accounts.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
<x-script folder="banking" file="accounts" />
</x-layouts.admin>

View File

@ -1,93 +1,118 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.accounts', 2) }}
</x-slot>
@section('title', trans_choice('general.accounts', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.accounts', 2) }}"
icon="account_balance"
route="accounts.index"
></x-slot>
@section('new_button')
@can('create-banking-accounts')
<a href="{{ route('accounts.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endcan
@endsection
<x-slot name="buttons">
@can('create-banking-accounts')
<x-link href="{{ route('accounts.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.accounts', 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' => 'accounts.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Banking\Account" />
</div>
<x-slot name="content">
<x-index.container>
<x-index.search
search-string="App\Models\Banking\Account"
bulk-action="App\BulkActions\Banking\Accounts"
/>
{{ Form::bulkActionRowGroup('general.accounts', $bulk_actions, ['group' => 'banking', 'type' => 'accounts']) }}
{!! 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-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block text-left">@sortablelink('number', trans('accounts.number'))</th>
<th class="col-sm-2 col-md-2 col-lg-2 col-xl-4 d-none d-sm-block text-right">@sortablelink('opening_balance', trans('accounts.current_balance'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-1">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-1 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-table.th class="w-6/12 sm:w-5/12">
<x-slot name="first">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="number" title="{{ trans('accounts.number') }}" />
</x-slot>
</x-table.th>
<tbody>
<x-table.th class="w-4/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="bank_name" title="{{ trans('accounts.bank_name') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="bank_phone" title="{{ trans('general.phone') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-6/12 sm:w-3/12" kind="amount">
<x-sortablelink column="balance" title="{{ trans('accounts.current_balance') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($accounts as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-3 long-texts"><a href="{{ route('accounts.show', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block text-left">{{ $item->number }}</td>
<td class="col-sm-2 col-md-2 col-lg-2 col-xl-4 d-none d-sm-block text-right">@money($item->balance, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-2 col-md-1 col-lg-2 col-xl-1">
@if (user()->can('update-banking-accounts'))
{{ 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 col-xl-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">
@can('update-banking-accounts')
<a class="dropdown-item" href="{{ route('accounts.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@endcan
@can('delete-banking-accounts')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'accounts.destroy') !!}
@endcan
<x-table.tr href="{{ route('accounts.show', $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-5/12 truncate">
<x-slot name="first" class="flex">
<div class="font-bold truncate">
{{ $item->name }}
</div>
</div>
</td>
</tr>
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.accounts', 1) }}" />
@endif
@if (setting('default.account') == $item->id)
<x-index.default text="{{ trans('accounts.default_account') }}" />
@endif
</x-slot>
<x-slot name="second" class="font-normal truncate">
{{ $item->number }}
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 truncate hidden sm:table-cell">
<x-slot name="first">
@if (! empty($item->bank_name))
{{ $item->bank_name }}
@else
<x-empty-data />
@endif
</x-slot>
<x-slot name="second">
@if (! empty($item->phone))
{{ $item->phone }}
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-6/12 sm:w-3/12" kind="amount">
<x-money :amount="$item->balance" :currency="$item->currency_code" convert />
</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' => $accounts])
</div>
</div>
</div>
@endsection
<x-pagination :items="$accounts" />
</x-index.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="banking" file="accounts" />
</x-layouts.admin>

View File

@ -1,281 +1,448 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ $account->name }}
</x-slot>
@section('title', $account->name)
<x-slot name="status">
@if (! $account->enabled)
<x-index.disable text="{{ trans_choice('general.accounts', 1) }}" />
@endif
@section('new_button')
<div class="dropup header-drop-top">
<button type="button" class="btn btn-white btn-sm" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-chevron-down"></i>&nbsp; {{ trans('general.more_actions') }}
</button>
@if (setting('default.account') == $account->id)
<x-index.default text="{{ trans('accounts.default_account') }}" />
@endif
</x-slot>
<div class="dropdown-menu" role="menu">
@stack('button_dropdown_start')
<x-slot name="favorite"
title="{{ $account->name }}"
icon="account_balance"
:route="['accounts.show', $account->id]"
></x-slot>
@stack('duplicate_button_start')
@can('create-banking-accounts')
<a class="dropdown-item" href="{{ route('accounts.duplicate', $account->id) }}">
{{ trans('general.duplicate') }}
</a>
<x-slot name="buttons">
@stack('create_button_start')
<x-dropdown id="dropdown-new-actions">
<x-slot name="trigger" class="flex items-center px-3 py-1.5 mb-3 sm:mb-0 bg-green hover:bg-green-700 rounded-xl text-white text-sm font-bold leading-6" override="class">
{{ trans('general.new_more') }}
<span class="material-icons ltr:ml-2 rtl:mr-2">expand_more</span>
</x-slot>
@stack('income_button_start')
@can('create-banking-transactions')
<x-dropdown.link href="{{ route('accounts.create-income', $account->id) }}">
{{ trans_choice('general.incomes', 1) }}
</x-dropdown.link>
@endcan
@stack('duplicate_button_end')
<div class="dropdown-divider"></div>
@stack('expense_button_start')
@stack('revenue_button_start')
@can('create-sales-revenues')
<a class="dropdown-item" href="{{ route('accounts.create-revenue', $account->id) }}">
{{ trans('general.add_income')}}
</a>
@can('create-banking-transactions')
<x-dropdown.link href="{{ route('accounts.create-expense', $account->id) }}">
{{ trans_choice('general.expenses', 1) }}
</x-dropdown.link>
@endcan
@stack('revenue_button_end')
@stack('payment_button_start')
@can('create-purchases-payments')
<a class="dropdown-item" href="{{ route('accounts.create-payment', $account->id) }}">
{{ trans('general.add_expense') }}
</a>
@endcan
@stack('payment_button_end')
@stack('transfer_button_start')
@can('create-banking-transfers')
<a class="dropdown-item" href="{{ route('accounts.create-transfer', $account->id) }}">
{{ trans('general.add_transfer') }}
</a>
<x-dropdown.link href="{{ route('accounts.create-transfer', $account->id) }}">
{{ trans_choice('general.transfers', 1) }}
</x-dropdown.link>
@endcan
@stack('transfer_button_end')
</x-dropdown>
<div class="dropdown-divider"></div>
@stack('edit_button_start')
@can('update-banking-accounts')
<x-link href="{{ route('accounts.edit', $account->id) }}">
{{ trans('general.edit') }}
</x-link>
@endcan
@stack('edit_button_end')
</x-slot>
<x-slot name="moreButtons">
@stack('more_button_start')
<x-dropdown id="dropdown-more-actions">
<x-slot name="trigger">
<span class="material-icons">more_horiz</span>
</x-slot>
@stack('see_performance_button_start')
@stack('performance_button_start')
@can('read-banking-accounts')
<a class="dropdown-item" href="{{ route('accounts.see-performance', $account->id) }}">
{{ trans('accounts.see_performance') }}
</a>
<x-dropdown.link href="{{ route('accounts.see-performance', $account->id) }}">
{{ trans('accounts.see_performance') }}
</x-dropdown.link>
@endcan
@stack('performance_button_end')
<div class="dropdown-divider"></div>
<x-dropdown.divider />
@stack('duplicate_button_start')
@can('create-banking-accounts')
<x-dropdown.link href="{{ route('accounts.duplicate', $account->id) }}">
{{ trans('general.duplicate') }}
</x-dropdown.link>
@endcan
<x-dropdown.divider />
@stack('delete_button_start')
@can('delete-sales-customers')
{!! Form::deleteLink($account, 'accounts.destroy') !!}
@can('delete-banking-accounts')
<x-delete-link :model="$account" route="accounts.destroy" />
@endcan
@stack('delete_button_end')
</x-dropdown>
@stack('button_dropdown_end')
</div>
@stack('edit_button_start')
@can('update-sales-customers')
<a href="{{ route('accounts.edit', $account->id) }}" class="btn btn-white btn-sm">
{{ trans('general.edit') }}
</a>
@endcan
@stack('edit_button_end')
</div>
@endsection
@stack('more_button_end')
</x-slot>
@section('content')
<div class="row">
<div class="col-xl-3">
<ul class="list-group mb-4">
@stack('account_number_start')
<li class="list-group-item d-flex justify-content-between align-items-center border-0 font-weight-600">
{{ trans_choice('general.accounts', 1) }} {{ trans_choice('accounts.number', 2) }}
<small>{{ $account->number}}</small>
</li>
@stack('account_number_end')
<x-slot name="content">
<x-show.container>
<x-show.summary>
<x-show.summary.left>
</x-show.summary.left>
@stack('account_currency_start')
<li class="list-group-item d-flex justify-content-between align-items-center border-0 border-top-1 font-weight-600">
{{ trans_choice('general.currencies', 2) }}
<small>{{ $account->currency->name}}</small>
</li>
@stack('account_currency_end')
<x-show.summary.right>
@stack('summary_incoming_start')
<x-slot name="first" amount="{{ money($account->income_balance, $account->currency_code, true) }}" title="{{ trans('accounts.incoming') }}"></x-slot>
@stack('summary_incoming_end')
@stack('account_starting_balance_start')
<li class="list-group-item d-flex justify-content-between align-items-center border-0 border-top-1 font-weight-600">
{{ trans_choice('accounts.opening_balance', 2) }}
<small>@money($account->opening_balance, $account->currency_code, true)</small>
</li>
@stack('account_starting_balance_end')
</ul>
@stack('summary_outgoing_start')
<x-slot name="second" amount="{{ money($account->expense_balance, $account->currency_code, true) }}" title="{{ trans('accounts.outgoing') }}"></x-slot>
@stack('summary_outgoing_end')
<ul class="list-group mb-4">
@stack('bank_name_start')
<li class="list-group-item border-0">
<div class="font-weight-600">{{ trans('accounts.bank_name') }}</div>
<div><small>{{ $account->bank_name }}</small></div>
</li>
@stack('bank_name_end')
@stack('summary_current_start')
<x-slot name="third" amount="{{ money($account->balance, $account->currency_code, true) }}" title="{{ trans('accounts.current_balance') }}"></x-slot>
@stack('summary_current_end')
</x-show.summary.right>
</x-show.summary>
@stack('account_phone_start')
<li class="list-group-item border-0 border-top-1">
<div class="font-weight-600">{{ trans('accounts.bank_phone') }}</div>
<div><small>{{ $account->bank_phone }}</small></div>
</li>
@stack('account_phone_end')
@stack('account_address_start')
<li class="list-group-item border-0 border-top-1">
<div class="font-weight-600">{{ trans('accounts.bank_address') }}</div>
<div><small>{{ $account->bank_address }}</small></div>
</li>
@stack('account_address_end')
</ul>
</div>
<div class="col-xl-9">
<div class="row mb--3">
@stack('account_incoming_card_start')
<div class="col-md-4">
<div class="card bg-gradient-info border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('accounts.incoming') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($account->income_balance, $account->currency_code, true)</span>
</div>
</div>
<x-show.content>
<x-show.content.left>
@stack('account_number_start')
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">
{{ trans('accounts.number') }}
</div>
</div>
</div>
@stack('account_incoming_card_end')
@stack('account_outgoing_card_start')
<div class="col-md-4">
<div class="card bg-gradient-danger border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('accounts.outgoing') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($account->expense_balance, $account->currency_code, true)</span>
</div>
</div>
<span>{{ $account->number }}</span>
</div>
@stack('account_number_end')
@stack('account_currency_start')
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">
{{ trans_choice('general.currencies', 2) }}
</div>
</div>
</div>
@stack('account_outgoing_card_end')
@stack('account_balance_card_start')
<div class="col-md-4">
<div class="card bg-gradient-success border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('widgets.account_balance') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($account->balance, $account->currency_code, true)</span>
</div>
</div>
<span>
{{ $account->currency->name }}
</span>
</div>
@stack('account_currency_end')
@stack('account_starting_balance_start')
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">
{{ trans_choice('accounts.opening_balance', 2) }}
</div>
<span>
<x-money :amount="$account->opening_balance" :currency="$account->currency_code" convert />
</span>
</div>
</div>
@stack('account_balance_card_end')
</div>
@stack('account_starting_balance_end')
<div class="row">
<div class="col-md-12">
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
@stack('account_transactions_tab_start')
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 active" id="transactions-tab" data-toggle="tab" href="#transactions-content" role="tab" aria-controls="transactions-content" aria-selected="true">
{{ trans_choice('general.transactions', 2) }}
</a>
</li>
@stack('account_transactions_tab_end')
@stack('account_phone_start')
@if ($account->bank_phone)
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">
{{ trans('accounts.bank_phone') }}
</div>
@stack('account_transfers_tab_start')
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0" id="transfers-tab" data-toggle="tab" href="#transfers-content" role="tab" aria-controls="transfers-content" aria-selected="false">
{{ trans_choice('general.transfers', 2) }}
</a>
</li>
@stack('account_transfers_tab_end')
</ul>
</div>
<span>
{{ $account->bank_phone }}
</span>
</div>
@endif
@stack('account_phone_end')
<div class="card">
<div class="tab-content" id="account-tab-content">
@stack('account_transactions_content_start')
<div class="tab-pane fade show active" id="transactions-content" role="tabpanel" aria-labelledby="transactions-tab">
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-transactions">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-3">{{ trans_choice('general.date', 1) }}</th>
<th class="col-sm-3">{{ trans('general.amount') }}</th>
<th class="col-sm-3">{{ trans_choice('general.types', 1) }}</th>
<th class="col-sm-3">{{ trans_choice('general.categories', 1) }}</th>
</tr>
</thead>
@stack('account_address_start')
@if ($account->bank_address)
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">
{{ trans('accounts.bank_address') }}
</div>
<tbody>
<span>
{{ $account->bank_address }}
</span>
</div>
@endif
@stack('account_address_end')
</x-show.content.left>
<x-show.content.right>
<x-tabs active="transactions">
<x-slot name="navs">
@stack('transactions_nav_start')
<x-tabs.nav
id="transactions"
name="{{ trans_choice('general.transactions', 2) }}"
active
class="relative px-8 text-sm text-black text-center pb-2 cursor-pointer transition-all border-b tabs-link"
/>
@stack('transfers_nav_start')
<x-tabs.nav
id="transfers"
name="{{ trans_choice('general.transfers', 2) }}"
class="relative px-8 text-sm text-black text-center pb-2 cursor-pointer transition-all border-b tabs-link"
/>
@stack('transfers_nav_end')
</x-slot>
<x-slot name="content">
@stack('transactions_tab_start')
<x-tabs.tab id="transactions">
@if ($transactions->count())
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="paid_at" title="{{ trans('general.date') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="number" title="{{ trans_choice('general.numbers', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-3/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="type" title="{{ trans_choice('general.types', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-2/12">
<x-sortablelink column="account.name" title="{{ trans_choice('general.accounts', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="contact.name" title="{{ trans_choice('general.contacts', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="document.document_number" title="{{ trans_choice('general.documents', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-2/12" kind="amount">
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1 tr-py">
<td class="col-sm-3"><a href="{{ route($item->route_name, $item->route_id) }}">@date($item->paid_at)</a></td>
<td class="col-sm-3">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-3">{{ $item->type_title }}</td>
<td class="col-sm-3">{{ $item->category->name }}</td>
</tr>
<x-table.tr href="{{ route('transactions.show', $item->id) }}">
<x-table.td class="w-4/12 sm:w-3/12">
<x-slot name="first" class="font-bold truncate" override="class">
<x-date date="{{ $item->paid_at }}" />
</x-slot>
<x-slot name="second">
{{ $item->number }}
</x-slot>
</x-table.td>
<x-table.td class="w-3/12 hidden sm:table-cell">
<x-slot name="first">
{{ $item->type_title }}
</x-slot>
<x-slot name="second" class="flex items-center">
<x-index.category :model="$item->category" />
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-2/12">
{{ $item->account->name }}
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ $item->contact->name }}
</x-slot>
<x-slot name="second">
@if ($item->document)
<a href="{{ route($item->route_name, $item->route_id) }}" class="font-normal truncate border-b border-black border-dashed">
{{ $item->document->document_number }}
</a>
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="relative w-4/12 sm:w-2/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</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 py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
</div>
</div>
</div>
@stack('account_transactions_content_end')
<x-pagination :items="$transactions" />
@else
<x-show.no-records type="account" :model="$account" group="banking" page="transactions" />
@endif
</x-tabs.tab>
@stack('account_transfers_content_start')
<div class="tab-pane fade" id="transfers-content" role="tabpanel" aria-labelledby="transfers-tab">
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-transfers">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-3">{{ trans('general.date') }}</th>
<th class="col-sm-3">{{ trans('general.amount') }}</th>
<th class="col-sm-3">{{ trans_choice('transfers.from_account', 1) }}</th>
<th class="col-sm-3">{{ trans_choice('transfers.to_account', 1) }}</th>
</tr>
</thead>
@stack('transfers_tab_start')
<tbody>
<x-tabs.tab id="transfers">
@if ($transfers->count())
<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-3/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="expense_transaction.paid_at" title="{{ trans('general.created_date') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="expense_transaction.reference" title="{{ trans('general.reference') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="expense_transaction.name" title="{{ trans('transfers.from_account') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="income_transaction.name" title="{{ trans('transfers.to_account') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="expense_transaction.rate" title="{{ trans('transfers.from_rate') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="income_transaction.rate" title="{{ trans('transfers.to_rate') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12" kind="amount">
<x-slot name="first">
<x-sortablelink column="expense_transaction.amount" title="{{ trans('transfers.from_amount') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="income_transaction.amount" title="{{ trans('transfers.to_amount') }}" />
</x-slot>
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($transfers as $item)
<tr class="row align-items-center border-top-1 tr-py">
<td class="col-sm-3"><a href="{{ route('transfers.show', $item->id) }}">@date($item->expense_transaction->paid_at)</a></td>
<td class="col-sm-3">@money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true)</td>
<td class="col-sm-3">{{ $item->expense_transaction->account->name }}</td>
<td class="col-sm-3">{{ $item->income_transaction->account->name }}</td>
</tr>
@php
$item->name = trans('transfers.messages.delete', [
'from' => $item->expense_transaction->account->name,
'to' => $item->income_transaction->account->name,
'amount' => money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true)
]);
@endphp
<x-table.tr href="{{ route('transfers.show', $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->expense_transaction->account->name }}" />
</x-table.td>
<x-table.td class="w-3/12 truncate hidden sm:table-cell">
<x-slot name="first" class="flex items-center font-bold" override="class">
<x-date date="{{ $item->expense_transaction->paid_at }}" />
</x-slot>
<x-slot name="second">
@if (! empty($item->reference))
{{ $item->reference }}
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12 truncate">
<x-slot name="first">
{{ $item->expense_transaction->account->name }}
</x-slot>
<x-slot name="second">
{{ $item->income_transaction->account->name }}
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12 truncate">
<x-slot name="first">
{{ $item->expense_transaction->currency_rate }}
</x-slot>
<x-slot name="second">
{{ $item->income_transaction->currency_rate }}
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12" kind="amount">
<x-slot name="first">
<x-money :amount="$item->expense_transaction->amount" :currency="$item->expense_transaction->currency_code" convert />
</x-slot>
<x-slot name="second">
<x-money :amount="$item->income_transaction->amount" :currency="$item->income_transaction->currency_code" convert />
</x-slot>
</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 py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $transfers, 'type' => 'transfers'])
</div>
</div>
</div>
@stack('account_transfers_content_end')
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
<x-pagination :items="$transfers" />
@else
<x-show.no-records type="account" :model="$account" group="banking" page="transfers" />
@endif
</x-tabs.tab>
@stack('transfers_tab_end')
</x-slot>
</x-tabs>
</x-show.content.right>
</x-show.content>
</x-show.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="banking" file="accounts" />
</x-layouts.admin>

View File

@ -1,155 +1,310 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.reconciliations', 1)]) }}
</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.reconciliations', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.reconciliations', 1)]) }}"
icon="checklist_rtl"
route="reconciliations.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'method' => 'GET',
'route' => 'reconciliations.create',
'id' => 'form-create-reconciliation',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button mb-0',
'novalidate' => true
]) !!}
<x-slot name="content">
<div class="relative mt-4">
<x-form id="form-create-reconciliation" method="get" route="reconciliations.create">
<div class=" mb-14">
<div class="grid sm:grid-cols-10 gap-x-8 gap-y-6 my-3.5 mt-3.5 lg:mt-8">
<x-form.group.date
name="started_at"
label="{{ trans('reconciliations.start_date') }}"
icon="calendar_today"
value="{{ request('started_at', Date::now()->firstOfMonth()->toDateString()) }}"
show-date-format="{{ company_date_format() }}"
date-format="Y-m-d"
autocomplete="off"
change="setDueMinDate"
form-group-class="col-span-10 lg:col-span-5 xl:col-span-2"
/>
<div class="card-body">
<div class="row align-items-center">
{{ Form::dateGroup('started_at', trans('reconciliations.start_date'), 'calendar', ['id' => 'started_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'change' => 'setDueMinDate'], request('started_at', Date::now()->firstOfMonth()->toDateString()), 'col-xl-3') }}
<x-form.group.date
name="ended_at"
label="{{ trans('reconciliations.end_date') }}"
icon="calendar_today"
value="{{ request('ended_at', Date::now()->endOfMonth()->toDateString()) }}"
show-date-format="{{ company_date_format() }}"
date-format="Y-m-d"
autocomplete="off"
min-date="form.started_at"
min-date-dynamic="min_due_date"
data-value-min
period="30"
form-group-class="col-span-10 lg:col-span-5 xl:col-span-2"
/>
{{ Form::dateGroup('ended_at', trans('reconciliations.end_date'), 'calendar', ['id' => 'ended_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'min-date' => 'form.started_at', 'min-date-dynamic' => 'min_due_date', 'data-value-min' => true, 'period' => 30], request('ended_at', Date::now()->endOfMonth()->toDateString()), 'col-xl-3') }}
<x-form.group.money
name="closing_balance"
label="{{ trans('reconciliations.closing_balance') }}"
value="{{ request('closing_balance', 0.00) }}"
input="onCalculate"
dynamicCurrency="currency"
form-group-class="col-span-10 lg:col-span-5 xl:col-span-2"
:currency="$currency"
/>
{{ Form::moneyGroup('closing_balance', trans('reconciliations.closing_balance'), 'balance-scale', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency, 'dynamic-currency' => 'currency', 'input' => 'onCalculate'], request('closing_balance', 0.00), 'col-xl-2') }}
<x-form.group.account form-group-class="col-span-10 lg:col-span-5 xl:col-span-2 account-input" />
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('default.account')), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount'], 'col-xl-2') }}
<div class="col-xl-2">
{!! Form::button(trans('reconciliations.transactions'), ['type' => 'button', '@click' => 'onReconcilition', 'class' => 'btn btn-outline-primary']) !!}
<div class="flex items-end lg:justify-end xl:justify-start col-span-10 xl:col-span-2">
<x-button
type="button"
class="w-full px-3 py-2 bg-transparent hover:bg-purple text-black hover:text-white rounded-lg border border-purple"
override="class"
@click="onReconcilition"
>
{{ trans('reconciliations.transactions') }}
</x-button>
</div>
</div>
</div>
</div>
</x-form>
{!! Form::close() !!}
</div>
<div id="reconciliations-table">
<h2 class="text-lg font-medium text-black mb-3">
{{ trans_choice('general.transactions', 2) }}
</h2>
<div id="reconciliations-table" class="card">
<div class="card-header border-0">
<h3 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
<x-form id="reconciliation" route="reconciliations.store">
<x-form.input.hidden name="account_id" :value="$account->id" />
<x-form.input.hidden name="currency_code" :value="$currency->code" />
<x-form.input.hidden name="opening_balance" value="{{ $opening_balance }}" />
<x-form.input.hidden name="closing_balance" value="{{ request('closing_balance', '0') }}" />
<x-form.input.hidden name="started_at" :value="request('started_at')" />
<x-form.input.hidden name="ended_at" :value="request('ended_at')" />
<x-form.input.hidden name="reconcile" value="0" id="hidden-reconcile" />
{!! Form::open([
'id' => 'reconciliation',
'route' => 'reconciliations.store',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'role' => 'form',
'class' => 'form-loading-button mb-0',
]) !!}
<div class="overflow-x-visible">
<div class="py-2 align-middle inline-block min-w-full">
<table class="min-w-full divide-y divide-gray-200">
<thead>
<tr class="flex items-center px-1">
<th scope="col" class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('general.date') }}
</th>
{{ Form::hidden('account_id', $account->id) }}
{{ Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) }}
{{ Form::hidden('opening_balance', $opening_balance, ['id' => 'opening_balance']) }}
{{ Form::hidden('closing_balance', request('closing_balance', '0'), ['id' => 'closing_balance']) }}
{{ Form::hidden('started_at', request('started_at')) }}
{{ Form::hidden('ended_at', request('ended_at')) }}
{{ Form::hidden('reconcile', '0', ['id' => 'hidden-reconcile']) }}
<th scope="col" class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('general.description') }}
</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-xs-4 col-sm-3 col-md-2 long-texts">{{ trans('general.date') }}</th>
<th class="col-md-2 text-center d-none d-md-block">{{ trans('general.description') }}</th>
<th class="col-md-2 col-sm-3 col-md-3 d-none d-sm-block">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right">{{ trans('reconciliations.deposit') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right long-texts">{{ trans('reconciliations.withdrawal') }}</th>
<th class="col-md-1 text-right d-none d-md-block">{{ trans('general.clear') }}</th>
</tr>
</thead>
<th scope="col" class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans_choice('general.contacts', 1) }}
</th>
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-3 col-md-2 long-texts">@date($item->paid_at)</td>
<td class="col-md-2 text-center d-none d-md-block">{{ $item->description }}</td>
<td class="col-md-2 col-sm-3 col-md-3 d-none d-sm-block">{{ $item->contact->name }}</td>
@if ($item->isIncome())
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
@else
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="col-md-1 text-right d-none d-md-block">
<div class="custom-control custom-checkbox">
@php $type = $item->isIncome() ? 'income' : 'expense'; @endphp
{{ Form::checkbox($type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [
'data-field' => 'transactions',
'v-model' => 'form.transactions.' . $type . '_' . $item->id,
'id' => 'transaction-' . $item->id . '-'. $type,
'class' => 'custom-control-input',
'@change' => 'onCalculate'
]) }}
<label class="custom-control-label" for="transaction-{{ $item->id . '-'. $type }}"></label>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
@if ($transactions->count())
<table class="table">
<tbody>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('reconciliations.opening_balance') }}:</th>
<td id="closing-balance" class="col-md-3 col-lg-1 text-right d-none d-md-block">
<span class="w-auto position-absolute right-4 text-sm">@money($opening_balance, $account->currency_code, true)</span>
</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-3 col-lg-1 text-right d-none d-md-block pt-0">
<div class="mt-1">
{{ Form::moneyGroup('closing_balance_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.closing_balance', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text w-auto position-absolute right-4 text-sm js-conversion-input'], 0.00, 'text-right disabled-money') }}
</div>
</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-3 col-lg-1 text-right d-none d-md-block pt-0">
<div class="mt-1">
{{ Form::moneyGroup('cleared_amount_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.cleared_amount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text w-auto position-absolute right-4 text-sm js-conversion-input'], 0.00, 'text-right disabled-money') }}
</div>
</td>
</tr>
<tr :class="difference" class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-3 col-lg-1 text-right d-none d-md-block pt-0">
<div class="mt-1 difference-money">
{{ Form::moneyGroup('difference_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.difference', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text w-auto position-absolute right-4 text-sm js-conversion-input'], 0.00, 'text-right disabled-money') }}
</div>
</td>
</tr>
</tbody>
</table>
@endif
</div>
<th scope="col" class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('reconciliations.deposit') }}
</th>
<div class="card-footer">
<div class="row">
<div class="col-md-12">
<th scope="col" class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('reconciliations.withdrawal') }}
</th>
<th scope="col" class="ltr:pl-6 rtl:pr-6 ltr:text-right rtl:text-left py-4 text-center text-sm font-medium">
{{ trans('general.clear') }}
</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr class="relative flex items-center border-b hover:bg-gray-100 px-1 group">
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-date date="{{ $item->paid_at }}" />
</td>
<td class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider truncate">
{{ $item->description }}
</td>
<td class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider truncate">
{{ $item->contact->name }}
</td>
@if ($item->isIncome())
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</td>
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-empty-data />
</td>
@else
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-empty-data />
</td>
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</td>
@endif
<td class="ltr:pl-6 rtl:pr-6 py-4 text-center text-sm font-medium">
@php $type = $item->isIncome() ? 'income' : 'expense'; @endphp
<x-form.input.checkbox name="{{ $type . '_' . $item->id }}"
label=""
id="transaction-{{ $item->id . '-'. $type }}"
:value="$item->amount_for_account"
:checked="$item->reconciled"
data-field="transactions"
v-model="form.transactions.{{ $type . '_' . $item->id }}"
@change="onCalculate"
/>
</td>
</tr>
@endforeach
</tbody>
</table>
@if ($transactions->count())
<table class="min-w-full divide-y divide-gray-200">
<tbody class="float-right">
<tr class="border-b">
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black">
{{ trans('reconciliations.opening_balance') }}:
</th>
<td id="closing-balance" class="w-1/12 ltr:text-right rtl:text-left">
<span class="w-auto pl-6 text-sm">
<x-money :amount="$opening_balance" :currency="$account->currency_code" convert />
</span>
</td>
</tr>
<tr class="border-b">
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black">
{{ trans('reconciliations.closing_balance') }}:
</th>
<td id="closing-balance" class="w-1/12 text-right">
<x-form.input.money
name="closing_balance_total"
value="0"
disabled
row-input
v-model="totals.closing_balance"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money banking-price-text w-auto position-absolute right-4 ltr:pr-0 rtl:pl-0 text-sm js-conversion-input"
form-group-class="text-right disabled-money"
/>
</td>
</tr>
<tr class="border-b">
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black">
{{ trans('reconciliations.cleared_amount') }}:
</th>
<td id="cleared-amount" class="w-1/12 text-right">
<x-form.input.money
name="cleared_amount_total"
value="0"
disabled
row-input
v-model="totals.cleared_amount"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money banking-price-text w-auto position-absolute right-4 ltr:pr-0 rtl:pl-0 text-sm js-conversion-input"
form-group-class="text-right disabled-money"
/>
</td>
</tr>
<tr class="border-b">
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black cursor-pointer">
<span class="px-2 py-1 rounded-xl" :class="difference">
{{ trans('general.difference') }}
</span>
</th>
<td id="difference" class="w-1/12 ltr:pl-6 rtl:pr-0 text-right">
<div class="difference-money">
<x-form.input.money
name="difference_total"
value="0"
disabled
row-input
v-model="totals.difference"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money banking-price-text w-auto position-absolute right-4 ltr:pr-0 rtl:pl-0 text-sm js-conversion-input"
form-group-class="text-right disabled-money"
/>
</div>
</td>
</tr>
</tbody>
</table>
@endif
</div>
</div>
<div class="relative__footer mt-6">
@if ($transactions->count())
<div class="float-right">
<a href="{{ route('reconciliations.index') }}" class="btn btn-outline-secondary">{{ trans('general.cancel') }}</a>
<div class="sm:col-span-6 flex items-center justify-end">
<x-link
href="{{ route('reconciliations.index') }}"
class="flex items-center justify-center bg-transparent hover:bg-gray-200 px-3 py-1.5 text-base rounded-lg disabled:opacity-50 ltr:mr-2 rtl:ml-2"
override="class"
>
{{ trans('general.cancel') }}
</x-link>
{!! Form::button(
'<span v-if="form.loading" class="btn-inner--icon"><i class="aka-loader"></i></span> <span :class="[{\'opacity-10\': reconcile}]" class="btn-inner--text">' . trans('reconciliations.reconcile') . '</span>',
[':disabled' => 'reconcile || form.loading', '@click' => 'onReconcileSubmit', 'type' => 'button', 'class' => 'btn btn-icon btn-info']) !!}
<x-button
type="submit"
::disabled="form.loading"
class="flex items-center justify-center bg-transparent hover:bg-gray-200 px-3 py-1.5 text-base rounded-lg disabled:opacity-50"
override="class"
>
<i v-if="form.loading" class="material-icons animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'ml-0': form.loading}]">{{ trans('reconciliations.save_draft') }}</span>
</x-button>
<div v-if="reconcile">
<x-tooltip id="tooltip-reconcile" placement="top" message="{{ trans('reconciliations.irreconcilable') }}">
<x-button
type="button"
::disabled="reconcile || form.loading"
class="relative flex items-center justify-center px-3 py-1.5 ltr:ml-2 rtl:mr-2 text-white text-base rounded-lg bg-blue-300 hover:bg-blue-500 disabled:bg-blue-100"
override="class"
@click="onReconcileSubmit"
data-loading-text="{{ trans('general.loading') }}"
>
<i
v-if="form.loading"
class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"
>
</i>
{!! Form::button(
'<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.save') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-icon btn-success']) !!}
<span :class="[{'opacity-1': reconcile}]">{{ trans('reconciliations.reconcile') }}</span>
</x-button>
</x-tooltip>
</div>
<div v-else>
<x-button
type="button"
::disabled="reconcile || form.loading"
class="relative flex items-center justify-center px-3 py-1.5 ltr:ml-2 rtl:mr-2 text-white text-base rounded-lg bg-blue-300 hover:bg-blue-500 disabled:bg-blue-100"
override="class"
@click="onReconcileSubmit"
data-loading-text="{{ trans('general.loading') }}"
>
<i
v-if="form.loading"
class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"
>
</i>
<span :class="[{'opacity-1': reconcile}]">{{ trans('reconciliations.reconcile') }}</span>
</x-button>
</div>
</div>
@else
<div class="text-sm text-muted" id="datatable-basic_info" role="status" aria-live="polite">
@ -157,13 +312,10 @@
</div>
@endif
</div>
</div>
</x-form>
</div>
</div>
</x-slot>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="banking" file="reconciliations" />
</x-layouts.admin>

View File

@ -1,143 +1,260 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.reconciliations', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.reconciliations', 1)]))
<x-slot name="content">
<div id="reconciliations-table" class="mt-3.5 lg:mt-8">
<x-form id="reconciliation" method="PATCH" :route="['reconciliations.update', $reconciliation->id]" :model="$reconciliation">
<div>
<h2 class="text-lg font-medium text-black mb-3">{{ trans_choice('general.transactions', 2) }}</h2>
</div>
@section('content')
<div id="reconciliations-table" class="card">
{!! Form::model($reconciliation, [
'id' => 'reconciliation',
'method' => 'PATCH',
'route' => ['reconciliations.update', $reconciliation->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'role' => 'form',
'class' => 'form-loading-button mb-0',
'novalidate' => true
]) !!}
<x-form.input.hidden name="account_id" :value="$account->id" />
<x-form.input.hidden name="currency_code" :value="$currency->code" />
<x-form.input.hidden name="opening_balance" value="{{ $opening_balance }}" />
<x-form.input.hidden name="closing_balance" value="{{ $reconciliation->closing_balance }}" />
<x-form.input.hidden name="started_at" :value="$reconciliation->started_at" />
<x-form.input.hidden name="ended_at" :value="$reconciliation->ended_at" />
<x-form.input.hidden name="reconcile" :value="$reconciliation->reconcile" id="hidden-reconcile" />
<div class="card-header border-0">
<h3 class="box-title">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
<div class="overflow-x-visible">
<div class="py-2 align-middle inline-block min-w-full">
<table class="min-w-full divide-y divide-gray-200">
<thead>
<tr class="flex items-center px-1">
<th scope="col" class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('general.date') }}
</th>
{{ Form::hidden('account_id', $account->id) }}
{{ Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) }}
{{ Form::hidden('opening_balance', $opening_balance, ['id' => 'opening_balance']) }}
{{ Form::hidden('closing_balance', $reconciliation->closing_balance, ['id' => 'closing_balance']) }}
{{ Form::hidden('started_at', $reconciliation->started_at) }}
{{ Form::hidden('ended_at', $reconciliation->ended_at) }}
{{ Form::hidden('reconcile', $reconciliation->reconcile, ['id' => 'hidden-reconcile']) }}
<th scope="col" class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('general.description') }}
</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-xs-4 col-sm-3 col-md-2 long-texts">{{ trans('general.date') }}</th>
<th class="col-md-2 text-center d-none d-md-block">{{ trans('general.description') }}</th>
<th class="col-md-2 col-sm-3 col-md-3 d-none d-sm-block">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right">{{ trans('reconciliations.deposit') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right long-texts">{{ trans('reconciliations.withdrawal') }}</th>
<th class="col-md-1 text-right d-none d-md-block">{{ trans('general.clear') }}</th>
</tr>
</thead>
<th scope="col" class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans_choice('general.contacts', 1) }}
</th>
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-3 col-md-2 long-texts">@date($item->paid_at)</td>
<td class="col-md-2 text-center d-none d-md-block">{{ $item->description }}</td>
<td class="col-md-2 col-sm-3 col-md-3 d-none d-sm-block">{{ $item->contact->name }}</td>
@if ($item->isIncome())
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
@else
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="col-md-1 text-right d-none d-md-block">
<div class="custom-control custom-checkbox">
<th scope="col" class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('reconciliations.deposit') }}
</th>
<th scope="col" class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
{{ trans('reconciliations.withdrawal') }}
</th>
<th scope="col" class="ltr:pl-6 rtl:pr-6 ltr:text-right rtl:text-left py-4 text-center text-sm font-medium">
{{ trans('general.clear') }}
</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr class="relative flex items-center border-b hover:bg-gray-100 px-1 group">
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-date date="{{ $item->paid_at }}" />
</td>
<td class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider truncate">
{{ $item->description }}
</td>
<td class="w-3/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider truncate">
{{ $item->contact->name }}
</td>
@if ($item->isIncome())
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</td>
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-empty-data />
</td>
@else
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-empty-data />
</td>
<td class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</td>
@endif
<td class="ltr:pl-6 rtl:pr-6 py-4 text-center text-sm font-medium">
@php $type = $item->isIncome() ? 'income' : 'expense'; @endphp
{{ Form::checkbox($type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [
'data-field' => 'transactions',
'v-model' => 'form.transactions.' . $type . '_' . $item->id,
'id' => 'transaction-' . $item->id . '-'. $type,
'class' => 'custom-control-input',
'@change' => 'onCalculate'
]) }}
<label class="custom-control-label" for="transaction-{{ $item->id . '-'. $type }}"></label>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
@if ($transactions->count())
<table class="table">
<tbody>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('reconciliations.opening_balance') }}:</th>
<td id="closing-balance" class="col-md-3 col-lg-1 text-right d-none d-md-block">
<span class="w-auto position-absolute right-4 text-sm">@money($opening_balance, $account->currency_code, true)</span>
</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-3 col-lg-1 text-right d-none d-md-block pt-0">
<div class="mt-1">
{{ Form::moneyGroup('closing_balance_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.closing_balance', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text w-auto position-absolute right-4 text-sm js-conversion-input'], 0.00, 'text-right disabled-money') }}
</div>
</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-3 col-lg-1 text-right d-none d-md-block pt-0">
<div class="mt-1">
{{ Form::moneyGroup('cleared_amount_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.cleared_amount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text w-auto position-absolute right-4 text-sm js-conversion-input'], 0.00, 'text-right disabled-money') }}
</div>
</td>
</tr>
<tr :class="difference" class="row">
<th class="col-md-9 col-lg-11 text-right d-none d-md-block">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-3 col-lg-1 text-right d-none d-md-block pt-0">
<div class="mt-1 difference-money">
{{ Form::moneyGroup('difference_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.difference', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text w-auto position-absolute right-4 text-sm js-conversion-input'], 0.00, 'text-right disabled-money') }}
</div>
</td>
</tr>
</tbody>
</table>
@endif
</div>
@can('update-banking-reconciliations')
<div class="card-footer">
<div class="row">
<div class="col-md-12">
@if ($transactions->count())
<div class="float-right">
<a href="{{ route('reconciliations.index') }}" class="btn btn-outline-secondary">{{ trans('general.cancel') }}</a>
<x-form.input.checkbox name="{{ $type . '_' . $item->id }}"
label=""
id="transaction-{{ $item->id . '-'. $type }}"
:value="$item->amount_for_account"
:checked="$item->reconciled"
data-field="transactions"
v-model="form.transactions.{{ $type . '_' . $item->id }}"
class="text-purple focus:outline-none focus:ring-purple focus:border-purple"
@change="onCalculate"
/>
</td>
</tr>
@endforeach
</tbody>
</table>
{!! Form::button(
'<span v-if="form.loading" class="btn-inner--icon"><i class="aka-loader"></i></span> <span :class="[{\'opacity-10\': reconcile}]" class="btn-inner--text">' . trans('reconciliations.reconcile') . '</span>',
[':disabled' => 'reconcile || form.loading', '@click' => 'onReconcileSubmit', 'type' => 'button', 'class' => 'btn btn-icon btn-info', 'data-loading-text' => trans('general.loading')]) !!}
@if ($transactions->count())
<table class="min-w-full divide-y divide-gray-200">
<tbody class="float-right">
<tr class="border-b">
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black">
{{ trans('reconciliations.opening_balance') }}:
</th>
{!! Form::button(
'<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.save') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-icon btn-success']) !!}
</div>
@else
<div class="text-sm text-muted" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
<td id="closing-balance" class="w-1/12 text-right">
<span class="w-auto pl-6 text-sm">
<x-money :amount="$opening_balance" :currency="$account->currency_code" convert />
</span>
</td>
</tr>
<tr class="border-b">
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black">
{{ trans('reconciliations.closing_balance') }}:
</th>
<td id="closing-balance" class="w-1/12 text-right">
<x-form.input.money
name="closing_balance_total"
value="0"
disabled
row-input
v-model="totals.closing_balance"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money banking-price-text w-auto position-absolute right-4 ltr:pr-0 rtl:pl-0 text-sm js-conversion-input"
form-group-class="text-right disabled-money"
/>
</td>
</tr>
<tr class="border-b">
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black">
{{ trans('reconciliations.cleared_amount') }}:
</th>
<td id="cleared-amount" class="w-1/12 text-right">
<x-form.input.money
name="cleared_amount_total"
value="0"
disabled
row-input
v-model="totals.cleared_amount"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money banking-price-text w-auto position-absolute right-4 ltr:pr-0 rtl:pl-0 text-sm js-conversion-input"
form-group-class="text-right disabled-money"
/>
</td>
</tr>
<tr>
<th class="w-11/12 ltr:pr-6 rtl:pl-6 py-4 ltr:text-left rtl:text-right whitespace-nowrap text-sm font-bold text-black cursor-pointer">
<span class="px-2 py-1 rounded-xl" :class="difference">
{{ trans('general.difference') }}
</span>
</th>
<td id="difference" class="w-1/12 ltr:pl-6 rtl:pr-0 text-right">
<div class="difference-money">
<x-form.input.money
name="difference_total"
value="0"
disabled
row-input
v-model="totals.difference"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money banking-price-text w-auto position-absolute right-4 ltr:pr-0 rtl:pl-0 text-sm js-conversion-input"
form-group-class="text-right disabled-money"
/>
</div>
</td>
</tr>
</tbody>
</table>
@endif
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
@can('update-banking-reconciliations')
<div class="relative__footer mt-6">
@if ($transactions->count())
<div class="sm:col-span-6 flex items-center justify-end">
<x-link
href="{{ route('reconciliations.index') }}"
class="flex items-center justify-center bg-transparent hover:bg-gray-200 py-1.5 text-base rounded-lg disabled:opacity-50 px-3 ltr:mr-2 rtl:ml-2"
override="class"
>
{{ trans('general.cancel') }}
</x-link>
@push('scripts_start')
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
@endpush
<x-button
type="submit"
::disabled="form.loading"
class="relative flex items-center justify-center bg-transparent hover:bg-gray-200 px-3 py-1.5 text-base rounded-lg disabled:opacity-50"
override="class"
>
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'ml-0': form.loading}]">{{ trans('general.save') }}</span>
</x-button>
<div v-if="reconcile">
<x-tooltip id="tooltip-reconcile" placement="top" message="{{ trans('reconciliations.irreconcilable') }}">
<x-button
type="button"
::disabled="reconcile || form.loading"
class="relative flex items-center justify-center px-3 py-1.5 ltr:ml-2 rtl:mr-2 text-white text-base rounded-lg bg-blue-300 hover:bg-blue-500 disabled:bg-blue-100"
override="class"
@click="onReconcileSubmit"
data-loading-text="{{ trans('general.loading') }}"
>
<i
v-if="form.loading"
class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"
>
</i>
<span :class="[{'opacity-1': reconcile}]">{{ trans('reconciliations.reconcile') }}</span>
</x-button>
</x-tooltip>
</div>
<div v-else>
<x-button
type="button"
::disabled="reconcile || form.loading"
class="relative flex items-center justify-center px-3 py-1.5 ltr:ml-2 rtl:mr-2 text-white text-base rounded-lg bg-blue-300 hover:bg-blue-500 disabled:bg-blue-100"
override="class"
@click="onReconcileSubmit"
data-loading-text="{{ trans('general.loading') }}"
>
<i
v-if="form.loading"
class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"
>
</i>
<span :class="[{'opacity-1': reconcile}]">{{ trans('reconciliations.reconcile') }}</span>
</x-button>
</div>
</div>
@else
<div class="text-sm text-muted" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
@endcan
</x-form>
</div>
</x-slot>
<x-script folder="banking" file="reconciliations" />
</x-layouts.admin>

View File

@ -1,91 +1,126 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.reconciliations', 2) }}</x-slot>
@section('title', trans_choice('general.reconciliations', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.reconciliations', 2) }}"
icon="checklist_rtl"
route="reconciliations.index"
></x-slot>
@section('new_button')
@can('create-banking-reconciliations')
<a href="{{ route('reconciliations.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endcan
@endsection
<x-slot name="buttons">
@can('create-banking-reconciliations')
<x-link href="{{ route('reconciliations.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.reconciliations', 1)]) }}
</x-link>
@endcan
</x-slot>
@section('content')
@if ($reconciliations->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' => 'reconciliations.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Banking\Reconciliation" />
</div>
<x-slot name="content">
@if ($reconciliations->count() || request()->get('search', false))
<x-index.summary>
<x-slot name="first"
href="{{ route('reconciliations.index', ['search' => 'reconciled:1']) }}"
amount="{{ money($reconciliations->where('reconciled', 1)->sum('closing_balance'), setting('default.currency'), true) }}"
title="{{ trans('reconciliations.reconciled_amount') }}"
></x-slot>
{{ Form::bulkActionRowGroup('general.reconciliations', $bulk_actions, ['group' => 'banking', 'type' => 'reconciliations']) }}
{!! Form::close() !!}
</div>
<x-slot name="second"
href="{{ route('reconciliations.index', ['search' => 'reconciled:0']) }}"
amount="{{ money($reconciliations->where('reconciled', 0)->sum('closing_balance'), setting('default.currency'), true) }}"
title="{{ trans('reconciliations.in_progress') }}"
></x-slot>
</x-index.summary>
<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-1 col-lg-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-sm-3 col-md-2 col-lg-2 d-none d-sm-block">@sortablelink('created_at', trans('general.created_date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-3 col-sm-2 col-md-2 col-lg-2">@sortablelink('account_id', trans_choice('general.accounts', 1))</th>
<th class="col-md-2 col-lg-2 d-none d-lg-block">{{ trans('general.period') }}</th>
<th class="col-md-2 col-lg-2 d-none d-md-block text-right">@sortablelink('closing_balance', trans('reconciliations.closing_balance'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-2">@sortablelink('status', trans_choice('general.statuses', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-1 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-index.container>
<x-index.search
search-string="App\Models\Banking\Reconciliation"
bulk-action="App\BulkActions\Banking\Reconciliations"
/>
<tbody>
<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-3/12 hidden sm:table-cell">
<x-sortablelink column="created_at" title="{{ trans('general.created_date') }}" />
</x-table.th>
<x-table.th class="w-6/12 sm:w-3/12">
<x-sortablelink column="account_id" title="{{ trans_choice('general.accounts', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
{{ trans('general.period') }}
</x-table.th>
<x-table.th class="w-6/12 sm:w-4/12" kind="amount">
<x-slot name="first">
<x-sortablelink column="opening_balance" title="{{ trans('reconciliations.opening_balance') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="closing_balance" title="{{ trans('reconciliations.closing_balance') }}" />
</x-slot>
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($reconciliations as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->account->name) }}</td>
<td class="col-sm-3 col-md-2 col-lg-2 d-none d-sm-block"><a class="col-aka" href="{{ route('reconciliations.edit', $item->id) }}">@date($item->created_at)</a></td>
<td class="col-xs-3 col-sm-2 col-md-2 col-lg-2 long-texts">{{ $item->account->name }}</td>
<td class="col-md-2 col-lg-2 d-none d-lg-block border-0">@date($item->started_at) - @date($item->ended_at)</td>
<td class="col-md-2 col-lg-2 d-none d-md-block text-right">@money($item->closing_balance, $item->account->currency_code, true)</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-2">
@if ($item->reconciled)
<span class="badge badge-pill badge-success">{{ trans('reconciliations.reconciled') }}</span>
@else
<span class="badge badge-pill badge-danger">{{ trans('reconciliations.unreconciled') }}</span>
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-1 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('reconciliations.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-banking-reconciliations')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'reconciliations.destroy') !!}
@endcan
<x-table.tr href="{{ route('reconciliations.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->account->name }}" />
</x-table.td>
<x-table.td class="w-3/12 hidden sm:table-cell">
<x-slot name="first" class="flex" override="class">
<div class="font-bold truncate">
<x-date date="{{ $item->created_at }}" />
</div>
</div>
</td>
</tr>
@if (! $item->reconciled)
<x-index.disable text="{{ trans('reconciliations.in_progress') }}" />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-6/12 sm:w-3/12 truncate">
{{ $item->account->name }}
</x-table.td>
<x-table.td class="w-3/12 hidden sm:table-cell">
<x-slot name="first">
<x-date date="{{ $item->started_at }}" />
</x-slot>
<x-slot name="second">
<x-date date="{{ $item->ended_at }}" />
</x-slot>
</x-table.td>
<x-table.td class="w-6/12 sm:w-3/12" kind="amount">
@if ($item->closing_balance)
<x-money :amount="$item->closing_balance" :currency="$item->account->currency_code" convert />
@else
<x-empty-data />
@endif
</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' => $reconciliations])
</div>
</div>
</div>
@else
<x-empty-page group="banking" page="reconciliations" />
@endif
@endsection
<x-pagination :items="$reconciliations" />
</x-index.container>
@else
<x-empty-page group="banking" page="reconciliations" />
@endif
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="banking" file="reconciliations" />
</x-layouts.admin>

View File

@ -0,0 +1,110 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.recurring_' . Str::plural($real_type), 1)]) }}
</x-slot>
@php $fav_icon = ($real_type == 'income') ? 'request_quote' : 'paid'; @endphp
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.recurring_' . Str::plural($real_type), 1)]) }}"
icon="{{ $fav_icon }}"
url="{{ route('recurring-transactions.create', ['type' => $type]) }}"
></x-slot>
<x-slot name="content">
<x-form.container>
<x-form id="transaction" route="recurring-transactions.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transactions.form_description.general') }}" />
</x-slot>
<x-slot name="body">
<div class="form-group form-group relative sm:col-span-3">
<label class="form-control-label">
{{ trans('general.date') }}
</label>
<x-tooltip id="tooltip-paid" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_date', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
<div class="relative focused has-label">
<x-form.input.text name="disabled_transaction_paid" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
</div>
</x-tooltip>
<x-form.input.hidden name="paid_at" :value="Date::now()" />
</div>
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" value="0" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" />
<x-form.group.account />
<x-form.group.payment-method />
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
<x-form.input.hidden name="currency_code" :value="$account_currency_code" />
<x-form.input.hidden name="currency_rate" value="1" />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{{ trans('transactions.form_description.assign_' . $real_type) }}" />
</x-slot>
<x-slot name="body">
<x-form.group.category type="{{ $real_type }}" :selected="setting('default.' . $real_type . '_category')" />
<x-form.group.contact type="{{ config('type.transaction.' . $real_type . '.contact_type') }}" not-required />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.schedules', 1) }}" description="{{ trans('recurring.form_description.schedule', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}" />
</x-slot>
<x-slot name="body">
<x-form.group.recurring type="transaction" />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transactions.form_description.other') }}" />
</x-slot>
<x-slot name="body">
<div class="form-group form-group relative sm:col-span-3">
<label class="form-control-label">
{{ trans_choice('general.numbers', 1) }}
</label>
<x-tooltip id="tooltip-number" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_number', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
<div class="relative focused has-label">
<x-form.input.text name="disabled_transaction_number" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
</div>
</x-tooltip>
<x-form.input.hidden name="number" value="{{ $number }}" />
</div>
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
<x-form.group.attachment />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="recurring-transactions.index" />
</x-slot>
</x-form.section>
<x-form.input.hidden name="type" :value="$type" />
<x-form.input.hidden name="real_type" :value="$real_type" />
</x-form>
</x-form.container>
</x-slot>
<x-script folder="banking" file="transactions" />
</x-layouts.admin>

View File

@ -0,0 +1,113 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.recurring_' . Str::plural($real_type), 1)]) }}
</x-slot>
<x-slot name="content">
<x-form.container>
<x-form id="transaction" method="PATCH" :route="['recurring-transactions.update', $recurring_transaction->id]" :model="$recurring_transaction">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transactions.form_description.general') }}" />
</x-slot>
<x-slot name="body">
<div class="form-group form-group relative sm:col-span-3">
<label class="form-control-label">
{{ trans('general.date') }}
</label>
<x-tooltip id="tooltip-paid" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_date', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
<div class="relative focused has-label">
<x-form.input.text name="disabled_transaction_paid" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
</div>
</x-tooltip>
<x-form.input.hidden name="paid_at" :value="$recurring_transaction->paid_at" />
</div>
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" :value="$recurring_transaction->amount" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" />
<x-form.group.account />
<x-form.group.payment-method />
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
<x-form.input.hidden name="currency_code" :value="$recurring_transaction->currency_code" />
<x-form.input.hidden name="currency_rate" />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{{ trans('transactions.form_description.assign_' . $real_type) }}" />
</x-slot>
<x-slot name="body">
<x-form.group.category type="{{ $real_type }}" />
<x-form.group.contact type="{{ config('type.transaction.' . $real_type . '.contact_type') }}" not-required />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('recurring.recurring') }}" description="{{ trans('recurring.form_description.schedule', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}" />
</x-slot>
<x-slot name="body">
<x-form.group.recurring
type="transaction"
:frequency="$recurring_transaction ? $recurring_transaction->recurring->frequency : null"
:custom-frequency="$recurring_transaction ? $recurring_transaction->recurring->custom_frequency : null"
:limit="$recurring_transaction ? $recurring_transaction->recurring->limit_by : null"
:started-value="$recurring_transaction ? $recurring_transaction->recurring->started_at : null"
:limit-count="$recurring_transaction ? $recurring_transaction->recurring->limit_count : null"
:limit-date-value="$recurring_transaction ? $recurring_transaction->recurring->limit_date : null"
/>
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transactions.form_description.other') }}" />
</x-slot>
<x-slot name="body">
<div class="form-group form-group relative sm:col-span-3">
<label class="form-control-label">
{{ trans_choice('general.numbers', 1) }}
</label>
<x-tooltip id="tooltip-number" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_number', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
<div class="relative focused has-label">
<x-form.input.text name="disabled_transaction_number" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
</div>
</x-tooltip>
<x-form.input.hidden name="number" value="{{ $number }}" />
</div>
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
<x-form.group.attachment />
</x-slot>
</x-form.section>
@can('update-banking-transactions')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="recurring-transactions.index" />
</x-slot>
</x-form.section>
@endcan
<x-form.input.hidden name="type" :value="$recurring_transaction->type" />
<x-form.input.hidden name="real_type" :value="$real_type" />
</x-form>
</x-form.container>
</x-slot>
<x-script folder="banking" file="transactions" />
</x-layouts.admin>

View File

@ -0,0 +1,172 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.recurring_templates', 2) }}
</x-slot>
<x-slot name="favorite"
title="{{ trans_choice('general.recurring_templates', 2) }}"
icon="receipt_long"
route="recurring-transactions.index"
></x-slot>
<x-slot name="buttons">
@can('create-banking-transactions')
<x-link href="{{ route('recurring-transactions.create', ['type' => 'income-recurring']) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.recurring_incomes', 1)]) }}
</x-link>
<x-link href="{{ route('recurring-transactions.create', ['type' => 'expense-recurring']) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.recurring_expenses', 1)]) }}
</x-link>
@endcan
</x-slot>
<x-slot name="content">
@if ($transactions->count() || request()->get('search', false))
<x-index.container>
<x-tabs active="recurring-templates">
<x-slot name="navs">
<x-tabs.nav-link id="transactions" name="{{ trans_choice('general.transactions', 2) }}" href="{{ route('transactions.index') }}" />
<x-tabs.nav id="recurring-templates" name="{{ trans_choice('general.recurring_templates', 2) }}" active />
</x-slot>
<x-slot name="content">
<x-index.search
search-string="App\Models\Banking\Transaction"
/>
<x-tabs.tab id="recurring-templates">
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="recurring.started_at" title="{{ trans('general.start_date') }}" />
</x-slot>
<x-slot name="second">
{{ trans('recurring.last_issued') }}
</x-slot>
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="type" title="{{ trans_choice('general.types', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-sortablelink column="recurring.status" title="{{ trans_choice('general.statuses', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ trans('recurring.frequency') }}
</x-slot>
<x-slot name="second">
{{ trans('recurring.duration') }}
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-2/12" kind="amount">
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($transactions as $item)
<x-table.tr href="{{ route('recurring-transactions.show', $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->contact->name }}" />
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-date date="{{ $item->recurring->started_at }}" />
</x-slot>
<x-slot name="second">
@if ($last = $item->recurring->getLastRecurring())
{{ $last->format(company_date_format()) }}
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ $item->type_title }}
</x-slot>
<x-slot name="second" class="flex items-center">
<x-index.category :model="$item->category" />
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12">
<x-index.status status="{{ $item->recurring->status }}" background-color="bg-{{ $item->recurring_status_label }}" text-color="text-text-{{ $item->recurring_status_label }}" />
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ trans('recurring.' . $item->recurring->frequency) }}
</x-slot>
<x-slot name="second">
@if ($item->recurring->limit_by == 'count')
@if ($item->recurring->limit_count == 0)
{{ trans('recurring.ends_never') }}
@else
{{ trans('recurring.ends_after', ['times' => $item->recurring->limit_count]) }}
@endif
@else
{{ trans('recurring.ends_date', ['date' => company_date($item->recurring->limit_date)]) }}
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-2/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$transactions" />
</x-tabs.tab>
</x-slot>
</x-tabs>
</x-index.container>
@else
<x-empty-page
group="banking"
page="recurring_templates"
hide-button-import
permission-create="create-banking-transactions"
:buttons="[
[
'url' => route('recurring-transactions.create', ['type' => 'income-recurring']),
'permission' => 'create-banking-transactions',
'text' => trans('general.title.new', ['type' => trans_choice('general.recurring_incomes', 1)]),
'description' => '',
'active_badge' => true,
],
[
'url' => route('recurring-transactions.create', ['type' => 'expense-recurring']),
'permission' => 'create-banking-transactions',
'text' => trans('general.title.new', ['type' => trans_choice('general.recurring_expenses', 1)]),
'description' => '',
'active_badge' => true,
],
]"
/>
@endif
</x-slot>
<x-script folder="banking" file="transactions" />
</x-layouts.admin>

View File

@ -0,0 +1,38 @@
<x-layouts.admin>
<x-slot name="title">
{{ $title }}
</x-slot>
<x-slot name="status">
<x-show.status status="{{ $recurring_transaction->recurring->status }}" background-color="bg-{{ $recurring_transaction->recurring_status_label }}" text-color="text-text-{{ $recurring_transaction->recurring_status_label }}" />
</x-slot>
<x-slot name="buttons">
<x-transactions.show.buttons type="{{ $recurring_transaction->type }}" :transaction="$recurring_transaction" />
</x-slot>
<x-slot name="moreButtons">
<x-transactions.show.more-buttons
type="{{ $recurring_transaction->type }}"
:transaction="$recurring_transaction"
hide-button-print
hide-button-pdf
hide-divider-1
hide-button-share
hide-button-email
hide-divider-2
hide-button-delete
hide-divider-4
/>
</x-slot>
<x-slot name="content">
<x-transactions.show.content type="{{ $recurring_transaction->type }}" :transaction="$recurring_transaction" hide-number />
</x-slot>
@push('stylesheet')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
@endpush
<x-transactions.script type="{{ $recurring_transaction->type }}" folder="banking" file="transactions" />
</x-layouts.admin>

View File

@ -0,0 +1,75 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.' . Str::plural($type), 1)]) }}
</x-slot>
@php $fav_icon = ($type == 'income') ? 'request_quote' : 'paid'; @endphp
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.' . Str::plural($type), 1)]) }}"
icon="{{ $fav_icon }}"
url="route('transactions.create', ['type' => $type]) }}"
></x-slot>
<x-slot name="content">
<x-form.container>
<x-form id="transaction" route="transactions.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transactions.form_description.general') }}" />
</x-slot>
<x-slot name="body">
<x-form.group.date name="paid_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ request()->get('paid_at', Date::now()->toDateString()) }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" />
<x-form.group.payment-method />
<x-form.group.account />
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" value="0" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" />
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
<x-form.input.hidden name="currency_code" :value="$account_currency_code" />
<x-form.input.hidden name="currency_rate" value="1" />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{{ trans('transactions.form_description.assign_' . $type) }}" />
</x-slot>
<x-slot name="body">
<x-form.group.category type="{{ $type }}" :selected="setting('default.' . $type . '_category')" />
<x-form.group.contact type="{{ config('type.transaction.' . $type . '.contact_type') }}" not-required />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transactions.form_description.other') }}" />
</x-slot>
<x-slot name="body">
<x-form.group.text name="number" label="{{ trans_choice('general.numbers', 1) }}" value="{{ $number }}" />
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
<x-form.group.attachment />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="transactions.index" />
</x-slot>
</x-form.section>
<x-form.input.hidden name="type" :value="$type" />
</x-form>
</x-form.container>
</x-slot>
<x-script folder="banking" file="transactions" />
</x-layouts.admin>

View File

@ -0,0 +1,99 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.' . Str::plural($type), 1)]) }}
</x-slot>
<x-slot name="content">
<x-form.container>
<x-slot name="head">
@if (($recurring = $transaction->recurring) && ($next = $recurring->getNextRecurring()))
<div class="media mb-3">
<div class="media-body">
<div class="media-comment-text">
<div class="d-flex">
<h5 class="mt-0">{{ trans('recurring.recurring') }}</h5>
</div>
<p class="text-sm lh-160 mb-0">
{{
trans('recurring.message', [
'type' => mb_strtolower(trans_choice('general.transactions', 1)),
'date' => $next->format($date_format)
])
}}
</p>
</div>
</div>
</div>
@endif
</x-slot>
<x-form id="transaction" method="PATCH" :route="['transactions.update', $transaction->id]" :model="$transaction">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transactions.form_description.general') }}" />
</x-slot>
<x-slot name="body">
<x-form.group.date name="paid_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ Date::parse($transaction->paid_at)->toDateString() }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" />
<x-form.group.payment-method />
<x-form.group.account />
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" :value="$transaction->amount" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" />
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
<x-form.input.hidden name="currency_code" :value="$transaction->currency_code" />
<x-form.input.hidden name="currency_rate" />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{{ trans('transactions.form_description.assign_' . $type) }}" />
</x-slot>
<x-slot name="body">
<x-form.group.category type="{{ $type }}" />
<x-form.group.contact type="{{ config('type.transaction.' . $type . '.contact_type') }}" not-required />
@if ($transaction->document)
<x-form.group.text name="document" label="{{ trans_choice('general.' . Str::plural(config('type.transaction.' . $type . '.document_type')), 1) }}" not-required disabled value="{{ $transaction->document->document_number }}" />
<x-form.input.hidden name="document_id" :value="$transaction->document->id" />
@endif
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transactions.form_description.other') }}" />
</x-slot>
<x-slot name="body">
<x-form.group.text name="number" label="{{ trans_choice('general.numbers', 1) }}" />
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
<x-form.group.attachment />
</x-slot>
</x-form.section>
@can('update-banking-transactions')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="transactions.index" />
</x-slot>
</x-form.section>
@endcan
<x-form.input.hidden name="type" :value="$transaction->type" />
</x-form>
</x-form.container>
</x-slot>
<x-script folder="banking" file="transactions" />
</x-layouts.admin>

View File

@ -1,77 +1,240 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.transactions', 2) }}
</x-slot>
@section('title', trans_choice('general.transactions', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.transactions', 2) }}"
icon="receipt_long"
route="transactions.index"
></x-slot>
@section('new_button')
@can('create-sales-revenues')
<a href="{{ route('revenues.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_income') }}</a>
@endcan
@can('create-purchases-payments')
<a href="{{ route('payments.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_expense') }}</a>
@endcan
<a href="{{ route('import.create', ['banking', 'transactions']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
<a href="{{ route('transactions.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
@endsection
<x-slot name="buttons">
@can('create-banking-transactions')
<x-link href="{{ route('transactions.create', ['type' => 'income']) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.incomes', 1)]) }}
</x-link>
@section('content')
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'transactions.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Banking\Transaction" />
</div>
<x-link href="{{ route('transactions.create', ['type' => 'expense']) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.expenses', 1)]) }}
</x-link>
@endcan
</x-slot>
{{ Form::bulkActionRowGroup('general.transactions', $bulk_actions, ['group' => 'banking', 'type' => 'transactions']) }}
{!! Form::close() !!}
</div>
<x-slot name="moreButtons">
<x-dropdown id="dropdown-more-actions">
<x-slot name="trigger">
<span class="material-icons">more_horiz</span>
</x-slot>
<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 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2 col-lg-1 col-xl-1 d-none d-md-block text-left">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-3 col-xl-3 d-none d-md-block">@sortablelink('description', trans('general.description'))</th>
</tr>
</thead>
@can('create-banking-transactions')
<x-dropdown.link href="{{ route('import.create', ['banking', 'transactions']) }}">
{{ trans('import.import') }}
</x-dropdown.link>
@endcan
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->contact->name) }}</td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1">
<a class="col-aka" href="{{ route($item->route_name, $item->route_id) }}">
@date($item->paid_at)
</a>
</td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-1 col-xl-1 d-none d-md-block text-left">{{ $item->type_title }}</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">{{ $item->category->name }}</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left long-texts">{{ $item->account->name }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-3 col-xl-3 d-none d-md-block long-texts">{{ $item->description }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<x-dropdown.link href="{{ route('transactions.export', request()->input()) }}">
{{ trans('general.export') }}
</x-dropdown.link>
</x-dropdown>
</x-slot>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $transactions])
</div>
</div>
</div>
@endsection
<x-slot name="content">
@if ($transactions->count() || request()->get('search', false))
<x-index.summary>
<x-slot name="first"
href="{{ route('transactions.index', ['search' => 'type:income']) }}"
amount="{{ money($totals['income'], setting('default.currency'), true) }}"
title="{{ trans_choice('general.incomes', 1) }}"
divider="remove"
></x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/banking/transactions.js?v=' . version('short')) }}"></script>
@endpush
<x-slot name="second"
href="{{ route('transactions.index', ['search' => 'type:expense']) }}"
amount="{{ money($totals['expense'], setting('default.currency'), true) }}"
title="{{ trans_choice('general.expenses', 2) }}"
divider="drag_handle"
></x-slot>
<x-slot name="third"
amount="{{ money($totals['profit'], setting('default.currency'), true) }}"
title="{{ trans_choice('general.profits', 1) }}"
></x-slot>
</x-index.summary>
<x-index.container>
<x-tabs active="transactions">
<x-slot name="navs">
<x-tabs.nav
id="transactions"
name="{{ trans_choice('general.transactions', 2) }}"
active
/>
<x-tabs.nav-link
id="recurring-templates"
name="{{ trans_choice('general.recurring_templates', 2) }}"
href="{{ route('recurring-transactions.index') }}"
/>
</x-slot>
<x-slot name="content">
<x-index.search
search-string="App\Models\Banking\Transaction"
bulk-action="App\BulkActions\Banking\Transactions"
/>
<x-tabs.tab id="transactions">
<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-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="paid_at" title="{{ trans('general.date') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="number" title="{{ trans_choice('general.numbers', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="type" title="{{ trans_choice('general.types', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-sortablelink column="account.name" title="{{ trans_choice('general.accounts', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="contact.name" title="{{ trans_choice('general.contacts', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="document.document_number" title="{{ trans_choice('general.documents', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-2/12" kind="amount">
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($transactions as $item)
<x-table.tr href="{{ route('transactions.show', $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->contact->name }}" />
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12">
<x-slot name="first" class="font-bold truncate" override="class">
<x-date date="{{ $item->paid_at }}" />
</x-slot>
<x-slot name="second">
{{ $item->number }}
</x-slot>
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ $item->type_title }}
</x-slot>
<x-slot name="second" class="flex items-center">
<x-index.category :model="$item->category" />
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12">
{{ $item->account->name }}
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ $item->contact->name }}
</x-slot>
<x-slot name="second" class="w-20 font-normal group" data-tooltip-target="tooltip-information-{{ $item->id }}" data-tooltip-placement="left" override="class">
@if ($item->document)
<a href="{{ route($item->route_name, $item->route_id) }}" class="font-normal truncate border-b border-black border-dashed">
{{ $item->document->document_number }}
</a>
<div class="w-28 absolute h-10 -ml-12 -mt-6"></div>
<x-documents.index.information :document="$item->document" />
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="relative w-4/12 sm:w-2/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$transactions" />
</x-tabs.tab>
</x-slot>
</x-tabs>
</x-index.container>
<akaunting-connect-transactions
:show="connect.show"
:transaction="connect.transaction"
:currency="connect.currency"
:documents="connect.documents"
:translations="{{ json_encode($translations) }}"
modal-dialog-class="max-w-screen-lg"
v-on:close-modal="connect.show = false"
></akaunting-connect-transactions>
@else
<x-empty-page
group="banking"
page="transactions"
hide-button-import
:buttons="[
[
'url' => route('transactions.create', ['type' => 'income']),
'permission' => 'create-banking-transactions',
'text' => trans('general.title.new', ['type' => trans_choice('general.incomes', 1)]),
'description' => trans('general.empty.actions.new', ['type' => trans_choice('general.incomes', 1)]),
'active_badge' => false
],
[
'url' => route('transactions.create', ['type' => 'expense']),
'permission' => 'create-banking-transactions',
'text' => trans('general.title.new', ['type' => trans_choice('general.expenses', 1)]),
'description' => trans('general.empty.actions.new', ['type' => trans_choice('general.expenses', 1)]),
'active_badge' => false
],
[
'url' => 'https://akaunting.com/premium-cloud',
'permission' => 'create-banking-transactions',
'text' => trans('import.title', ['type' => trans_choice('general.bank_transactions', 2)]),
'description' => '',
'active_badge' => false
]
]"
/>
@endif
</x-slot>
<x-script folder="banking" file="transactions" />
</x-layouts.admin>

View File

@ -0,0 +1,9 @@
<x-layouts.print>
<x-slot name="title">
{{ trans_choice('general.transactions', 1) . ': ' . $transaction->id }}
</x-slot>
<x-slot name="content">
<x-transactions.template.ddefault type="{{ $transaction->type }}" :transaction="$transaction" />
</x-slot>
</x-layout-print>

View File

@ -0,0 +1,23 @@
<x-layouts.admin>
<x-slot name="title">
{{ $title }}
</x-slot>
<x-slot name="buttons">
<x-transactions.show.buttons type="{{ $transaction->type }}" :transaction="$transaction" />
</x-slot>
<x-slot name="moreButtons">
<x-transactions.show.more-buttons type="{{ $transaction->type }}" :transaction="$transaction" hide-divider-3 hide-button-end />
</x-slot>
<x-slot name="content">
<x-transactions.show.content type="{{ $transaction->type }}" :transaction="$transaction" hide-schedule hide-children />
</x-slot>
@push('stylesheet')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
@endpush
<x-transactions.script type="{{ $transaction->type }}" />
</x-layouts.admin>

View File

@ -1,65 +1,72 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.transfers', 1)]) }}
</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.transfers', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.transfers', 1)]) }}"
icon="sync_alt"
route="transfers.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'transfers.store',
'id' => 'transfer',
'@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="transfer" route="transfers.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transfers.form_description.general') }}" />
</x-slot>
<div class="card-body">
<div class="row">
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts, null, ['required' => 'required', 'change' => 'onChangeFromAccount']) }}
<x-slot name="body">
<x-form.group.select name="from_account_id" label="{{ trans('transfers.from_account') }}" :options="$accounts" change="onChangeFromAccount" />
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts, null, ['required' => 'required', 'change' => 'onChangeToAccount']) }}
<x-form.group.select name="to_account_id" label="{{ trans('transfers.to_account') }}" :options="$accounts" change="onChangeToAccount" />
<div class="d-none w-100" :class="[{'d-flex' : show_rate}]">
{!! Form::hidden('from_currency_code', null, ['id' => 'from_currency_code', 'v-model' => 'form.from_currency_code']) !!}
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" v-model="form.from_currency_code" />
{{ Form::textGroup('from_account_rate', trans('transfers.from_account_rate'), 'sliders-h', [':disabled' => "form.from_currency_code == '" . setting('default.currency') . "'"]) }}
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ setting('default.currency') }}'" />
</div>
{!! Form::hidden('to_currency_code', null, ['id' => 'to_currency_code', 'v-model' => 'form.to_currency_code']) !!}
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" v-model="form.to_currency_code" />
{{ Form::textGroup('to_account_rate', trans('transfers.to_account_rate'), 'sliders-h', [':disabled' => "form.to_currency_code == '" . setting('default.currency') . "'"]) }}
</div>
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ setting('default.currency') }}'" />
</div>
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0) }}
<x-form.group.date name="transferred_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ Date::now()->toDateString() }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" />
{{ Form::dateGroup('transferred_at', trans('general.date'), 'calendar', ['id' => 'transferred_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" value="0" :currency="$currency" dynamicCurrency="currency" />
{{ Form::textareaGroup('description', trans('general.description')) }}
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
</x-slot>
</x-form.section>
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method')) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transfers.form_description.other') }}" />
</x-slot>
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
<x-slot name="body">
<x-form.group.payment-method />
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], null , 'col-md-12') }}
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
{!! Form::hidden('currency_code', null, ['id' => 'currency_code', 'v-model' => 'form.currency_code']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate', 'v-model' => 'form.currency_rate']) !!}
</div>
</div>
<x-form.group.attachment />
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('transfers.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
<x-form.input.hidden name="currency_code" v-model="form.currency_code" />
<x-form.input.hidden name="currency_rate" v-model="form.currency_rate" />
</x-slot>
</x-form.section>
@push('scripts_start')
<script type="text/javascript">
</script>
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="transfers.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="banking" file="transfers" />
</x-layouts.admin>

View File

@ -1,81 +1,88 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.transfers', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.transfers', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="transfer" method="PATCH" :route="['transfers.update', $transfer->id]" :model="$transfer">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transfers.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($transfer, [
'id' => 'transfer',
'method' => 'PATCH',
'route' => ['transfers.update', $transfer->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.select name="from_account_id" label="{{ trans('transfers.from_account') }}" :options="$accounts" change="onChangeFromAccount" />
<div class="card-body">
<div class="row">
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts, $transfer->from_account_id, ['required' => 'required', 'change' => 'onChangeFromAccount']) }}
<x-form.group.select name="to_account_id" label="{{ trans('transfers.to_account') }}" :options="$accounts" change="onChangeToAccount" />
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts, $transfer->to_account_id, ['required' => 'required', 'change' => 'onChangeToAccount']) }}
@if ($transfer->from_currency_code != $transfer->to_currency_code)
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" :value="$transfer->from_currency_code" v-model="form.from_currency_code" />
@if ($transfer->from_currency_code != $transfer->to_currency_code)
<div class="w-100" :class="[show_rate ? 'd-flex' : 'd-none']">
{!! Form::hidden('from_currency_code', $transfer->from_currency_code, ['id' => 'from_currency_code', 'v-model' => 'form.from_currency_code']) !!}
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ setting('default.currency') }}'" />
</div>
{{ Form::textGroup('from_account_rate', trans('transfers.from_account_rate'), 'sliders-h', [':disabled' => "form.from_currency_code == '" . setting('default.currency') . "'"], $transfer->from_account_rate) }}
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" :value="$transfer->to_currency_code" v-model="form.to_currency_code" />
{!! Form::hidden('to_currency_code', $transfer->to_currency_code, ['id' => 'to_currency_code', 'v-model' => 'form.to_currency_code']) !!}
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ setting('default.currency') }}'" />
</div>
@else
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" :value="$transfer->from_currency_code" v-model="form.from_currency_code" />
{{ Form::textGroup('to_account_rate', trans('transfers.to_account_rate'), 'sliders-h', [':disabled' => "form.to_currency_code == '" . setting('default.currency') . "'"], $transfer->to_account_rate) }}
</div>
@else
<div class="d-none w-100" :class="[{'d-flex' : show_rate}]">
{!! Form::hidden('from_currency_code', $transfer->from_currency_code, ['id' => 'from_currency_code', 'v-model' => 'form.from_currency_code']) !!}
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ setting('default.currency') }}'" />
</div>
{{ Form::textGroup('from_account_rate', trans('transfers.from_account_rate'), 'sliders-h', [':disabled' => "form.from_currency_code == '" . setting('default.currency') . "'"], $transfer->from_account_rate) }}
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" :value="$transfer->to_currency_code" v-model="form.to_currency_code" />
{!! Form::hidden('to_currency_code', $transfer->to_currency_code, ['id' => 'to_currency_code', 'v-model' => 'form.to_currency_code']) !!}
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ setting('default.currency') }}'" />
</div>
@endif
{{ Form::textGroup('to_account_rate', trans('transfers.to_account_rate'), 'sliders-h', [':disabled' => "form.to_currency_code == '" . setting('default.currency') . "'"], $transfer->to_account_rate) }}
</div>
@endif
<x-form.group.date name="transferred_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ Date::parse($transfer->transferred_at)->toDateString() }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" />
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency, 'dynamic-currency' => 'currency'], $transfer->amount) }}
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" :value="$transfer->amount" :currency="$currency" dynamicCurrency="currency" />
{{ Form::dateGroup('transferred_at', trans('general.date'), 'calendar', ['id' => 'transferred_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($transfer->transferred_at)->toDateString()) }}
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
</x-slot>
</x-form.section>
{{ Form::textareaGroup('description', trans('general.description')) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transfers.form_description.other') }}" />
</x-slot>
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $transfer->payment_method) }}
<x-slot name="body">
<x-form.group.payment-method />
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], !empty($transfer) ? $transfer->attachment : null , 'col-md-12') }}
<x-form.group.attachment />
{!! Form::hidden('currency_code', $currency->code, ['id' => 'currency_code', 'v-model' => 'form.currency_code']) !!}
{!! Form::hidden('currency_rate', $currency->rate, ['id' => 'currency_rate', 'v-model' => 'form.currency_rate']) !!}
</div>
</div>
<x-form.input.hidden name="currency_code" :value="$currency->code" v-model="form.currency_code" />
<x-form.input.hidden name="currency_rate" :value="$currency->rate" v-model="form.currency_rate" />
</x-slot>
</x-form.section>
@can('update-banking-transfers')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('transfers.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
@can('update-banking-transfers')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="transfers.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
@push('scripts_start')
<script type="text/javascript">
var transfer_edit = {{ $transfer->id }};
</script>
@push('scripts_start')
<script type="text/javascript">
var transfer_edit = {{ $transfer->id }};
</script>
@endpush
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="banking" file="transfers" />
</x-layouts.admin>

View File

@ -1,96 +1,162 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.transfers', 2) }}
</x-slot>
@section('title', trans_choice('general.transfers', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.transfers', 2) }}"
icon="sync_alt"
route="transfers.index"
></x-slot>
@section('new_button')
@can('create-banking-transfers')
<a href="{{ route('transfers.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endcan
<a href="{{ route('import.create', ['banking', 'transfers']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
<a href="{{ route('transfers.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
@endsection
<x-slot name="buttons">
@can('create-banking-transfers')
<x-link href="{{ route('transfers.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.transfers', 1)]) }}
</x-link>
@endcan
</x-slot>
@section('content')
@if ($transfers->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' => 'transfers.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Banking\Transfer" />
</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.transfers', $bulk_actions, ['group' => 'banking', 'type' => 'transfers']) }}
{!! Form::close() !!}
</div>
@can('create-banking-transfers')
<x-dropdown.link href="{{ route('import.create', ['banking', 'transfers']) }}">
{{ 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-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-md-2 d-none d-md-block">@sortablelink('expense_transaction.paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-sm-2 col-md-3 d-none d-sm-block">@sortablelink('expense_transaction.name', trans('transfers.from_account'))</th>
<th class="col-xs-4 col-sm-4 col-md-2">@sortablelink('income_transaction.name', trans('transfers.to_account'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-right">@sortablelink('expense_transaction.amount', trans('general.amount'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-dropdown.link href="{{ route('transfers.export', request()->input()) }}">
{{ trans('general.export') }}
</x-dropdown.link>
</x-dropdown>
</x-slot>
<tbody>
<x-slot name="content">
@if ($transfers->count() || request()->get('search', false))
<x-index.container>
<x-index.search
search-string="App\Models\Banking\Transfer"
bulk-action="App\BulkActions\Banking\Transfers"
/>
<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-3/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="expense_transaction.paid_at" title="{{ trans('general.created_date') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="expense_transaction.reference" title="{{ trans('general.reference') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="expense_transaction.name" title="{{ trans('transfers.from_account') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="income_transaction.name" title="{{ trans('transfers.to_account') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="expense_transaction.rate" title="{{ trans('transfers.from_rate') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="income_transaction.rate" title="{{ trans('transfers.to_rate') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12" kind="amount">
<x-slot name="first">
<x-sortablelink column="expense_transaction.amount" title="{{ trans('transfers.from_amount') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="income_transaction.amount" title="{{ trans('transfers.to_amount') }}" />
</x-slot>
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($transfers as $item)
@php
$item->name = trans('transfers.messages.delete', [
'from' => $item->expense_transaction->account->name,
'to' => $item->income_transaction->account->name,
'amount' => money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true)
]);
$item->name = trans('transfers.messages.delete', [
'from' => $item->expense_transaction->account->name,
'to' => $item->income_transaction->account->name,
'amount' => money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true)
]);
@endphp
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->expense_transaction->account->name) }}</td>
<td class="col-md-2 d-none d-md-block"><a class="col-aka" href="{{ route('transfers.show', $item->id) }}">@date($item->expense_transaction->paid_at)</a></td>
<td class="col-sm-2 col-md-3 d-none d-sm-block long-texts">{{ $item->expense_transaction->account->name }}</td>
<td class="col-xs-4 col-sm-4 col-md-2 long-texts">{{ $item->income_transaction->account->name }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-right long-texts">@money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true)</td>
<td class="col-xs-4 col-sm-2 col-md-2 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('transfers.show', $item->id) }}">{{ trans('general.show') }}</a>
@can('update-banking-transfers')
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('transfers.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@endcan
@can('delete-banking-transfers')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'transfers.destroy') !!}
@endcan
</div>
</div>
</td>
</tr>
<x-table.tr href="{{ route('transfers.show', $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->expense_transaction->account->name }}" />
</x-table.td>
<x-table.td class="w-3/12 truncate hidden sm:table-cell">
<x-slot name="first" class="flex items-center font-bold" override="class">
<x-date date="{{ $item->expense_transaction->paid_at }}" />
</x-slot>
<x-slot name="second">
@if (! empty($item->reference))
{{ $item->reference }}
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12 truncate">
<x-slot name="first">
{{ $item->expense_transaction->account->name }}
</x-slot>
<x-slot name="second">
{{ $item->income_transaction->account->name }}
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12 truncate">
<x-slot name="first">
{{ $item->expense_transaction->currency_rate }}
</x-slot>
<x-slot name="second">
{{ $item->income_transaction->currency_rate }}
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12" kind="amount">
<x-slot name="first">
<x-money :amount="$item->expense_transaction->amount" :currency="$item->expense_transaction->currency_code" convert />
</x-slot>
<x-slot name="second">
<x-money :amount="$item->income_transaction->amount" :currency="$item->income_transaction->currency_code" convert />
</x-slot>
</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' => $transfers])
</div>
</div>
</div>
@else
<x-empty-page group="banking" page="transfers" />
@endif
@endsection
<x-pagination :items="$transfers" />
</x-index.container>
@else
<x-empty-page group="banking" page="transfers" />
@endif
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="banking" file="transfers" />
</x-layouts.admin>

View File

@ -1,9 +1,9 @@
@extends('layouts.print')
<x-layouts.print>
<x-slot name="title">
{{ trans_choice('general.transfers', 1) }}
</x-slot>
@section('title', trans_choice('general.transfers', 1))
@section('content')
<x-transfers.template.ddefault
:transfer="$transfer"
/>
@endsection
<x-slot name="content">
<x-transfers.template.default :model="$transfer" />
</x-slot>
</x-layouts.print>

View File

@ -1,9 +1,9 @@
@extends('layouts.print')
<x-layouts.print>
<x-slot name="title">
{{ trans_choice('general.transfers', 1) }}
</x-slot>
@section('title', trans_choice('general.transfers', 1))
@section('content')
<x-transfers.template.second
:transfer="$transfer"
/>
@endsection
<x-slot name="content">
<x-transfers.template.second :model="$transfer" />
</x-slot>
</x-layouts.print>

View File

@ -1,9 +1,9 @@
@extends('layouts.print')
<x-layouts.print>
<x-slot name="title">
{{ trans_choice('general.transfers', 1) }}
</x-slot>
@section('title', trans_choice('general.transfers', 1))
@section('content')
<x-transfers.template.third
:transfer="$transfer"
/>
@endsection
<x-slot name="content">
<x-transfers.template.third :model="$transfer" />
</x-slot>
</x-layouts.print>

View File

@ -1,44 +1,57 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.transfers', 1) }}
</x-slot>
@section('title', trans_choice('general.transfers', 1))
<x-slot name="favorite"
title="{{ trans_choice('general.transfers', 2) }}"
icon="sync_alt"
:route="['transfers.show', $transfer->id]"
></x-slot>
@section('new_button')
<x-transfers.show.top-buttons :transfer="$transfer" />
@endsection
<x-slot name="buttons">
<x-transfers.show.buttons :model="$transfer" />
</x-slot>
@section('content')
<x-transfers.show.content :transfer="$transfer" />
@endsection
<x-slot name="moreButtons">
<x-transfers.show.more-buttons :model="$transfer" />
</x-slot>
@push('content_content_end')
<akaunting-modal
:show="template.modal"
@cancel="template.modal = false"
:title="'{{ trans('settings.transfer.choose_template') }}'"
:message="template.html"
:button_cancel="'{{ trans('general.button.save') }}'"
:button_delete="'{{ trans('general.button.cancel') }}'">
<template #modal-body>
@include('modals.settings.transfer_template')
</template>
<x-slot name="content">
<x-transfers.show.content :model="$transfer" />
</x-slot>
<template #card-footer>
<div class="float-right">
<button type="button" class="btn btn-outline-secondary" @click="closeTemplate">
{{ trans('general.cancel') }}
</button>
@push('content_content_end')
<akaunting-modal
modal-dialog-class="max-w-screen-2xl"
:show="template.modal"
@cancel="template.modal = false"
:title="'{{ trans('settings.transfer.choose_template') }}'"
:message="template.html"
:button_cancel="'{{ trans('general.button.save') }}'"
:button_delete="'{{ trans('general.button.cancel') }}'">
<template #modal-body>
@include('modals.settings.transfer_template')
</template>
<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
<template #card-footer>
<div class="flex items-center justify-end">
<button type="button" class="px-6 py-1.5 hover:bg-gray-200 rounded-lg ltr:mr-2 rtl:ml-2" @click="closeTemplate">
{{ trans('general.cancel') }}
</button>
@push('scripts_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<button :disabled="form.loading" type="button" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="addTemplate">
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': form.loading}]">{{ trans('general.confirm') }}</span>
</button>
</div>
</template>
</akaunting-modal>
@endpush
<x-transfers.script />
@endpush
@push('stylesheet')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
@endpush
<x-script folder="banking" file="transfers" />
</x-layouts.admin>

View File

@ -1,59 +1,69 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.companies', 1)]) }}</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.companies', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="company" route="companies.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('companies.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::open([
'id' => 'company',
'route' => 'companies.store',
'@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-3">
<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.email name="email" label="{{ trans('general.email') }}" />
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
<x-form.group.text name="phone" label="{{ trans('settings.company.phone') }}" value="{{ setting('company.phone') }}" not-required />
</div>
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies) }}
<div class="sm:col-span-3">
<x-form.group.file name="logo" label="{{ trans('companies.logo') }}" not-required />
</div>
</x-slot>
</x-form.section>
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('default.locale', config('app.locale', 'en-GB')), []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('companies.form_description.billing') }}" />
</x-slot>
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', [], setting('company.tax_number')) }}
<x-slot name="body">
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" not-required />
{{ Form::textGroup('phone', trans('settings.company.phone'), 'phone', [], setting('company.phone')) }}
<x-form.group.currency name="currency" />
{{ Form::textareaGroup('address', trans('general.address'), '', '', ['rows' => '2', 'v-model' => 'form.address']) }}
<x-form.group.locale not-required />
</x-slot>
</x-form.section>
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', [], setting('company.city')) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.address') }}" description="{{ trans('companies.form_description.address') }}" />
</x-slot>
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', [], setting('company.zip_code')) }}
<x-slot name="body">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" v-model="form.address" />
{{ Form::textGroup('state', trans('general.state'), 'city', [], setting('company.state')) }}
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ setting('company.city') }}" not-required />
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), setting('company.country'), ['model' => 'form.country']) }}
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" value="{{ setting('company.zip_code') }}" not-required />
{{ Form::fileGroup('logo', trans('companies.logo'), '', ['dropzone-class' => 'form-file']) }}
<x-form.group.text name="state" label="{{ trans('general.state') }}" value="{{ setting('company.state') }}" not-required />
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
</div>
</div>
<x-form.group.country />
</x-slot>
</x-form.section>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('companies.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="companies.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="companies" />
</x-layouts.admin>

View File

@ -1,62 +1,73 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.companies', 1)]) }}</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.companies', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="company" method="PATCH" :route="['companies.update', $company->id]" :model="$company">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('companies.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($company, [
'id' => 'company',
'method' => 'PATCH',
'route' => ['companies.update', $company->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">
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 grid-rows-3">
<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.email name="email" label="{{ trans('general.email') }}" />
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
<x-form.group.text name="phone" label="{{ trans('settings.company.phone') }}" not-required />
</div>
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $company->currency ?? 'USD') }}
<div class="sm:col-span-3">
<x-form.group.file name="logo" label="{{ trans('companies.logo') }}" :value="$company->company_logo" not-required />
</div>
</x-slot>
</x-form.section>
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), $company->locale ?? config('app.locale', 'en-GB'), []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('companies.form_description.billing') }}" />
</x-slot>
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', [], $company->tax_number) }}
<x-slot name="body">
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" not-required />
{{ Form::textGroup('phone', trans('settings.company.phone'), 'phone', [], $company->phone) }}
<x-form.group.currency name="currency" selected="{{ ! empty($company->currency) ? $company->currency : config('setting.fallback.default.currency') }}" />
{{ Form::textareaGroup('address', trans('general.address'), '', $company->address, ['rows' => '2', 'v-model' => 'form.address']) }}
<x-form.group.locale not-required />
</x-slot>
</x-form.section>
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', []) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.address') }}" description="{{ trans('companies.form_description.address') }}" />
</x-slot>
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', []) }}
<x-slot name="body">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" not-required v-model="form.address" />
{{ Form::textGroup('state', trans('general.state'), 'city', []) }}
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" not-required />
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), $company->country, ['model' => 'form.country']) }}
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" not-required />
{{ Form::fileGroup('logo', trans('companies.logo'), '', ['dropzone-class' => 'form-file'], $company->company_logo) }}
<x-form.group.text name="state" label="{{ trans('general.state') }}" not-required />
{{ Form::radioGroup('enabled', trans('general.enabled'), $company->enabled) }}
</div>
</div>
<x-form.group.country />
</x-slot>
</x-form.section>
@can('update-common-companies')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('companies.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
@push('scripts_start')
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
@endpush
@can('update-common-companies')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="companies.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
<x-script folder="common" file="companies" />
</x-layouts.admin>

View File

@ -1,101 +1,148 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.companies', 2) }}
</x-slot>
@section('title', trans_choice('general.companies', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.companies', 2) }}"
icon="business"
route="companies.index"
></x-slot>
@can('create-common-companies')
@section('new_button')
<a href="{{ route('companies.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endsection
@endcan
<x-slot name="buttons">
@can('create-common-companies')
<x-link href="{{ route('companies.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.companies', 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' => 'companies.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Common\Company" />
</div>
<x-slot name="content">
<x-index.container>
<x-index.search
search-string="App\Models\Common\Company"
bulk-action="App\BulkActions\Common\Companies"
/>
{{ Form::bulkActionRowGroup('general.companies', $bulk_actions, ['group' => 'common', 'type' => 'companies']) }}
{!! 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 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">@sortablelink('id', trans('general.id'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-3 col-xl-3 long-texts">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block long-texts">@sortablelink('email', trans('general.email'))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('created_at', trans('general.created'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-table.th class="w-2/12 sm:w-1/12">
<x-sortablelink column="id" title="{{ trans('general.id') }}" />
</x-table.th>
<tbody>
<x-table.th class="w-8/12 sm:w-4/12">
<x-slot name="first" class="flex items-center">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="tax_number" title="{{ trans('general.tax_number') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="email" title="{{ trans('general.email') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="phone" title="{{ trans('general.phone') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-3/12" kind="right">
<x-slot name="first">
<x-sortablelink column="country" title="{{ trans_choice('general.countries', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="currency" title="{{ trans_choice('general.currencies', 1) }}" />
</x-slot>
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($companies as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">
<x-table.tr href="{{ route('companies.edit', $item->id) }}">
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
@if ((company_id() != $item->id))
{{ Form::bulkActionGroup($item->id, $item->name) }}
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
@else
{{ Form::bulkActionGroup($item->id, $item->name, ['disabled' => 'true']) }}
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" disabled="true" />
@endif
</td>
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block"><a class="col-aka">{{ $item->id }}</a></td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-3 col-xl-3 long-texts"><a href="{{ route('companies.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block long-texts">{{ $item->email }}</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block">@date($item->created_at)</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">
@if ((company_id() != $item->id) && user()->can('update-common-companies'))
{{ 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 col-xl-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">
@if ($item->enabled)
<a class="dropdown-item" href="{{ route('companies.switch', $item->id) }}">{{ trans('general.switch') }}</a>
<div class="dropdown-divider"></div>
@endif
<a class="dropdown-item" href="{{ route('companies.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-common-companies')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'companies.destroy') !!}
@endcan
</x-table.td>
<x-table.td class="w-2/12 sm:w-1/12 font-bold truncate">
{{ $item->id }}
</x-table.td>
<x-table.td class="w-8/12 sm:w-4/12 truncate">
<x-slot name="first" class="flex" override="class">
<div class="font-medium truncate">
{{ $item->name }}
</div>
</div>
</td>
</tr>
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.companies', 1) }}" />
@endif
</x-slot>
<x-slot name="second">
@if ($item->tax_number)
{{ $item->tax_number }}
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 hidden sm:table-cell truncate">
<x-slot name="first">
@if ($item->email)
{{ $item->email }}
@else
<x-empty-data />
@endif
</x-slot>
<x-slot name="second">
@if ($item->phone)
{{ $item->phone }}
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-3/12" kind="amount">
<x-slot name="first">
@if ($item->country)
<x-index.country code="{{ $item->country }}" />
@else
<x-empty-data />
@endif
</x-slot>
<x-slot name="second">
@if ($item->currency)
<x-index.currency code="{{ $item->currency }}" />
@else
<x-empty-data />
@endif
</x-slot>
</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' => $companies])
</div>
</div>
</div>
@endsection
<x-pagination :items="$companies" />
</x-index.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="companies" />
</x-layouts.admin>

View File

@ -1,41 +1,31 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]) }}</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="dashboard" route="dashboards.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('dashboards.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::open([
'id' => 'dashboard',
'route' => 'dashboards.store',
'@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') }}
@can('read-auth-users')
<x-form.group.checkbox name="users" label="{{ trans_choice('general.users', 2) }}" :options="$users" :checked="[]" />
@endcan
</x-slot>
</x-form.section>
@can('read-auth-users')
{{ Form::checkboxGroup('users', trans_choice('general.users', 2), $users, 'name') }}
@endcan
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="dashboards.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
</div>
</div>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('dashboards.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="dashboards" />
</x-layouts.admin>

View File

@ -1,44 +1,35 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.dashboards', 1)]) }}</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.dashboards', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="dashboard" method="PATCH" :route="['dashboards.update', $dashboard->id]" :model="$dashboard">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('dashboards.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($dashboard, [
'id' => 'dashboard',
'method' => 'PATCH',
'route' => ['dashboards.update', $dashboard->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') }}
@can('read-auth-users')
<x-form.group.checkbox name="users" label="{{ trans_choice('general.users', 2) }}" :options="$users" :checked="$dashboard->users()->pluck('id')->toArray()" />
@endcan
</x-slot>
</x-form.section>
@can('read-auth-users')
{{ Form::checkboxGroup('users', trans_choice('general.users', 2), $users, 'name') }}
@endcan
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
{{ Form::radioGroup('enabled', trans('general.enabled'), $dashboard->enabled) }}
</div>
</div>
@can('update-common-dashboards')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="dashboards.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
@can('update-common-dashboards')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('dashboards.index') }}
</div>
</div>
@endcan
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="dashboards" />
</x-layouts.admin>

View File

@ -1,91 +1,74 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.dashboards', 2) }}</x-slot>
@section('title', trans_choice('general.dashboards', 2))
<x-slot name="buttons">
@can('create-common-dashboards')
<x-link href="{{ route('dashboards.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]) }}
</x-link>
@endcan
</x-slot>
@can('create-common-dashboards')
@section('new_button')
<a href="{{ route('dashboards.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endsection
@endcan
<x-slot name="content">
<x-index.container>
<x-index.search
search-string="App\Models\Common\Dashboard"
bulk-action="App\BulkActions\Common\Dashboards"
/>
@section('content')
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'dashboards.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Common\Dashboard" />
</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>
{{ Form::bulkActionRowGroup('general.dashboards', $bulk_actions, ['group' => 'common', 'type' => 'dashboards']) }}
{!! Form::close() !!}
</div>
<x-table.th class="w-8/12 sm:w-5/12">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</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-3 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-6 col-lg-7 col-xl-7 long-texts">@sortablelink('name', trans('general.name'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<x-table.th class="w-7/12 hidden sm:table-cell" kind="right">
{{ trans_choice('general.users', 1) }}
</x-table.th>
</x-table.tr>
</x-table.thead>
<tbody>
<x-table.tbody>
@foreach($dashboards as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-3 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-3 col-md-6 col-lg-7 col-xl-7 long-texts"><a href="{{ route('dashboards.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">
@if (user()->can('update-common-dashboards'))
{{ 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
<x-table.tr href="{{ route('dashboards.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 p-0 whitespace-nowrap text-sm font-medium text-black">
{{ $item->name }}
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.dashboards', 1) }}" />
@endif
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2 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">
@if ($item->enabled)
<a class="dropdown-item" href="{{ route('dashboards.switch', $item->id) }}">{{ trans('general.switch') }}</a>
<div class="dropdown-divider"></div>
@endif
<a class="dropdown-item" href="{{ route('dashboards.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-common-dashboards')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'dashboards.destroy') !!}
@endcan
</div>
</div>
</td>
</tr>
</x-table.td>
<x-table.td class="w-7/12" kind="right">
@if ($item->users)
@foreach($item->users as $user)
<span class="bg-lilac-900 px-3 py-1 text-sm rounded-lg text-black ltr:ml-3 rtl:mr-3">
{{ !empty($user->name) ? $user->name : trans('general.na') }}
</span>
@endforeach
@endif
</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' => $dashboards])
</div>
</div>
</div>
@endsection
<x-pagination :items="$dashboards" />
</x-index.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="dashboards" />
</x-layouts.admin>

View File

@ -1,148 +1,186 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="metaTitle">
{{ $dashboard->name }}
</x-slot>
@section('title', $dashboard->name)
<x-slot name="title">
@if ($user_dashboards->count() > 1)
<div class="flex items-center relative cursor-pointer">
<x-dropdown id="dashboard-list">
<x-slot name="trigger" class="flex items-center" override="class">
<span class="text-2xl xl:text-5xl text-black font-light truncate border-b border-transparent transition-all hover:text-black-700 hover:border-black">
{{ $dashboard->name }}
</span>
@section('dashboard_action')
@canany(['create-common-widgets', 'read-common-dashboards'])
<span class="dashboard-action">
<div class="dropdown">
<a class="btn btn-sm items-align-center py-2 mt--1" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-v"></i>
</a>
<svg class="w-5 h-5 mt-1 text-gray-400" x-description="Heroicon name: solid/selector" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</x-slot>
<div class="dropdown-menu dropdown-menu-sm-right dropdown-menu-xs-right dropdown-menu-arrow">
@can('create-common-widgets')
{!! Form::button(trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]), [
'type' => 'button',
'class' => 'dropdown-item',
'title' => trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]),
'@click' => 'onCreateWidget()',
]) !!}
@endcan
@can('update-common-dashboards')
<div class="dropdown-divider"></div>
@can('create-common-dashboards')
<a class="dropdown-item" href="{{ route('dashboards.create') }}">{{ trans('general.title.create', ['type' => trans_choice('general.dashboards', 1)]) }}</a>
@endcan
<a class="dropdown-item" href="{{ route('dashboards.index') }}">{{ trans('general.title.manage', ['type' => trans_choice('general.dashboards', 2)]) }}</a>
@endcan
</div>
@foreach ($user_dashboards as $user_dashboard)
<x-dropdown.link href="{{ route('dashboards.switch', $user_dashboard->id) }}">
{{ $user_dashboard->name }}
</x-dropdown.link>
@endforeach
</x-dropdown>
</div>
</span>
@endcanany
@else
{{ $dashboard->name }}
@endif
</x-slot>
@php
$text = json_encode([
'name' => trans('general.name'),
'type' => trans_choice('general.types', 1),
'width' => trans('general.width'),
'sort' => trans('general.sort'),
'enabled' => trans('general.enabled'),
'yes' => trans('general.yes'),
'no' => trans('general.no'),
'save' => trans('general.save'),
'cancel' => trans('general.cancel')
]);
<x-slot name="buttons">
<!--Dashboard General Filter-->
<el-date-picker
v-model="filter_date"
type="daterange"
align="right"
unlink-panels
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
@change="onChangeFilterDate"
range-separator="-"
start-placeholder="{{ $date_picker_shortcuts[trans('reports.this_year')]['start'] }}"
end-placeholder="{{ $date_picker_shortcuts[trans('reports.this_year')]['end'] }}"
popper-class="dashboard-picker"
:picker-options="{
shortcuts: [
{
text: '{{ trans("reports.this_year") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}');
$placeholder = json_encode([
'name' => trans('general.form.enter', ['field' => trans('general.name')]),
'type' => trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]),
'width' => trans('general.form.select.field', ['field' => trans('general.width')]),
'sort' => trans('general.form.enter', ['field' => trans('general.sprt')])
]);
@endphp
picker.$emit('pick', [start, end]);
}
},
{
text: '{{ trans("reports.previous_year") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["end"] }}');
<akaunting-widget
v-if="widget_modal"
:title="'{{ trans_choice('general.widgets', 1) }}'"
:show="widget_modal"
:widget_id="widget.id"
:name="widget.name"
:width="widget.width"
:action="widget.action"
:type="widget.class"
:types="widgets"
:sort="widget.sort"
:dashboard_id="{{ $dashboard->id }}"
:text="{{ $text }}"
:placeholder="{{ $placeholder }}"
@cancel="onCancel">
</akaunting-widget>
@endsection
picker.$emit('pick', [start, end]);
}
},
{
text: '{{ trans("reports.this_quarter") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["end"] }}');
@section('new_button')
<!--Dashboard General Filter-->
<el-date-picker
v-model="filter_date"
type="daterange"
align="right"
unlink-panels
:format="'yyyy-MM-dd'"
value-format="yyyy-MM-dd"
@change="onChangeFilterDate"
range-separator=">>"
start-placeholder="{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}"
end-placeholder="{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}"
:picker-options="{
shortcuts: [
{
text: '{{ trans("reports.this_year") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}');
picker.$emit('pick', [start, end]);
}
},
{
text: '{{ trans("reports.previous_quarter") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["end"] }}');
picker.$emit('pick', [start, end]);
picker.$emit('pick', [start, end]);
}
},
{
text: '{{ trans("reports.last_12_months") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["end"] }}');
picker.$emit('pick', [start, end]);
}
}
},
{
text: '{{ trans("reports.previous_year") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["end"] }}');
]
}">
</el-date-picker>
</x-slot>
picker.$emit('pick', [start, end]);
}
},
{
text: '{{ trans("reports.this_quarter") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["end"] }}');
@section('dashboard_action')
@canany(['create-common-widgets', 'read-common-dashboards'])
<div class="dashboard-action">
<x-dropdown id="dropdown-dashboard-company">
<x-slot name="trigger" class="flex" override="class">
<span id="dashboard-more-actions" class="material-icons-outlined text-4xl text-purple cursor-pointer hover:bg-gray-100 hover:rounded-lg hover:shadow-md">more_vert</span>
</x-slot>
picker.$emit('pick', [start, end]);
}
},
{
text: '{{ trans("reports.previous_quarter") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["end"] }}');
@can('create-common-widgets')
<x-button
type="button"
id="dashboard-add-widget"
class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap"
override="class"
title="{{ trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]) }}"
@click="onCreateWidget()"
>
<span class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100">
{{ trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]) }}
</span>
</x-button>
picker.$emit('pick', [start, end]);
}
},
{
text: '{{ trans("reports.last_12_months") }}',
onClick(picker) {
const start = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["start"] }}');
const end = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["end"] }}');
<x-dropdown.divider />
@endcan
picker.$emit('pick', [start, end]);
}
}
]
}">
</el-date-picker>
@endsection
@can('update-common-dashboards')
@can('create-common-dashboards')
<x-dropdown.link href="{{ route('dashboards.create') }}">
{{ trans('general.title.create', ['type' => trans_choice('general.dashboards', 1)]) }}
</x-dropdown.link>
@endcan
@section('content')
<div class="row">
@foreach($widgets as $widget)
@widget($widget)
@endforeach
</div>
@endsection
<x-dropdown.link href="{{ route('dashboards.index') }}">
{{ trans('general.title.manage', ['type' => trans_choice('general.dashboards', 2)]) }}
</x-dropdown.link>
@endcan
</x-dropdown>
</div>
@endcanany
@push('scripts_start')
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
@endpush
@php
$text = json_encode([
'name' => trans('general.name'),
'type' => trans_choice('general.types', 1),
'width' => trans('general.width'),
'sort' => trans('general.sort'),
'enabled' => trans('general.enabled'),
'yes' => trans('general.yes'),
'no' => trans('general.no'),
'save' => trans('general.save'),
'cancel' => trans('general.cancel')
]);
$placeholder = json_encode([
'name' => trans('general.form.enter', ['field' => trans('general.name')]),
'type' => trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]),
'width' => trans('general.form.select.field', ['field' => trans('general.width')]),
'sort' => trans('general.form.enter', ['field' => trans('general.sprt')])
]);
@endphp
<akaunting-widget
v-if="widget_modal"
:title="'{{ trans_choice('general.widgets', 1) }}'"
:show="widget_modal"
:widget_id="widget.id"
:name="widget.name"
:width="widget.width"
:action="widget.action"
:type="widget.class"
:types="widgets"
:sort="widget.sort"
:dashboard_id="{{ $dashboard->id }}"
:text="{{ $text }}"
:placeholder="{{ $placeholder }}"
@cancel="onCancel">
</akaunting-widget>
@endsection
<x-slot name="content">
<div class="dashboard flex flex-wrap -mx-12">
@foreach($widgets as $widget)
@widget($widget)
@endforeach
</div>
</x-slot>
<x-script folder="common" file="dashboards" />
</x-layouts.admin>

View File

@ -1,52 +1,62 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('import.title', ['type' => $title_type]) }}
</x-slot>
@section('title', trans('import.title', ['type' => $title_type]))
@section('content')
<div class="card">
{!! Form::open($form_params) !!}
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div class="alert alert-warning alert-important">
{!! trans('import.limitations', ['extensions' => strtoupper(config('excel.imports.extensions')), 'row_limit' => config('excel.imports.row_limit')]) !!}
</div>
</div>
<div class="col-md-12">
<div class="alert alert-info alert-important">
{!! trans('import.sample_file', ['download_link' => $sample_file]) !!}
<x-slot name="content">
<div class="card">
<x-form id="import" :route="$form_params['route']" :url="$form_params['url']">
<div class="card-body mt-8">
<div class="border-t-4 border-orange-300 rounded-b-lg text-orange-700 px-4 py-3 shadow-md" role="alert">
<div class="flex">
<div>
{!! trans('import.limitations', ['extensions' => strtoupper(config('excel.imports.extensions')),
'row_limit' => config('excel.imports.row_limit')
])
!!}
</div>
</div>
</div>
{{ Form::fileGroup('import', '', 'plus', ['dropzone-class' => 'form-file', 'options' => ['acceptedFiles' => '.xls,.xlsx']], null, 'col-md-12') }}
<div class="border-t-4 mt-8 border-blue-300 rounded-b-lg text-blue-700 px-4 py-3 shadow-md" role="alert">
<div class="flex">
<div>
{!! trans('import.sample_file', ['download_link' => $sample_file]) !!}
</div>
</div>
</div>
<x-form.group.file name="import" dropzone-class="form-file" singleWidthClasses :options="['acceptedFiles' => '.xls,.xlsx']" form-group-class="mt-8" />
</div>
</div>
<div class="card-footer">
<div class="row save-buttons">
<div class="col-xs-12 col-sm-12">
@if (!empty($route))
<a href="{{ route(\Str::replaceFirst('.import', '.index', $route)) }}" class="btn btn-outline-secondary">
<div class="relative__footer mt-8">
<div class="sm:col-span-6 flex items-center justify-end">
@if (! empty($route))
<a href="{{ route(\Str::replaceFirst('.import', '.index', $route)) }}" class="px-6 py-1.5 mr-2 hover:bg-gray-200 rounded-lg">
{{ trans('general.cancel') }}
</a>
@else
<a href="{{ url($path) }}" class="btn btn-outline-secondary">
<a href="{{ url($path) }}" class="px-6 py-1.5 hover:bg-gray-200 rounded-lg ltr:ml-2 rtl:mr-2">
{{ trans('general.cancel') }}
</a>
@endif
{!! Form::button(
'<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('import.import') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-icon btn-success']) !!}
<x-button
type="submit"
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100"
::disabled="form.loading"
override="class"
>
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': form.loading}]">
{{ trans('import.import') }}
</span>
</x-button>
</div>
</div>
</div>
</x-form>
</div>
</x-slot>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/common/imports.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="imports" />
</x-layouts.admin>

View File

@ -1,49 +1,66 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.items', 1)]) }}</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.items', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.items', 1)]) }}"
icon="inventory_2"
route="items.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'items.store',
'id' => 'item',
'@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="item" route="items.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('items.form_description.general') }}" />
</x-slot>
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
<x-slot name="body">
<x-form.group.radio
name="type"
label="{{ trans_choice('general.types', 1) }}"
:options="[
'product' => trans_choice('general.products', 1),
'service' => trans_choice('general.services', 1)
]"
checked="product"
@input="onType($event)"
/>
{{ Form::multiSelectAddNewGroup('tax_ids', trans_choice('general.taxes', 1), 'percentage', $taxes, (setting('default.tax')) ? [setting('default.tax')] : null, ['path' => route('modals.taxes.create'), 'field' => ['key' => 'id', 'value' => 'title']], 'col-md-6 el-select-tags-pl-38') }}
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
{{ Form::textareaGroup('description', trans('general.description')) }}
<x-form.group.category type="item" not-required />
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money-bill-wave') }}
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
</x-slot>
</x-form.section>
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('items.form_description.billing') }}" />
</x-slot>
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item enabled:1']) }}
<x-slot name="body">
<x-form.group.checkbox name="sale_information" id="item-sale-information" :options="['sale' => trans('items.sale_information')]" @input="onInformation($event, 'sale')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), 'plus', ['dropzone-class' => 'form-file']) }}
<x-form.group.checkbox name="purchase_information" id="item-purchase-information" :options="['sale' => trans('items.purchase_information')]" @input="onInformation($event, 'purchase')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
</div>
</div>
<x-form.group.text name="sale_price" label="{{ trans('items.sale_price') }}" v-bind:disabled="sale_information" />
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('items.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
<x-form.group.text name="purchase_price" label="{{ trans('items.purchase_price') }}" v-bind:disabled="purchase_information" />
@push('scripts_start')
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
@endpush
<x-form.group.select multiple add-new name="tax_ids" label="{{ trans_choice('general.taxes', 1) }}" :options="$taxes" :selected="(setting('default.tax')) ? [setting('default.tax')] : null" not-required :path="route('modals.taxes.create')" :field="['key' => 'id', 'value' => 'title']" form-group-class="sm:col-span-3 el-select-tags-pl-38" />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="items.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<x-script folder="common" file="items" />
</x-layouts.admin>

View File

@ -1,53 +1,64 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.items', 1)]) }}</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.items', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="item" method="PATCH" :route="['items.update', $item->id]" :model="$item">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('items.form_description.general') }}" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($item, [
'id' => 'item',
'method' => 'PATCH',
'route' => ['items.update', $item->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.radio
name="type"
label="{{ trans_choice('general.types', 1) }}"
:options="[
'product' => trans_choice('general.products', 1),
'service' => trans_choice('general.services', 1)
]"
checked="{{ $item->type }}"
@input="onType($event)"
/>
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
{{ Form::multiSelectAddNewGroup('tax_ids', trans_choice('general.taxes', 1), 'percentage', $taxes, $item->tax_ids, ['path' => route('modals.taxes.create'), 'field' => ['key' => 'id', 'value' => 'title']], 'col-md-6 el-select-tags-pl-38') }}
<x-form.group.category type="item" not-required />
{{ Form::textareaGroup('description', trans('general.description')) }}
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
</x-slot>
</x-form.section>
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money-bill-wave') }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('items.form_description.billing') }}" />
</x-slot>
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
<x-slot name="body">
<x-form.group.checkbox name="sale_information" id="item-sale-information" :options="['sale' => trans('items.sale_information')]" @input="onInformation($event, 'sale')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
{{ 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'). '?search=type:item enabled:1']) }}
<x-form.group.checkbox name="purchase_information" id="item-purchase-information" :options="['sale' => trans('items.purchase_information')]" @input="onInformation($event, 'purchase')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file'], $item->picture) }}
<x-form.group.text name="sale_price" label="{{ trans('items.sale_price') }}" v-bind:disabled="sale_information" />
{{ Form::radioGroup('enabled', trans('general.enabled'), $item->enabled) }}
</div>
</div>
<x-form.group.text name="purchase_price" label="{{ trans('items.purchase_price') }}" v-bind:disabled="purchase_information" />
@can('update-common-items')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('items.index') }}
</div>
</div>
@endcan
<x-form.group.select multiple add-new name="tax_ids" label="{{ trans_choice('general.taxes', 1) }}" :options="$taxes" :selected="$item->tax_ids" not-required :path="route('modals.taxes.create')" :field="['key' => 'id', 'value' => 'title']" form-group-class="sm:col-span-3 el-select-tags-pl-38" />
</x-slot>
</x-form.section>
{!! Form::close() !!}
</div>
@endsection
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
@push('scripts_start')
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
@endpush
@can('update-common-items')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="items.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
<x-script folder="common" file="items" />
</x-layouts.admin>

View File

@ -1,112 +1,152 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.items', 2) }}</x-slot>
@section('title', trans_choice('general.items', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.items', 2) }}"
icon="inventory_2"
route="items.index"
></x-slot>
@section('new_button')
@can('create-common-items')
<a href="{{ route('items.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
<a href="{{ route('import.create', ['common', 'items']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
@endcan
<a href="{{ route('items.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
@endsection
<x-slot name="buttons">
@can('create-common-items')
<x-link href="{{ route('items.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.items', 1)]) }}
</x-link>
@endcan
</x-slot>
@section('content')
@if ($items->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' => 'items.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Common\Item" />
</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.items', $bulk_actions, ['group' => 'common', 'type' => 'items']) }}
{!! Form::close() !!}
</div>
@can('create-common-items')
<x-dropdown.link href="{{ route('import.create', ['common', 'items']) }}">
{{ 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-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-lg-1 col-xl-2 d-none d-lg-block">@sortablelink('category', trans_choice('general.categories', 1))</th>
<th class="col-md-3 col-lg-3 col-xl-2 text-right d-none d-md-block">@sortablelink('sale_price', trans('items.sales_price'))</th>
<th class="col-lg-2 col-xl-2 text-right d-none d-lg-block">@sortablelink('purchase_price', trans('items.purchase_price'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
</tr>
</thead>
<x-dropdown.link href="{{ route('items.export', request()->input()) }}">
{{ trans('general.export') }}
</x-dropdown.link>
</x-dropdown>
</x-slot>
<tbody>
<x-slot name="content">
@if ($items->count() || request()->get('search', false))
<x-index.container>
<x-index.search
search-string="App\Models\Common\Item"
bulk-action="App\BulkActions\Common\Items"
/>
<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-6/12 sm:w-4/12">
<x-slot name="first">
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="description" title="{{ trans('general.description') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-3/12 hidden sm:table-cell">
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
{{ trans_choice('general.taxes', 2) }}
</x-table.th>
<x-table.th class="w-6/12 sm:w-3/12" kind="amount">
<x-slot name="first">
<x-sortablelink column="sale_price" title="{{ trans('items.sale_price') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="purchase_price" title="{{ trans('items.purchase_price') }}" />
</x-slot>
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($items as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">
{{ Form::bulkActionGroup($item->id, $item->name) }}
</td>
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-3 col-xl-3 py-2">
<img src="{{ $item->picture ? Storage::url($item->picture->id) : asset('public/img/akaunting-logo-green.svg') }}" class="avatar image-style p-1 mr-3 item-img col-aka d-none d-md-inline" alt="{{ $item->name }}">
<a href="{{ route('items.edit', $item->id) }}">{{ $item->name }}</a>
</td>
<td class="col-lg-1 col-xl-2 d-none d-lg-block long-texts">
{{ $item->category->name }}
</td>
<td class="col-md-3 col-lg-3 col-xl-2 text-right d-none d-md-block">
{{ money($item->sale_price, setting('default.currency'), true) }}
</td>
<td class="col-lg-2 col-xl-2 text-right d-none d-lg-block">
{{ money($item->purchase_price, setting('default.currency'), true) }}
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center">
@if (user()->can('update-common-items'))
{{ 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-3 col-md-2 col-lg-1 col-xl-1 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center p-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('items.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('create-common-items')
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('items.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
@endcan
@can('delete-common-items')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'items.destroy') !!}
@endcan
<x-table.tr href="{{ route('items.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 truncate">
<x-slot name="first" class="flex items-center font-bold" override="class">
<div class="truncate">
{{ $item->name }}
</div>
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice('general.items', 1) }}" />
@endif
</x-slot>
<x-slot name="second" class="font-normal truncate" override="class">
{{ $item->description }}
</x-slot>
</x-table.td>
<x-table.td class="w-3/12 truncate hidden sm:table-cell">
<div class="flex items-center">
<x-index.category :model="$item->category" />
</div>
</td>
</tr>
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
@if ($item->taxes->count())
@foreach($item->taxes as $tax)
<span class="bg-lilac-900 px-3 py-1 text-sm rounded-lg text-black ltr:mr-3 rtl:ml-3">
{{ $tax->tax->name }}
</span>
@endforeach
@else
<x-empty-data />
@endif
</x-table.td>
<x-table.td class="relative w-6/12 sm:w-3/12" kind="amount">
<x-slot name="first">
@if ($item->sale_price)
<x-money :amount="$item->sale_price" :currency="setting('default.currency')" convert />
@else
<x-empty-data />
@endif
</x-slot>
<x-slot name="second">
@if ($item->purchase_price)
<x-money :amount="$item->purchase_price" :currency="setting('default.currency')" convert />
@else
<x-empty-data />
@endif
</x-slot>
</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 align-items-center">
@include('partials.admin.pagination', ['items' => $items])
</div>
</div>
</div>
@else
<x-empty-page page="items" />
@endif
@endsection
<x-pagination :items="$items" />
</x-index.container>
@else
<x-empty-page group="common" page="items" />
@endif
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="items" />
</x-layouts.admin>

View File

@ -1,60 +0,0 @@
@extends('layouts.admin')
@section('title', trans_choice('general.notifications', 2))
@section('new_button')
<a href="{{ route('notifications.read-all') }}" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm" data-toggle="tooltip" data-placement="right" title="{{ trans('notifications.mark_read_all') }}">
<span class="btn-inner--icon"><i class="fas fa-check-double pt-2"></i></span>
</a>
@endsection
@section('content')
@stack('new_apps')
<livewire:common.notifications.new-apps />
@stack('exports')
<livewire:common.notifications.exports />
@stack('imports')
<livewire:common.notifications.imports />
@stack('invoices_recurring')
<livewire:common.notifications.recurring type="invoice" text-title="notifications.recurring_invoices" />
@stack('invoices_reminder')
<livewire:common.notifications.reminder type="invoice" text-title="widgets.overdue_invoices" />
@stack('bills_recurring')
<livewire:common.notifications.recurring type="bill" text-title="notifications.recurring_bills" />
@stack('bills_reminder')
<livewire:common.notifications.reminder type="bill" text-title="notifications.upcoming_bills" />
@stack('end')
@endsection
@push('body_js')
<script type="text/javascript">
var hash_split = location.hash.split('#');
if (hash_split[1] != undefined && document.getElementById(hash_split[1]) != null) {
document.getElementById(hash_split[1]).scrollIntoView({
behavior: 'smooth'
});
document.getElementById('collapse-' + hash_split[1]).classList.add('show');
document.getElementById('heading-' + hash_split[1]).ariaExpanded = 'true';
}
</script>
@endpush
@push('scripts_start')
<script src="{{ asset('public/vendor/bootstrap-notify/bootstrap-notify.min.js') }}"></script>
@endpush

View File

@ -1,42 +1,43 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.reports', 1)]) }}</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.reports', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="report" route="reports.store">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="" />
</x-slot>
@section('content')
<div class="card">
{!! Form::open([
'id' => 'report',
'route' => 'reports.store',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'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.select name="class" label="{{ trans_choice('general.types', 1) }}" :options="$classes" change="onChangeClass" />
{{ Form::selectGroup('class', trans_choice('general.types', 1), 'bars', $classes, null, ['required' => 'required', 'change' => 'onChangeClass']) }}
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" />
</x-slot>
</x-form.section>
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
<x-form.section v-if="showPreferences">
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('reports.preferences', 2) }}" description="" />
</x-slot>
{{ Form::hidden('report', 'invalid', ['data-field' => 'settings']) }}
<x-slot name="body">
<component v-bind:is="report_fields" @change="onChangeReportFields"></component>
</x-slot>
</x-form.section>
<component v-bind:is="report_fields" @change="onChangeReportFields"></component>
</div>
</div>
<x-form.input.hidden name="report" value="invalid" data-field="settings" />
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('reports.index') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="reports.index" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
@push('scripts_start')
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="reports" />
</x-layouts.admin>

View File

@ -1,85 +1,148 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.reports', 1)]) }}</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.reports', 1)]))
<x-slot name="content">
<x-form.container>
<x-form id="report" method="PATCH" :route="['reports.update', $report->id]" :model="$report">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="" />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($report, [
'id' => 'report',
'method' => 'PATCH',
'route' => ['reports.update', $report->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'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="class_disabled" label="{{ trans_choice('general.types', 1) }}" value="{{ $classes[$report->class] }}" disabled />
{{ Form::textGroup('class_disabled', trans_choice('general.types', 1), 'bars', ['required' => 'required', 'disabled' => 'true'], $classes[$report->class]) }}
{{ Form::hidden('class', $report->class) }}
<x-form.input.hidden name="class" :value="$report->class" />
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" />
</x-slot>
</x-form.section>
{{ Form::hidden('report', 'invalid', ['data-field' => 'settings']) }}
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('reports.preferences', 2) }}" description="" />
</x-slot>
@foreach($class->getFields() as $field)
@php $type = $field['type']; @endphp
<x-slot name="body">
<x-form.input.hidden name="report" value="invalid" data-field="settings" />
@if (($type == 'textGroup') || ($type == 'emailGroup') || ($type == 'passwordGroup'))
{{ Form::$type($field['name'], $field['title'], $field['icon'], array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@elseif ($type == 'textareaGroup')
{{ Form::$type($field['name'], $field['title']) }}
@elseif ($type == 'dateGroup')
{{ Form::$type($field['name'], $field['title'], $field['icon'], array_merge([
'data-field' => 'settings',
'show-date-format' => company_date_format(),
],
$field['attributes']),
isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']}: null
) }}
@elseif ($type == 'selectGroup')
{{ Form::$type($field['name'], $field['title'], $field['icon'], $field['values'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : $field['selected'], array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@elseif ($type == 'radioGroup')
{{ Form::$type($field['name'], $field['title'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : true, $field['enable'], $field['disable'], array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@elseif ($type == 'checkboxGroup')
{{ Form::$type($field['name'], $field['title'], $field['items'], $report->settings->{$field['name']}, $field['id'], $report->settings->{$field['name']}, array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@endif
@endforeach
</div>
</div>
@foreach($class->getFields() as $field)
@php $type = $field['type']; @endphp
@can('update-common-reports')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('reports.index') }}
</div>
</div>
@endcan
@switch($type)
@case('text')
@case('textGroup')
<x-form.group.text
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
data-field="settings"
:attributes="$field['attributes']"
/>
@break
{!! Form::close() !!}
</div>
@endsection
@case('email')
@case('emailGroup')
<x-form.group.email
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
data-field="settings"
:attributes="$field['attributes']"
/>
@break
@push('scripts_start')
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
@endpush
@case('password')
@case('passwordGroup')
<x-form.group.email
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
data-field="settings"
:attributes="$field['attributes']"
/>
@break
@case('textarea')
@case('textareaGroup')
<x-form.group.textarea
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
data-field="settings"
:attributes="$field['attributes']"
/>
@break
@case('date')
@case('dateGroup')
<x-form.group.date
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
:value="isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']}: null"
data-field="settings"
:attributes="array_merge([
'model' => 'form.settings'.'.'.$field['name'],
'show-date-format' => company_date_format(),
], $field['attributes'])"
/>
@break
@case('select')
@case('selectGroup')
<x-form.group.select
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
:options="$field['values']"
:selected="$field['selected']"
data-field="settings"
:attributes="$field['attributes']"
/>
@break
@case('radio')
@case('radioGroup')
<x-form.group.radio
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
:attributes="array_merge([
'data-field' => 'settings'
], $field['attributes'])"
/>
@break
@case('checkbox')
@case('checkboxGroup')
<x-form.group.checkbox
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
:attributes="array_merge([
'data-field' => 'settings'
], $field['attributes'])"
/>
@break
@default
<x-form.group.text
name="{{ $field['name'] }}"
label="{{ $field['title'] }}"
:attributes="array_merge([
'data-field' => 'settings'
], $field['attributes'])"
/>
@endswitch
@endforeach
</x-slot>
</x-form.section>
@can('update-common-reports')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="reports.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
<x-script folder="common" file="reports" />
</x-layouts.admin>

View File

@ -1,91 +1,90 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.reports', 2) }}</x-slot>
@section('title', trans_choice('general.reports', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.reports', 2) }}"
icon="donut_small"
route="reports.index"
></x-slot>
@section('new_button')
@can('create-common-reports')
<a href="{{ route('reports.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endcan
@endsection
<x-slot name="buttons">
@can('create-common-reports')
<x-link href="{{ route('reports.create') }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice('general.reports', 1)]) }}
</x-link>
@endcan
</x-slot>
@section('content')
<div class="row mb-4">
@foreach($categories as $name => $reports)
<div class="col-md-12">
<h3>{{ $name }}</h3>
</div>
<x-slot name="content">
<livewire:report.pins :categories="$categories" />
@foreach($reports as $report)
<div class="col-md-4">
<div class="card card-stats">
@canany(['create-common-reports', 'update-common-reports', 'delete-common-reports'])
<a class="btn btn-sm items-align-center py-2 mr-0 card-action-button shadow-none--hover" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-v text-primary"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
@can('update-common-reports')
<a class="dropdown-item" href="{{ route('reports.edit', $report->id) }}">{{ trans('general.edit') }}</a>
@endcan
@can('create-common-reports')
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('reports.duplicate', $report->id) }}">{{ trans('general.duplicate') }}</a>
@endcan
@can('delete-common-reports')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($report, 'reports.destroy') !!}
@endcan
</div>
@endcanany
<div class="card-body">
<div class="row">
<div class="col">
<a href="{{ route('reports.show', $report->id) }}">
<h5 class="card-title text-uppercase text-muted mb-0">{{ $report->name }}</h5>
</a>
<div class="d-flex align-items-center">
<a href="{{ route('reports.show', $report->id) }}">
<h2 class="font-weight-bold mb-0" v-if="reports_total[{{ $report->id }}]" v-html="reports_total[{{ $report->id }}]"></h2>
<h2 class="font-weight-bold mb-0" v-else>{{ $totals[$report->id] }}</h2>
</a>
<button type="button" @click="onRefreshTotal('{{ $report->id }}')" class="btn btn-otline-primary btn-sm ml-2">
<i class="fas fa-redo"></i>
</button>
</div>
</div>
<div class="col-auto">
<a href="{{ route('reports.show', $report->id) }}">
<div class="icon icon-shape bg-orange text-white rounded-circle shadow">
<i class="{{ $icons[$report->id] }}"></i>
</div>
</a>
</div>
</div>
<p class="mt-3 mb-0 text-sm">
<a class="text-default" href="{{ route('reports.show', $report->id) }}">
<span class="pre">{{ $report->description }}</span>
</a>
</p>
</div>
</div>
@foreach ($categories as $category)
@php $category_id = $loop->index; @endphp
<div
@class([
'mb-14',
'mt-4' => (! $loop->first) ? false : true,
'mt-12' => ($loop->first) ? false : true,
])
>
<div class="px-2">
<x-form.section.head title="{!! $category['name'] !!}" description="{{ $category['description'] }}" />
</div>
@endforeach
<div class="grid sm:grid-cols-6 gap-12 my-3.5">
@foreach($category['reports'] as $report)
<div class="flex justify-between sm:col-span-3 p-1 group">
<div class="lg:w-80">
<a href="{{ route('reports.show', $report->id) }}" class="flex">
<span class="material-icons-outlined text-5xl transform transition-all hover:scale-125">
{{ $icons[$report->id] }}
</span>
<div class="ltr:ml-2 rtl:mr-2">
<h2 class="mb-1">
<span class="border-b border-transparent transition-all group-hover:border-black">
{{ $report->name }}
</span>
</h2>
<span class="text-black-400 text-sm">{{ $report->description }}</span>
</div>
</a>
</div>
<div class="flex items-start">
<livewire:report.pin :categories="$categories" :report-id="$report->id" />
@canany(['create-common-reports', 'update-common-reports', 'delete-common-reports'])
<x-dropdown id="widget-{{ $category_id }}-{{ $report->id }}">
<x-slot name="trigger" class="flex" override="class">
<span class="material-icons-outlined text-purple text-lg px-1 py-0.5 cursor-pointer hover:bg-gray-100 hover:rounded-lg hover:shadow-md">more_vert</span>
</x-slot>
@can('update-common-reports')
<x-dropdown.link href="{{ route('reports.edit', $report->id) }}">
{{ trans('general.edit') }}
</x-dropdown.link>
@endcan
@can('create-common-reports')
<x-dropdown.link href="{{ route('reports.duplicate', $report->id) }}">
{{ trans('general.duplicate') }}
</x-dropdown.link>
@endcan
@can('delete-common-reports')
<x-delete-link :model="$report" route="reports.destroy" />
@endcan
</x-dropdown>
@endcanany
</div>
</div>
@endforeach
</div>
</div>
@endforeach
</div>
@endsection
</x-slot>
@push('scripts_start')
<script type="text/javascript">
var reports_total = {!! json_encode($totals) !!};
</script>
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
@endpush
<x-script folder="common" file="reports" />
</x-layouts.admin>

View File

@ -0,0 +1,3 @@
<button type="{{ $type }}" class="{{ $class }}" {{ $attributes }}>
{{ $slot }}
</button>

View File

@ -0,0 +1,30 @@
<x-form.section>
<x-slot name="head">
<x-form.section.head
title="{{ trans($textSectionAddressTitle) }}"
description="{{ trans($textSectionAddressDescription) }}"
/>
</x-slot>
<x-slot name="body">
@if (! $hideAddress)
<x-form.group.textarea name="address" label="{{ trans($textAddress) }}" not-required v-model="form.address" />
@endif
@if (! $hideCity)
<x-form.group.text name="city" label="{{ trans_choice($textCity, 1) }}" not-required />
@endif
@if (! $hideZipCode)
<x-form.group.text name="zip_code" label="{{ trans($textZipCode) }}" not-required />
@endif
@if (! $hideState)
<x-form.group.text name="state" label="{{ trans($textState) }}" not-required />
@endif
@if (! $hideCountry)
<x-form.group.country form-group-class="sm:col-span-3 el-select-tags-pl-38" />
@endif
</x-slot>
</x-form.section>

View File

@ -0,0 +1,18 @@
<x-form.section>
<x-slot name="head">
<x-form.section.head
title="{{ trans($textSectionBillingTitle) }}"
description="{{ trans($textSectionBillingDescription) }}"
/>
</x-slot>
<x-slot name="body">
@if (! $hideTaxNumber)
<x-form.group.text name="tax_number" label="{{ trans($textTaxNumber) }}" not-required />
@endif
@if (! $hideCurrency)
<x-form.group.currency />
@endif
</x-slot>
</x-form.section>

View File

@ -0,0 +1,5 @@
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="{{ $cancelRoute }}" />
</x-slot>
</x-form.section>

View File

@ -0,0 +1,28 @@
<x-form.container>
<x-form
id="{{ $formId }}"
:route="$formRoute"
method="{{ $formMethod }}"
:model="$contact"
>
@if (! $hideSectionGeneral)
<x-contacts.form.general type="{{ $type }}" />
@endif
@if (! $hideSectionBilling)
<x-contacts.form.billing type="{{ $type }}" />
@endif
@if (! $hideSectionAddress)
<x-contacts.form.address type="{{ $type }}" />
@endif
<x-form.input.hidden name="type" value="{{ $type }}" />
@if (! empty($contact))
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
@endif
<x-contacts.form.buttons type="{{ $type }}" />
</x-form>
</x-form.container>

View File

@ -0,0 +1,70 @@
<x-form.section>
<x-slot name="head">
<x-form.section.head
title="{{ trans($textSectionGeneralTitle) }}"
description="{{ trans($textSectionGeneralDescription) }}"
/>
</x-slot>
<x-slot name="body">
@if (! $hideName)
<x-form.group.text name="name" label="{{ trans($textName) }}" form-group-class="{{ $classNameFromGroupClass }}" />
@endif
<div class="sm:col-span-3 grid gap-x-8 gap-y-6">
@if (! $hideEmail)
<x-form.group.text name="email" label="{{ trans($textEmail) }}" not-required />
@endif
@if (! $hidePhone)
<x-form.group.text name="phone" label="{{ trans($textPhone) }}" not-required />
@endif
@if (! $hideWebsite)
<x-form.group.text name="website" label="{{ trans($textWebsite) }}" not-required />
@endif
@if (! $hideReference)
<x-form.group.text name="reference" label="{{ trans($textReference) }}" not-required />
@endif
</div>
<div class="sm:col-span-3">
@if (! $hideCanLogin)
<div class="mt-5.5">
@if (empty($contact))
<x-tooltip id="tooltip-client_portal-text" placement="bottom" message="{{ trans('customers.can_login_description') }}">
<x-form.group.checkbox
name="create_user"
:options="['1' => trans('customers.can_login')]"
@input="onCanLogin($event)"
checkbox-class="sm:col-span-6" />
</x-tooltip>
@else
@if ($contact->user_id)
<x-form.group.checkbox
name="create_user"
:options="['1' => trans('customers.user_created')]"
checkbox-class="sm:col-span-6"
checked
/>
@else
<x-tooltip id="tooltip-client_portal-text" placement="bottom" message="{{ trans('customers.can_login_description') }}">
<x-form.group.checkbox
name="create_user"
:options="['1' => trans('customers.can_login')]"
checkbox-class="sm:col-span-6"
@input="onCanLogin($event)"
/>
</x-tooltip>
@endif
@endif
</div>
@endif
@if (! $hideLogo)
<x-form.group.file name="logo" label="{{ trans_choice('general.pictures', 1) }}" not-required />
@endif
</div>
</x-slot>
</x-form.section>

View File

@ -0,0 +1,15 @@
@if ($checkPermissionCreate)
@can($permissionCreate)
@if (! $hideCreate)
<x-link href="{{ route($createRoute) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice($textPage, 1)]) }}
</x-link>
@endif
@endcan
@else
@if (! $hideCreate)
<x-link href="{{ route($createRoute) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice($textPage, 1)]) }}
</x-link>
@endif
@endif

View File

@ -0,0 +1,268 @@
@if ($hideEmptyPage || ($contacts->count() || request()->get('search', false)))
@if (! $hideSummary)
<x-index.summary :items="$summaryItems" />
@endif
<x-index.container>
@if ((! $hideSearchString) && (! $hideBulkAction))
<x-index.search
search-string="{{ $searchStringModel }}"
bulk-action="{{ $bulkActionClass }}"
route="{{ $searchRoute }}"
/>
@elseif ((! $hideSearchString) && $hideBulkAction)
<x-index.search
search-string="{{ $searchStringModel }}"
route="{{ $searchRoute }}"
/>
@elseif ($hideSearchString && (! $hideBulkAction))
<x-index.search
bulk-action="{{ $bulkActionClass }}"
route="{{ $searchRoute }}"
/>
@endif
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
@if (! $hideBulkAction)
<x-table.th class="{{ $classBulkAction }}" override="class">
<x-index.bulkaction.all />
</x-table.th>
@endif
@stack('name_and_tax_number_th_start')
@if ((! $hideName) || (! $hideTaxNumber))
<x-table.th class="{{ $classNameAndTaxNumber }}">
@stack('name_th_start')
@if (! $hideName)
<x-slot name="first">
<x-sortablelink column="name" title="{{ trans($textName) }}" />
</x-slot>
@endif
@stack('name_th_end')
@stack('tax_number_th_start')
@if (! $hideTaxNumber)
<x-slot name="second">
<x-sortablelink column="tax_number" title="{{ trans($textTaxNumber) }}" />
</x-slot>
@endif
@stack('tax_number_th_end')
</x-table.th>
@endif
@stack('name_and_tax_number_th_end')
@stack('email_and_phone_th_start')
@if ((! $hideEmail) || (! $hidePhone))
<x-table.th class="{{ $classEmailAndPhone }}">
@stack('email_th_start')
@if (! $hideEmail)
<x-slot name="first">
<x-sortablelink column="email" title="{{ trans($textEmail) }}" />
</x-slot>
@endif
@stack('email_th_end')
@stack('phone_th_start')
@if (! $hidePhone)
<x-slot name="second">
<x-sortablelink column="phone" title="{{ trans($textPhone) }}" />
</x-slot>
@endif
@stack('phone_th_end')
</x-table.th>
@endif
@stack('email_and_phone_th_end')
@stack('country_and_currency_code_th_start')
@if ((! $hideCountry) || (! $hideCurrencyCode))
<x-table.th class="{{ $classCountryAndCurrencyCode }}">
@stack('country_th_start')
@if (! $hideCountry)
<x-slot name="first">
<x-sortablelink column="country" title="{{ trans_choice($textCountry, 1) }}" />
</x-slot>
@endif
@stack('country_th_end')
@stack('currency_code_th_start')
@if (! $hideCurrencyCode)
<x-slot name="second">
<x-sortablelink column="currency_code" title="{{ trans_choice($textCurrencyCode, 1) }}" />
</x-slot>
@endif
@stack('currency_code_th_end')
</x-table.th>
@endif
@stack('country_and_currency_code_th_end')
@stack('open_and_overdue_th_start')
@if ((! $hideOpen) || (! $hideOverdue))
<x-table.th class="{{ $classOpenAndOverdue }}" kind="amount">
@stack('open_th_start')
@if (! $hideOpen)
<x-slot name="first">
{{ trans($textOpen) }}
</x-slot>
@endif
@stack('open_th_end')
@stack('overdue_th_start')
@if (! $hideOverdue)
<x-slot name="second">
{{ trans($textOverdue) }}
</x-slot>
@endif
@stack('overdue_th_end')
</x-table.th>
@endif
@stack('open_and_overdue_th_end')
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($contacts as $item)
<x-table.tr href="{{ route($routeButtonShow, $item->id) }}">
@if (! $hideBulkAction)
<x-table.td class="{{ $classBulkAction }}" override="class">
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
</x-table.td>
@endif
@stack('name_and_tax_number_td_start')
@if ((! $hideName) || (! $hideTaxNumber))
<x-table.td class="{{ $classNameAndTaxNumber }}">
@stack('name_td_start')
@if (! $hideName)
<x-slot name="first" class="flex items-center font-medium">
@if ($showPicture)
@if (is_object($item->picture))
<img src="{{ Storage::url($item->picture->id) }}" class="absolute w-6 h-6 bottom-6 rounded-full mr-2 hidden lg:block" alt="{{ $item->name }}" title="{{ $item->name }}">
@else
<img src="{{ asset('public/img/user.svg') }}" class="absolute w-6 h-6 bottom-6 rounded-full mr-2 hidden lg:block" alt="{{ $item->name }}"/>
@endif
@endif
<div class="truncate {{ $showPicture ? ' ltr:pl-8 rtl:pr-8' : '' }}">
{{ $item->name }}
</div>
@if (! $item->enabled)
<x-index.disable text="{{ trans_choice($textPage, 1) }}" />
@endif
</x-slot>
@endif
@stack('name_td_end')
@stack('tax_number_td_start')
@if (! $hideTaxNumber)
<x-slot name="second" class="w-32 font-normal truncate {{ $showPicture ? ' ltr:pl-8 rtl:pr-8' : '' }}">
{{ $item->tax_number }}
</x-slot>
@endif
@stack('tax_number_td_end')
</x-table.td>
@endif
@stack('name_and_tax_number_td_end')
@stack('email_and_phone_td_start')
@if ((! $hideEmail) || (! $hidePhone))
<x-table.td class="{{ $classEmailAndPhone }}">
@stack('email_td_start')
@if (! $hideEmail)
<x-slot name="first">
@if ($item->email)
{{ $item->email }}
@else
<x-empty-data />
@endif
</x-slot>
@endif
@stack('email_td_end')
@stack('phone_td_start')
@if (! $hidePhone)
<x-slot name="second">
{{ $item->phone }}
</x-slot>
@endif
@stack('phone_td_end')
</x-table.td>
@endif
@stack('email_and_phone_td_end')
@stack('country_and_currency_code_td_start')
@if ((! $hideCountry) || (! $hideCurrencyCode))
<x-table.td class="{{ $classCountryAndCurrencyCode }}">
@stack('country_td_start')
@if (! $hideCountry)
<x-slot name="first">
<x-index.country code="{{ $item->country }}" />
</x-slot>
@endif
@stack('country_td_end')
@stack('currency_code_td_start')
@if (! $hideCurrencyCode)
<x-slot name="second">
<x-index.currency code="{{ $item->currency_code }}" />
</x-slot>
@endif
@stack('currency_code_td_end')
</x-table.td>
@endif
@stack('country_and_currency_code_td_end')
@stack('open_and_overdue_td_start')
@if ((! $hideOpen) || (! $hideOverdue))
<x-table.td class="{{ $classOpenAndOverdue }}" kind="amount">
@stack('open_td_start')
@if (! $hideOpen)
<x-slot name="first">
@if ($item->open)
<x-money :amount="$item->open" :currency="setting('default.currency')" convert />
@else
<x-empty-data />
@endif
</x-slot>
@endif
@stack('open_td_end')
@stack('overdue_td_start')
@if (! $hideOverdue)
<x-slot name="second">
@if ($item->overdue)
<x-money :amount="$item->overdue" :currency="setting('default.currency')" convert />
@else
<x-empty-data />
@endif
</x-slot>
@endif
@stack('overdue_td_end')
</x-table.td>
@endif
@stack('open_and_overdue_td_end')
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$contacts" />
</x-index.container>
@else
<x-empty-page
group="{{ $group }}"
page="{{ $page }}"
image-empty-page="{{ $imageEmptyPage }}"
text-empty-page="{{ $textEmptyPage }}"
url-docs-path="{{ $urlDocsPath }}"
create-route="{{ $createRoute }}"
check-permission-create="{{ $checkPermissionCreate }}"
permission-create="{{ $permissionCreate }}"
/>
@endif

View File

@ -0,0 +1,27 @@
<x-dropdown id="dropdown-more-actions">
<x-slot name="trigger">
<span class="material-icons">more_horiz</span>
</x-slot>
@if ($checkPermissionCreate)
@can($permissionCreate)
@if (! $hideImport)
<x-dropdown.link href="{{ route($importRoute, $importRouteParameters) }}">
{{ trans('import.import') }}
</x-dropdown.link>
@endif
@endcan
@else
@if (! $hideImport)
<x-dropdown.link href="{{ route($importRoute, $importRouteParameters) }}">
{{ trans('import.import') }}
</x-dropdown.link>
@endif
@endif
@if (! $hideExport)
<x-dropdown.link href="{{ route($exportRoute, request()->input()) }}">
{{ trans('general.export') }}
</x-dropdown.link>
@endif
</x-dropdown>

View File

@ -0,0 +1,13 @@
@push('scripts_start')
<script type="text/javascript">
var contact_default_currency = '{{ $currency_code }}';
var contact_currencies = {!! $currencies !!};
var can_login_errors = {
valid: '{!! trans("validation.required", ["attribute" => "email"]) !!}',
email: '{!! trans("customers.error.email") !!}'
};
</script>
@endpush
<x-script :alias="$alias" :folder="$folder" :file="$file" />

View File

@ -0,0 +1,44 @@
@stack('new_button_start')
@if (! $hideNewDropdown)
<x-dropdown id="customer-new">
<x-slot name="trigger" class="flex items-center px-3 py-1.5 mb-3 sm:mb-0 bg-green hover:bg-green-700 rounded-xl text-white text-sm font-bold leading-6" override="class">
{{ trans('general.new_more') }}
<span class="material-icons ltr:ml-2 rtl:mr-2">expand_more</span>
</x-slot>
@stack('document_button_start')
@if (! $hideButtonDocument)
@can($permissionCreateDocument)
<x-dropdown.link href="{{ route($routeButtonDocument, $contact->id) }}">
{{ trans_choice($textDocument, 1) }}
</x-dropdown.link>
@endcan
@endif
@stack('transaction_button_start')
@if (! $hideButtonTransaction)
@can($permissionCreateTransaction)
<x-dropdown.link href="{{ route($routeButtonTransaction, $contact->id) }}">
{{ trans_choice($textTransaction, 1) }}
</x-dropdown.link>
@endcan
@endif
@stack('transaction_button_end')
</x-dropdown>
@endif
@stack('edit_button_start')
@if (! $hideButtonEdit)
@can($permissionUpdate)
<x-link href="{{ route($routeButtonEdit, $contact->id) }}">
{{ trans('general.edit') }}
</x-link>
@endcan
@endif
@stack('edit_button_end')

View File

@ -0,0 +1,355 @@
<x-show.container>
<x-show.summary>
@stack('profile_start')
@if (! $hideTopLeft)
<x-show.summary.left>
@if (! $hideAvatar)
<x-slot name="avatar">
{{ $contact->initials }}
</x-slot>
@endif
@stack('contact_email_start')
@if (! $hideEmail)
<span>{{ $contact->email }}</span>
@endif
@stack('contact_email_end')
@stack('contact_phone_start')
@if (! $hidePhone)
<span>{{ $contact->phone }}</span>
@endif
@stack('contact_phone_end')
</x-show.summary.left>
@endif
@stack('profile_end')
@if (! $hideTopRight)
<x-show.summary.right>
@stack('summary_overdue_start')
@if (! $hideOverdue)
<x-slot name="first" amount="{{ money($totals['overdue'], setting('default.currency'), true) }}" title="{{ trans('general.overdue') }}"></x-slot>
@endif
@stack('summary_overdue_end')
@stack('summary_open_start')
@if (! $hideOpen)
<x-slot name="second" amount="{{ money($totals['open'], setting('default.currency'), true) }}" title="{{ trans('general.open') }}"></x-slot>
@endif
@stack('summary_open_end')
@stack('summary_paid_start')
@if (! $hidePaid)
<x-slot name="third" amount="{{ money($totals['paid'], setting('default.currency'), true) }}" title="{{ trans('general.paid') }}"></x-slot>
@endif
@stack('summary_paid_end')
</x-show.summary.right>
@endif
</x-show.summary>
<x-show.content>
@if (! $hideBottomLeft)
<x-show.content.left>
@stack('customer_address_start')
@if (! $hideAddress)
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">{{ trans('general.address') }}</div>
<span>{{ $contact->address }}<br>{{ $contact->location }}</span>
</div>
@endif
@stack('customer_address_end')
@stack('customer_tax_number_start')
@if (! $hideTaxNumber)
@if ($contact->tax_number)
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">{{ trans('general.tax_number') }}</div>
<span>{{ $contact->tax_number }}</span>
</div>
@endif
@endif
@stack('customer_tax_number_end')
@stack('customer_website_start')
@if (! $hideWebsite)
@if ($contact->website)
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">{{ trans('general.website') }}</div>
<span>{{ $contact->website }}</span>
</div>
@endif
@endif
@stack('customer_website_end')
@stack('customer_reference_start')
@if (! $hideReference)
@if ($contact->reference)
<div class="flex flex-col text-sm mb-5">
<div class="font-medium">{{ trans('general.reference') }}</div>
<span>{{ $contact->reference }}</span>
</div>
@endif
@endif
@stack('customer_reference_end')
@stack('customer_client_portal_start')
@if (! $hideUser)
<div class="flex flex-col text-sm mb-5">
<div class="flex items-center font-medium">
<div class="flex items-center cursor-default">
<div data-tooltip-target="tooltip-client-describe" data-tooltip-placement="bottom">
{{ trans('general.client_portal') }}
</div>
@if ($contact->user)
<span data-tooltip-target="tooltip-client-permission" data-tooltip-placement="bottom" class="material-icons text-green text-base ltr:ml-1 rtl:mr-1">check</span>
@else
<span data-tooltip-target="tooltip-client-permission" data-tooltip-placement="bottom" class="material-icons-round text-red text-sm ltr:ml-1 rtl:mr-1">hide_source</span>
@endif
<div id="tooltip-client-describe" role="tooltip" class="w-2/12 inline-block absolute invisible z-20 py-1 px-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 whitespace-normal tooltip-content">
{{ trans('customers.client_portal_description') }}
<div class="absolute w-2 h-2 -top-1 -left-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-white before:border-gray-200 before:transform before:rotate-45 before:border before:border-b-0 before:border-r-0" data-popper-arrow></div>
</div>
<div id="tooltip-client-permission" role="tooltip" class="inline-block absolute invisible z-20 py-1 px-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 whitespace-nowrap tooltip-content">
@if ($contact->user)
{{ trans('customers.client_portal_text.can') }}
@else
{{ trans('customers.client_portal_text.cant') }}
@endif
<div class="absolute w-2 h-2 -top-1 -left-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-white before:border-gray-200 before:transform before:rotate-45 before:border before:border-b-0 before:border-r-0" data-popper-arrow></div>
</div>
</div>
</div>
</div>
@endif
@stack('customer_client_portal_end')
</x-show.content.left>
@endif
@if (! $hideBottomRight)
<x-show.content.right>
<x-tabs active="documents">
<x-slot name="navs">
@stack('documents_nav_start')
<x-tabs.nav
id="documents"
name="{{ trans_choice($textDocument, 2) }}"
active
class="relative px-8 text-sm text-black text-center pb-2 cursor-pointer transition-all border-b tabs-link"
/>
@stack('transactions_nav_start')
<x-tabs.nav
id="transactions"
name="{{ trans_choice('general.transactions', 2) }}"
class="relative px-8 text-sm text-black text-center pb-2 cursor-pointer transition-all border-b tabs-link"
/>
@stack('transactions_nav_end')
</x-slot>
<x-slot name="content">
@stack('documents_tab_start')
<x-tabs.tab id="documents">
@if ($documents->count())
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="w-4/12 table-title hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="due_at" title="{{ trans('invoices.due_date') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="issued_at" title="{{ trans('invoices.invoice_date') }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-3/12 table-title hidden sm:table-cell">
<x-sortablelink column="status" title="{{ trans_choice('general.statuses', 1) }}" />
</x-table.th>
<x-table.th class="w-6/12 sm:w-3/12 table-title'">
<x-slot name="first">
<x-sortablelink column="contact_name" title="{{ trans_choice('general.customers', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="document_number" title="{{ trans_choice('general.numbers', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-6/12 sm:w-2/12 ltr:pl-6 rtl:pr-6 py-3 ltr:text-right rtl:text-left text-sm font-medium text-black tracking-wider" override="class">
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($documents as $item)
@php $paid = $item->paid; @endphp
<x-table.tr href="{{ route(config('type.document.' . $item->type . '.route.prefix', 'invoices') . '.show', $item->id) }}">
<x-table.td class="w-4/12 table-title hidden sm:table-cell">
<x-slot name="first" class="font-bold truncate" override="class">
{{ \Date::parse($item->due_at)->diffForHumans() }}
</x-slot>
<x-slot name="second">
<x-date date="{{ $item->issued_at }}" />
</x-slot>
</x-table.td>
<x-table.td class="w-3/12 table-title hidden sm:table-cell">
<x-show.status status="{{ $item->status }}" background-color="bg-{{ $item->status_label }}" text-color="text-text-{{ $item->status_label }}" />
</x-table.td>
<x-table.td class="w-6/12 sm:w-3/12 table-title'">
<x-slot name="first">
{{ $item->contact_name }}
</x-slot>
<x-slot name="second" class="relative w-20 font-normal group" data-tooltip-target="tooltip-information-{{ $item->id }}" data-tooltip-placement="left" override="class,data-tooltip-target,data-tooltip-placement">
<span class="border-black border-b border-dashed">
{{ $item->document_number }}
</span>
<div class="w-full absolute h-10 -left-10 -mt-6"></div>
<x-documents.index.information :document="$item" />
</x-slot>
</x-table.td>
<x-table.td class="w-6/12 sm:w-2/12 ltr:pl-6 rtl:pr-6 py-3 ltr:text-right rtl:text-left text-sm font-medium text-black tracking-wider" override="class">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$documents" />
@else
<x-show.no-records type="{{ $type }}" :model="$contact" :group="config('type.contact.' . $type . '.group')" :page="\Str::plural(config('type.contact.' . $type . '.document_type'))" />
@endif
</x-tabs.tab>
@stack('transactions_tab_start')
<x-tabs.tab id="transactions">
@if ($transactions->count())
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="paid_at" title="{{ trans('general.date') }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="number" title="{{ trans_choice('general.numbers', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="type" title="{{ trans_choice('general.types', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-sortablelink column="account.name" title="{{ trans_choice('general.accounts', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
<x-sortablelink column="contact.name" title="{{ trans_choice('general.contacts', 1) }}" />
</x-slot>
<x-slot name="second">
<x-sortablelink column="document.document_number" title="{{ trans_choice('general.documents', 1) }}" />
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-2/12 ltr:pl-6 rtl:pr-6 py-3 ltr:text-right rtl:text-left text-xs font-medium text-black tracking-wider" override="class">
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($transactions as $item)
<x-table.tr href="{{ route('transactions.show', $item->id) }}">
<x-table.td class="w-4/12 sm:w-3/12">
<x-slot name="first" class="font-bold truncate" override="class">
<x-date date="{{ $item->paid_at }}" />
</x-slot>
<x-slot name="second">
{{ $item->number }}
</x-slot>
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ $item->type_title }}
</x-slot>
<x-slot name="second" class="flex items-center">
<x-index.category :model="$item->category" />
</x-slot>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12">
{{ $item->account->name }}
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ $item->contact->name }}
</x-slot>
<x-slot name="second">
@if ($item->document)
<a href="{{ route($item->route_name, $item->route_id) }}" class="font-normal truncate border-b border-black border-dashed">
{{ $item->document->document_number }}
</a>
@else
<x-empty-data />
@endif
</x-slot>
</x-table.td>
<x-table.td class="relative w-4/12 sm:w-2/12 ltr:pl-6 rtl:pr-6 py-3 ltr:text-right rtl:text-left text-sm font-normal text-black tracking-wider" override="class">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$transactions" />
@else
<x-show.no-records type="{{ $type }}" :model="$contact" group="banking" page="transactions" />
@endif
</x-tabs.tab>
@stack('transactions_tab_end')
</x-slot>
</x-tabs>
</x-show.content.right>
@endif
</x-show.content>
</x-show.container>

View File

@ -0,0 +1,33 @@
@stack('button_group_start')
@if (! $hideActionsDropdown)
<x-dropdown id="dropdown-more-actions">
<x-slot name="trigger">
<span class="material-icons">more_horiz</span>
</x-slot>
@stack('delete_button_start')
@if (! $hideButtonDuplicate)
@can($permissionCreate)
<x-dropdown.link href="{{ route($routeButtonDuplicate, $contact->id) }}">
{{ trans('general.duplicate') }}
</x-dropdown.link>
@endcan
@endif
<x-dropdown.divider />
@stack('delete_button_start')
@if (! $hideButtonDelete)
@can($permissionDelete)
<x-delete-link :model="$contact" :route="$routeButtonDelete" :text="$textDeleteModal" />
@endcan
@endif
@stack('delete_button_end')
</x-dropdown>
@endif
@stack('button_group_end')

View File

@ -0,0 +1 @@
{!! $date !!}

View File

@ -0,0 +1,27 @@
<x-button
type="button"
class="relative bg-white hover:bg-gray-100 border py-0.5 px-1 cursor-pointer index-actions"
@click="onDeleteViaConfirmation('delete-{{ $modelTable }}-{{ $id }}')"
override="class"
>
@if ($slot->isNotEmpty())
{!! $slot !!}
@else
<span class="material-icons-outlined text-purple text-lg">delete</span>
<div class="inline-block absolute invisible z-10 py-1 px-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 whitespace-nowrap tooltip-content -top-10 -left-2" data-tooltip-placement="top">
<span>{!! $label !!}</span>
<div class="absolute w-2 h-2 -bottom-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-white before:border-gray-200 before:transform before:rotate-45 before:border before:border-t-0 before:border-l-0" data-popper-arrow></div>
</div>
@endif
<x-form.input.hidden
name="delete-{{ $modelTable }}-{{ $id }}"
id="delete-{{ $modelTable }}-{{ $id }}"
data-field="delete"
data-action="{{ $action }}"
data-title="{!! $title !!}"
data-message="{!! $message !!}"
data-cancel="{!! $cancelText !!}"
data-delete="{!! $deleteText !!}"
/>
</x-button>

View File

@ -0,0 +1,25 @@
<x-button
type="button"
class="{{ $class }}"
@click="onDeleteViaConfirmation('delete-{{ $modelTable }}-{{ $id }}')"
override="class"
>
<span class="{{ $textClass }}">
@if ($slot->isNotEmpty())
{!! $slot !!}
@else
{!! $label !!}
@endif
</span>
<x-form.input.hidden
name="delete-{{ $modelTable }}-{{ $id }}"
id="delete-{{ $modelTable }}-{{ $id }}"
data-field="delete"
data-action="{{ $action }}"
data-title="{!! $title !!}"
data-message="{!! $message !!}"
data-cancel="{!! $cancelText !!}"
data-delete="{!! $deleteText !!}"
/>
</x-button>

View File

@ -1,43 +1,38 @@
<div class="accordion">
<div class="card border-1 box-shadow-none">
<div class="card-header background-none collapsed" id="accordion-recurring-and-more-header" data-toggle="collapse" data-target="#accordion-recurring-and-more-body" aria-expanded="false" aria-controls="accordion-recurring-and-more-body">
<h4 class="mb-0">{{ trans($textAdvancedAccordion) }}</h4>
</div>
<x-form.accordion type="advanced">
<x-slot name="head">
<x-form.accordion.head
title="{{ trans_choice($textSectionAdvancedTitle, 1) }}"
description="{{ trans($textSectionAdvancedDescription, ['type' => $type]) }}"
/>
</x-slot>
<div id="accordion-recurring-and-more-body" class="collapse hide" aria-labelledby="accordion-recurring-and-more-header">
<div class="card-body">
<div class="row">
@stack('recurring_row_start')
@if (!$hideRecurring)
<div class="{{ $recurring_class }}">
@if (!empty($document))
{{ Form::recurring('edit', $document, 'col-md-12') }}
@else
{{ Form::recurring('create', null, 'col-md-12') }}
@endif
</div>
@endif
@stack('recurring_row_end')
<x-slot name="body">
@stack('footer_start')
@stack('more_row_start')
@if (!$hideCategory)
<div class="{{ $more_class }}">
@if (!$hideCategory)
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $document->category_id ?? setting('default.' . $categoryType . '_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=' . $categoryType, 'remote_action' => route('categories.index'). '?search=type:' . $categoryType . ' enabled:1'], $more_form_class) }}
@endif
</div>
@else
{{ Form::hidden('category_id', $document->category_id ?? setting('default.' . $categoryType . '_category')) }}
@endif
@stack('more_row_end')
@if (!$hideAttachment)
<div class="col-md-12">
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], !empty($document) ? $document->attachment : null , 'col-md-12') }}
</div>
@endif
</div>
@if (! $hideFooter)
<div class="{{ $classFooter }}">
<x-form.group.textarea name="footer" label="{{ trans('general.footer') }}" :value="$footer" not-required rows="7" />
</div>
@endif
<div class="sm:col-span-4 grid gap-x-8 gap-y-1">
@stack('category_start')
@if (! $hideCategory)
<div class="{{ $classCategory }}">
<x-form.group.category :type="$typeCategory" :selected="$categoryId" />
</div>
@else
<x-form.input.hidden name="category_id" :value="$categoryId" />
@endif
@stack('attachment_end')
@if (! $hideAttachment)
<div class="{{ $classAttachment }}">
<x-form.group.attachment />
</div>
@endif
</div>
</div>
</div>
</x-slot>
</x-form.accordion>

View File

@ -1,7 +1,16 @@
<div class="card">
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons($routeCancel) }}
</div>
<x-form.section>
<x-slot name="foot">
<div class="flex justify-end">
<x-form.buttons cancel-route="{{ $cancelRoute }}" />
@if (! $hideSendTo)
<x-button
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 ltr:ml-2 rtl:mr-2 text-base rounded-lg disabled:bg-green-100"
override="class"
>
{{ trans('general.send_to') }}
</x-button>
@endif
</div>
</div>
</x-slot>
</x-form.section>

View File

@ -1,51 +1,53 @@
<div class="accordion">
<div class="card border-1 box-shadow-none">
<div class="card-header background-none collapsed" id="accordion-company-header" data-toggle="collapse" data-target="#accordion-company-body" aria-expanded="false" aria-controls="accordion-company-body">
<h4 class="mb-0">{{ trans_choice('general.companies', 1) }}</h4>
<x-form.accordion type="company">
<x-slot name="head">
<x-form.accordion.head
title="{{ trans_choice($textSectionCompaniesTitle, 1) }}"
description="{{ trans($textSectionCompaniesDescription) }}"
/>
</x-slot>
<x-slot name="body">
<div class="sm:col-span-2 grid gap-x-8 gap-y-6">
@if (! $hideDocumentTitle)
<x-form.group.text name="title" label="{{ trans('settings.invoice.title') }}" value="{{ $titleSetting }}" not-required data-field="setting" />
@endif
@if (! $hideDocumentSubheading)
<x-form.group.text name="subheading" label="{{ trans('settings.invoice.subheading') }}" value="{{ $subheadingSetting }}" not-required data-field="setting" />
@endif
</div>
<div id="accordion-company-body" class="collapse hide" aria-labelledby="accordion-company-header">
<div class="card-body">
<div class="row">
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideLogo)
{{ Form::fileGroup('company_logo', trans('settings.company.logo'), 'file-image-o', ['data-field' => 'setting'], setting('company.logo')) }}
@endif
</div>
<div class="sm:col-span-1"></div>
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideDocumentTitle)
{{ Form::textGroup('title', trans('settings.invoice.title'), 'font', ['data-field' => 'setting'], $titleSetting, 'col-md-12') }}
@endif
@if (!$hideDocumentSubheading)
{{ Form::textGroup('subheading', trans('settings.invoice.subheading'), 'font', ['data-field' => 'setting'], $subheadingSetting, 'col-md-12') }}
@endif
@if (!$hideCompanyEdit)
<akaunting-company-edit company-id="{{ company_id() }}"
button-text="{{ trans('settings.company.edit_your_business_address') }}"
tax-number-text="{{ trans('general.tax_number') }}"
:company="{{ json_encode($company) }}"
:company-form="{{ json_encode([
'show' => true,
'text' => trans('settings.company.edit_your_business_address'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
]
])}}"
></akaunting-company-edit>
@endif
</div>
</div>
</div>
<div class="sm:col-span-2">
@if (! $hideLogo)
<x-form.group.file name="company_logo" label="{{ trans('settings.company.logo') }}" :value="setting('company.logo')" not-required data-field="setting" />
@endif
</div>
</div>
</div>
<div class="sm:col-span-2 relative">
@if (! $hideCompanyEdit)
<akaunting-company-edit
company-id="{{ company_id() }}"
button-text="{{ trans('settings.company.edit_your_business_address') }}"
tax-number-text="{{ trans('general.tax_number') }}"
:company="{{ json_encode($company) }}"
:company-form="{{ json_encode([
'show' => true,
'text' => trans('settings.company.edit_your_business_address'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'disabled:bg-green-100'
]
]
])}}"
></akaunting-company-edit>
@endif
</div>
</x-slot>
</x-form.accordion>

View File

@ -23,7 +23,7 @@
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
'class' => 'disabled:bg-green-100'
]
]
])}}"

View File

@ -1,105 +1,31 @@
@if (empty($document))
{!! Form::open([
'route' => $routeStore,
'id' => $formId,
'@submit.prevent' => $formSubmit,
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
@else
{!! Form::model($document, [
'route' => [$routeUpdate, $document->id],
'id' => $formId,
'method' => 'PATCH',
'@submit.prevent' => $formSubmit,
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
@endif
@if (!$hideCompany)
<x-documents.form.company
type="{{ $type }}"
hide-logo="{{ $hideLogo }}"
hide-document-title="{{ $hideDocumentTitle }}"
hide-document-subheading="{{ $hideDocumentSubheading }}"
hide-company-edit="{{ $hideCompanyEdit }}"
title-setting="{{ $titleSetting }}"
/>
<x-loading.content />
<div class="relative mt-4">
<x-form
id="{{ $formId }}"
:route="$formRoute"
method="{{ $formMethod }}"
:model="$contact"
>
@if (! $hideCompany)
<x-documents.form.company :type="$type" />
@endif
<x-documents.form.main
type="{{ $type }}"
:document="$document"
hide-contact="{{ $hideContact }}"
contact-type="{{ $contactType }}"
:contact="$contact"
:contacts="$contacts"
:search-route="$contactSearchRoute"
:create-route="$contactCreateRoute"
hide-issued-at="{{ $hideIssuedAt }}"
text-issued-at="{{ $textIssuedAt }}"
issued-at="{{ $issuedAt }}"
hide-document-number="{{ $hideDocumentNumber }}"
text-document-number="{{ $textDocumentNumber }}"
document-number="{{ $documentNumber }}"
hide-due-at="{{ $hideDueAt }}"
text-due-at="{{ $textDueAt }}"
due-at="{{ $dueAt }}"
hide-order-number="{{ $hideOrderNumber }}"
text-order-number="{{ $textOrderNumber }}"
order-number="{{ $orderNumber }}"
hide-edit-item-columns="{{ $hideEditItemColumns }}"
hide-items="{{ $hideItems }}"
hide-name="{{ $hideName }}"
hide-description="{{ $hideDescription }}"
text-items="{{ $textItems }}"
hide-quantity="{{ $hideQuantity }}"
text-quantity="{{ $textQuantity }}"
hide-price="{{ $hidePrice }}"
text-price="{{ $textPrice }}"
hide-discount="{{ $hideDiscount }}"
hide-amount="{{ $hideAmount }}"
text-amount="{{ $textAmount }}"
is-sale-price="{{ $isSalePrice }}"
is-purchase-price="{{ $isPurchasePrice }}"
search-char-limit="{{ $searchCharLimit }}"
notes-setting="{{ $notesSetting }}"
/>
<x-documents.form.main type="{{ $type }}" />
@if (!$hideFooter)
<x-documents.form.footer
type="{{ $type }}"
:document="$document"
footer-setting="{{ $footerSetting }}"
/>
@if ($showRecurring)
<x-documents.form.recurring type="{{ $type }}" />
@endif
@if (!$hideAdvanced)
<x-documents.form.advanced
type="{{ $type }}"
:document="$document"
category-type="{{ $categoryType }}"
hide-recurring="{{ $hideRecurring }}"
hide-category="{{ $hideCategory }}"
hide-attachment="{{ $hideAttachment }}"
/>
@if (! $hideAdvanced)
<x-documents.form.advanced type="{{ $type }}" />
@endif
@if (!$hideButtons)
<x-documents.form.buttons
type="{{ $type }}"
:document="$document"
route-cancel="{{ $routeCancel }}"
/>
@endif
<x-form.input.hidden name="type" :value="old('type', $type)" v-model="form.type" />
<x-form.input.hidden name="status" :value="old('status', $status)" v-model="form.status" />
<x-form.input.hidden name="amount" :value="old('amount', '0')" v-model="form.amount" />
{{ Form::hidden('type', old('type', $type), ['id' => 'type', 'v-model' => 'form.type']) }}
{{ Form::hidden('status', old('status', $status), ['id' => 'status', 'v-model' => 'form.status']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
{!! Form::close() !!}
@if (! $hideButtons)
<x-documents.form.buttons :type="$type" />
@endif
</x-form>
</div>

View File

@ -1,12 +0,0 @@
<div class="accordion">
<div class="card border-1 box-shadow-none">
<div class="card-header background-none collapsed" id="accordion-footer-header" data-toggle="collapse" data-target="#accordion-footer-body" aria-expanded="false" aria-controls="accordion-footer-body">
<h4 class="mb-0">{{ trans('general.footer') }}</h4>
</div>
<div id="accordion-footer-body" class="collapse hide" aria-labelledby="accordion-footer-header">
{{ Form::textareaGroup('footer', '', '', $footerSetting, ['rows' => '3'], 'embed-acoordion-textarea') }}
</div>
</div>
</div>

View File

@ -7,12 +7,12 @@
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
'class' => 'btn-outline-secondary',
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
'class' => 'disabled:bg-green-100',
]
]
])}}"
></akaunting-edit-item-columns>
]) }}"
></akaunting-edit-item-columns>

View File

@ -1,86 +1,106 @@
<div class="row document-item-body">
<div class="col-sm-12 p-0" style="table-layout: fixed;">
@if (!$hideEditItemColumns)
<x-edit-item-columns :type="$type" />
@endif
<div class="table-responsive overflow-x-scroll overflow-y-hidden">
<table class="table" id="items" style="table-layout: fixed">
<div class="relative sm:col-span-6">
<div style="table-layout: fixed;">
<div class="overflow-x-visible overflow-y-hidden">
<table class="small-table-width" id="items">
<colgroup>
<col class="document-item-40-px">
<col class="document-item-25">
<col class="document-item-30 description">
<col class="document-item-10">
<col class="document-item-10">
<col class="document-item-20">
<col class="document-item-40-px">
<col class="small-col" style="width: 24px;">
<col class="small-col" style="width: 20%;">
<col class="small-col" style="width: 30%;">
<col class="small-col" style="width: 12%;">
<col class="small-col" style="width: 15%;">
<col class="small-col" style="width: 20%;">
<col class="small-col" style="width: 24px;">
</colgroup>
<thead class="thead-light">
<thead class="border-b">
<tr>
@stack('move_th_start')
<th class="border-top-0 border-right-0 border-bottom-0" style="max-width: 40px">
<div></div>
</th>
<th class="text-left border-t-0 border-r-0 border-b-0" style="vertical-align:bottom;">
@if (! $hideEditItemColumns)
<x-documents.form.item-columns :type="$type" />
@endif
</th>
@stack('move_th_end')
@if (!$hideItems)
@if (! $hideItems)
@stack('name_th_start')
<th class="text-left border-top-0 border-right-0 border-bottom-0">
{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}
@if (! $hideItemName)
<th class="px-3 py-1 ltr:pl-2 rtl:pr-2 ltr:text-left rtl:text-right text-xs font-normal border-t-0 border-r-0 border-b-0" style="vertical-align:bottom;">
{{ (trans_choice($textItemName, 2) != $textItemName) ? trans_choice($textItemName, 2) : trans($textItemName) }}
</th>
@endif
@stack('name_th_end')
@stack('move_th_start')
<th class="text-left border-top-0 border-right-0 border-bottom-0"></th>
@if (! $hideItemDescription)
<th class="px-3 py-1 text-left text-xs font-normal border-t-0 border-r-0 border-b-0" style=" vertical-align:bottom;">
{{ trans($textItemDescription) }}
</th>
@endif
@stack('move_th_end')
@endif
@stack('quantity_th_start')
<th class="text-center pl-2 border-top-0 border-right-0 border-bottom-0">
@if (!$hideQuantity)
{{ trans($textQuantity) }}
@endif
@if (! $hideItemQuantity)
<th class="px-3 py-1 ltr:text-left rtl:text-right text-xs font-normal border-t-0 border-r-0 border-b-0" style="vertical-align:bottom;">
{{ trans($textItemQuantity) }}
</th>
@endif
@stack('quantity_th_end')
@stack('price_th_start')
<th class="text-right border-top-0 border-right-0 border-bottom-0 pr-1" style="padding-left: 5px;">
@if (!$hidePrice)
{{ trans($textPrice) }}
@endif
@if (! $hideItemPrice)
<th class="px-3 py-1 ltr:text-left rtl:text-right text-xs font-normal border-t-0 border-r-0 border-b-0 pr-1" style="vertical-align:bottom;">
{{ trans($textItemPrice) }}
</th>
@endif
@stack('price_th_end')
@stack('total_th_start')
<th class="text-right border-top-0 border-bottom-0 item-total">
@if (!$hideAmount)
{{ trans($textAmount) }}
@endif
@if (! $hideItemAmount)
<th class="px-3 py-1 ltr:text-right rtl:text-left text-xs font-normal border-t-0 border-b-0 item-total" style="vertical-align:bottom;">
{{ trans($textItemAmount) }}
</th>
@endif
@stack('total_th_end')
@stack('remove_th_start')
<th class="border-top-0 border-right-0 border-bottom-0" style="max-width: 40px">
<div></div>
</th>
<th class="border-t-0 border-r-0 border-b-0" style="vertical-align:bottom;">
<div></div>
</th>
@stack('remove_th_end')
</tr>
</thead>
<tbody id="{{ (!$hideDiscount && in_array(setting('localisation.discount_location', 'total'), ['item', 'both'])) ? 'invoice-item-discount-rows' : 'invoice-item-rows' }}" class="table-padding-05">
@include('components.documents.form.line-item')
<tbody id="{{ (! $hideDiscount && in_array(setting('localisation.discount_location', 'total'), ['item', 'both'])) ? 'invoice-item-discount-rows' : 'invoice-item-rows' }}" class="table-padding-05">
<x-documents.form.line-item :type="$type" />
@stack('add_item_td_start')
<tr id="addItem">
<td class="text-right border-bottom-0 p-0" colspan="7">
<x-select-item-button
type="{{ $type }}"
is-sale="{{ $isSalePrice }}"
is-purchase="{{ $isPurchasePrice }}"
search-char-limit="{{ $searchCharLimit }}"
/>
</td>
</tr>
<tr id="addItem">
<td colspan="7">
<x-documents.form.item-button
type="{{ $type }}"
is-sale="{{ $isSalePrice }}"
is-purchase="{{ $isPurchasePrice }}"
search-char-limit="{{ $searchCharLimit }}"
/>
</td>
</tr>
@stack('add_item_td_end')
</tbody>
</table>

View File

@ -1,320 +1,404 @@
<tr v-for="(row, index) in items"
:index="index">
<tr v-for="(row, index) in items" :index="index">
@stack('name_td_start')
<td class="border-right-0 border-bottom-0 p-0"
:class="[{'has-error': form.errors.has('items.' + index + '.name') }]"
colspan="7">
<table class="w-100">
<colgroup>
<col class="document-item-40-px">
<col class="document-item-25">
<col class="document-item-30 description">
<col class="document-item-10">
<col class="document-item-10">
<col class="document-item-20">
<col class="document-item-40-px">
</colgroup>
<tbody>
<tr>
@stack('move_td_start')
<td class="pl-3 pb-3 align-middle border-bottom-0 move" style="max-width: 40px;" style="color: #8898aa;">
<div>
<i class="fas fa-grip-vertical"></i>
<td class="border-r-0 border-b-0 p-0"
:class="[{'has-error': form.errors.has('items.' + index + '.name') }]"
colspan="7">
<table class="w-full border-b pb-3">
<colgroup>
<col class="small-col" style="width: 24px;">
<col class="small-col" style="width: 20%;">
<col class="small-col" style="width: 30%;">
<col class="small-col" style="width: 12%;">
<col class="small-col" style="width: 15%;">
<col class="small-col" style="width: 20%;">
<col class="small-col" style="width: 24px;">
</colgroup>
<tbody>
<tr>
@stack('move_td_start')
<td class="align-middle border-b-0 move flex items-center justify-center" style="width:24px; height:100px; color: #8898aa;">
<span class="w-6 material-icons">list</span>
</td>
@stack('move_td_end')
@stack('items_td_start')
@if (! $hideItems || (! $hideItemName && ! $hideItemDescription))
@stack('name_td_start')
<td class="px-3 py-3 ltr:pl-2 rtl:pr-2 ltr:text-left rtl:text-right align-middle border-b-0 name">
@if (! $hideItemName)
<span class="flex items-center text-sm" tabindex="0" v-html="row.name" v-if="row.item_id"></span>
<div v-else>
@stack('name_input_start')
<input
type="text"
:ref="'items-' + index + '-name'"
class="form-element mt-0"
:name="'items.' + index + '.name'"
autocomplete="off"
required="required"
data-item="name"
v-model="row.name"
@input="onBindingItemField(index, 'name')"
@change="form.errors.clear('items.' + index + '.name')"
/>
<div class="text-red text-sm mt-1 block"
v-if="form.errors.has('items.' + index + '.name')"
v-html="form.errors.get('items.' + index + '.name')"
></div>
@stack('name_input_end')
</div>
</td>
@stack('move_td_end')
@stack('items_td_start')
@if (!$hideItems || (!$hideName && !$hideDescription))
@stack('name_td_start')
<td class="pb-3 align-middle border-bottom-0 name">
@if (!$hideName)
<span class="aka-text aka-text--body" tabindex="0" v-html="row.name" v-if="row.item_id"></span>
<div v-else>
@stack('name_input_start')
<input
type="text"
:ref="'items-' + index + '-name'"
class="form-control"
:name="'items.' + index + '.name'"
autocomplete="off"
required="required"
data-item="name"
v-model="row.name"
@input="onBindingItemField(index, 'name')"
@change="form.errors.clear('items.' + index + '.name')"/>
<div class="invalid-feedback d-block"
v-if="form.errors.has('items.' + index + '.name')"
v-html="form.errors.get('items.' + index + '.name')">
</div>
@stack('name_input_end')
</div>
@endif
</td>
@stack('name_td_end')
@stack('description_td_start')
<td class="pb-3 border-bottom-0 description">
@if (!$hideDescription)
<textarea
class="form-control"
:ref="'items-' + index + '-description'"
placeholder="{{ trans('items.enter_item_description') }}"
style="height: 46px; overflow: hidden;"
:name="'items.' + index + '.description'"
v-model="row.description"
data-item="description"
resize="none"
@input="onBindingItemField(index, 'description')"
></textarea>
@endif
</td>
@stack('description_td_end')
@endif
@stack('items_td_end')
</td>
@stack('quantity_td_start')
<td class="pb-3 pl-0 pr-2 border-bottom-0 quantity">
@if (!$hideQuantity)
<div>
@stack('quantity_input_start')
<input
type="number"
min="0"
:ref="'items-' + index + '-quantity'"
class="form-control text-center p-0 input-number-disabled"
:name="'items.' + index + '.quantity'"
autocomplete="off"
required="required"
data-item="quantity"
v-model="row.quantity"
@input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.quantity')">
<div class="invalid-feedback d-block"
v-if="form.errors.has('items.' + index + '.quantity')"
v-html="form.errors.get('items.' + index + '.quantity')">
</div>
@stack('quantity_input_end')
@stack('name_td_end')
@stack('description_td_start')
<td class="px-3 py-3 border-b-0 description">
@if (! $hideItemDescription)
<textarea
class="form-element mt-1.5 resize-none"
style="height:42px;"
:ref="'items-' + index + '-description'"
placeholder="{{ trans('items.enter_item_description') }}"
:name="'items.' + index + '.description'"
v-model="row.description"
data-item="description"
resize="none"
@input="onBindingItemField(index, 'description')"
></textarea>
@endif
</td>
@stack('description_td_end')
@endif
@stack('items_td_end')
@stack('quantity_td_start')
<td class="px-3 py-3 border-b-0 quantity">
@if (! $hideItemQuantity)
<div>
@stack('quantity_input_start')
<input
type="number"
min="0"
:ref="'items-' + index + '-quantity'"
class="form-element mt-0 text-right input-number-disabled"
:name="'items.' + index + '.quantity'"
autocomplete="off"
required="required"
data-item="quantity"
v-model="row.quantity"
@input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.quantity')"
/>
<div class="text-red text-sm mt-1 block"
v-if="form.errors.has('items.' + index + '.quantity')"
v-html="form.errors.get('items.' + index + '.quantity')">
</div>
@stack('quantity_input_end')
</div>
@endif
</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="px-3 py-3 pr-1 border-b-0 price">
@if (! $hideItemPrice)
<div>
@stack('price_input_start')
<x-form.input.money
name="price"
value="0"
row-input
data-item="price"
v-model="row.price"
v-error="form.errors.get('items.' + index + '.price')"
v-error-message="form.errors.get('items.' + index + '.price')"
change="row.price = $event; form.errors.clear('items.' + index + '.price'); onCalculateTotal"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right mt-0"
form-group-class="text-right"
/>
@stack('price_input_end')
</div>
@endif
</td>
@stack('price_td_end')
@stack('total_td_start')
<td class="px-3 py-3 text-right border-b-0 total">
@if (! $hideItemAmount)
<div>
<x-form.input.money
name="total"
value="0"
disabled
row-input
data-item="total"
v-model="row.total"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right mt-0 disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
@endif
</td>
@stack('total_td_end')
@stack('delete_td_start')
<td class="text-right group">
<button type="button" @click="onDeleteItem(index)" class="btn btn-link btn-delete w-6 h-7 flex items-center rounded-lg p-0 group-hover:bg-gray-100">
<span class="w-full material-icons-outlined text-lg text-gray-300 group-hover:text-gray-500">delete</span>
</button>
</td>
@stack('delete_td_end')
</tr>
<tr>
<td colspan="3">
@stack('item_custom_fields')
</td>
<td colspan="4" class="px-0 pb-3">
<div class="relative">
<div class="absolute -top-6 left-3 flex items-center">
@if (! $hideDiscount && in_array(setting('localisation.discount_location'), ['item', 'both']))
<div class="text-left border-0 p-0 mr-16" v-if="!row.add_discount">
<button type="button" class="text-xs text-purple" @click="onAddLineDiscount(index)">
<span class="border-b border-transparent transition-all hover:border-purple">
{{ trans('general.title.add', ['type' => trans('invoices.discount')]) }}
</span>
</button>
</div>
@endif
</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="pb-3 pl-0 pr-0 border-bottom-0 price" style="padding-right: 5px; padding-left: 5px;">
@if (!$hidePrice)
<div>
@stack('price_input_start')
{{ Form::moneyGroup('price', '', '', ['required' => 'required', 'row-input' => 'true', 'v-model' => 'row.price', 'v-error' => 'form.errors.get(\'items.\' + index + \'.price\')', 'v-error-message' => 'form.errors.get(\'items.\' + index + \'.price\')' , 'data-item' => 'price', 'currency' => $currency, 'dynamic-currency' => 'currency', 'change' => 'row.price = $event; form.errors.clear(\'items.\' + index + \'.price\'); onCalculateTotal'], 0.00, 'text-right input-price p-0') }}
@stack('price_input_end')
</div>
@endif
</td>
@stack('price_td_end')
@stack('total_td_start')
<td class="text-right long-texts pb-3 border-bottom-0 total">
@if (!$hideAmount)
<div>
{{ Form::moneyGroup('total', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row.total', 'data-item' => 'total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
</div>
@endif
</td>
@stack('total_td_end')
@stack('delete_td_start')
<td class="pb-3 pl-2 align-middle border-bottom-0 delete" style="max-width: 40px;" >
<div>
<button type="button" @click="onDeleteItem(index)" class="btn btn-link btn-delete p-0">
<i class="far fa-trash-alt"></i>
<div class="text-right border-0 p-0 pr-4">
<button type="button" class="text-xs text-purple" @click="onAddTax(index)">
<span class="border-b border-transparent transition-all hover:border-purple">
{{ trans('general.title.add', ['type' => trans_choice('general.taxes', 1)]) }}
</span>
</button>
</div>
</td>
@stack('delete_td_end')
</tr>
<tr>
<td class="border-top-0" colspan="3">
@stack('item_custom_fields')
</td>
<td class="border-top-0 p-0" colspan="4">
@if (!$hideDiscount && in_array(setting('localisation.discount_location'), ['item', 'both']))
<div v-if="!row.add_tax || !row.add_discount" class="line-item-link-container position-relative">
<div v-if="!row.add_tax || !row.add_discount" class="line-item-link position-absolute">
<div class="text-left border-0 p-0 mr-5">
<div>
<button type="button" class="btn btn-link btn-sm p-0" @click="onAddLineDiscount(index)" v-if="!row.add_discount">
{{ trans('general.title.add', ['type' => trans('invoices.discount')]) }}
</div>
</div>
<div v-if="row.add_discount" class="flex items-center justify-between pb-3 ml-2">
@stack('discount_input_start')
<div class="form-group mb-0 w-100" style="display: inline-block; position: relative;">
<div class="flex items-center">
<div class="w-16 flex items-center bg-gray-200 p-1 ltr:mr-2 rtl:ml-2 rounded-lg">
<button type="button"
class="w-7 flex justify-center px-2"
:class="[{'btn-outline-primary' : row.discount_type !== 'percentage'}, {'bg-white rounded-lg' : row.discount_type === 'percentage'}]"
@click="onChangeLineDiscountType(index, 'percentage')"
>
<span class="material-icons text-lg">percent</span>
</button>
<button type="button"
class="w-7 px-2"
:class="[{'btn-outline-primary' : row.discount_type !== 'fixed'}, {'bg-white rounded-lg' : row.discount_type === 'fixed'}]"
@click="onChangeLineDiscountType(index, 'fixed')"
>
<span class="text-base">{{ $currency->symbol }}</span>
</button>
</div>
</div>
<div class="text-right border-0 p-0 pr-4">
<div style="float:left;">
<button type="button" class="btn btn-link btn-sm p-0" @click="onAddTax(index)" v-if="!row.add_tax">
{{ trans('general.title.add', ['type' => trans_choice('general.taxes', 1)]) }}
</button>
<input type="number"
min="0"
placeholder="Discount"
class="form-element text-center mt-0"
:name="'items.' + index + '.discount'"
autocomplete="off"
required="required"
data-item="discount"
v-model="row.discount"
@input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.discount')"
/>
<div class="text-red text-sm mt-1 block"
v-if="form.errors.has('items.' + index + '.discount')"
v-html="form.errors.get('items.' + index + '.discount')">
</div>
</div>
</div>
</div>
<div v-if="row.add_discount" class="line-item-area pb-3">
<div class="line-item-content">
<div class="long-texts line-item-text" style="float: left; margin-top: 15px; position: absolute; left: -65px;">
{{ trans('invoices.discount') }}
</div>
@stack('discount_input_start')
<div class="form-group mb-0 w-100" style="display: inline-block; position: relative;">
<div class="input-group mb-0 select-tax">
<div class="input-group-prepend">
<button class="btn btn-sm" :class="[{'btn-outline-primary' : row.discount_type !== 'percentage'}, {'btn-primary' : row.discount_type === 'percentage'}]"
@click="onChangeLineDiscountType(index, 'percentage')" type="button">
<i class="fa fa-percent fa-sm"></i>
</button>
<button class="btn btn-sm" :class="[{'btn-outline-primary' : row.discount_type !== 'fixed'}, {'btn-primary' : row.discount_type === 'fixed'}]"
@click="onChangeLineDiscountType(index, 'fixed')" type="button">{{ $currency->symbol }}
</button>
</div>
<input type="number"
max="100"
min="0"
class="form-control text-center"
:name="'items.' + index + '.discount'"
autocomplete="off"
required="required"
data-item="discount"
v-model="row.discount"
@input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.discount')">
<div class="invalid-feedback d-block"
v-if="form.errors.has('items.' + index + '.discount')"
v-html="form.errors.get('items.' + index + '.discount')">
</div>
</div>
</div>
@stack('discount_input_end')
</div>
<div class="line-item-content-right">
<div class="line-item-content-right-price long-texts text-right">
{{ Form::moneyGroup('discount_amount', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row.discount_amount', 'data-item' => 'discount_amount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
</div>
<div class="line-item-content-right-delete pl-2">
<button type="button" @click="onDeleteDiscount(index)" class="btn btn-link btn-delete p-0">
<i class="far fa-trash-alt"></i>
</button>
</div>
</div>
</div>
@endif
<div class="line-item-area pb-3" v-for="(row_tax, row_tax_index) in row.tax_ids"
:index="row_tax_index">
<div class="line-item-content">
<div class="long-texts line-item-text" style="float: left; margin-top: 15px; margin-right:2px; position: absolute; left: -63px;">
{{ trans_choice('general.taxes', 1) }}
</div>
@stack('discount_input_end')
@stack('taxes_input_start')
<akaunting-select
class="mb-0 select-tax"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]"
:icon="''"
:title="''"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
:name="'items.' + index + '.taxes.' + row_tax_index"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
:dynamic-options="dynamic_taxes"
:disabled-options="form.items[index].tax_ids"
:value="row_tax.id"
@interface="row_tax.id = $event"
@change="onCalculateTotal()"
@new="dynamic_taxes.push($event)"
:form-error="form.errors.get('items.' + index + '.taxes')"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack('taxes_input_end')
<div class="flex items-center lg:absolute right-0">
<div class="text-right">
<x-form.input.money
name="discount_amount"
value="0"
disabled
row-input
data-item="discount_amount"
v-model="row.discount_amount"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
<div class="line-item-content-right">
<div class="line-item-content-right-price long-texts text-right">
{{ Form::moneyGroup('tax', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row_tax.price', 'data-item' => 'total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
</div>
<div class="line-item-content-right-delete pl-2">
<button type="button" @click="onDeleteTax(index, row_tax_index)" class="btn btn-link btn-delete p-0">
<i class="far fa-trash-alt"></i>
</button>
</div>
<div class="pl-2 group">
<button type="button" @click="onDeleteDiscount(index)" class="w-6 h-7 flex items-center rounded-lg p-0 group-hover:bg-gray-100">
<span class="w-full material-icons-outlined text-lg text-gray-300 group-hover:text-gray-500">delete</span>
</button>
</div>
</div>
<div v-if="row.add_tax" class="line-item-area pb-3" :class="{'pt-2' : row.add_discount}">
<div class="line-item-content">
<div class="long-texts line-item-text" style="float: left; margin-top: 15px; margin-right:2px; position: absolute; left: -63px;">
{{ trans_choice('general.taxes', 1) }}
</div>
</div>
@stack('taxes_input_start')
<akaunting-select
class="mb-0 select-tax"
style="margin-left: 1px; margin-right: -2px;"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]"
:icon="''"
:title="''"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
:name="'items.' + index + '.taxes.999'"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
:dynamic-options="dynamic_taxes"
:disabled-options="form.items[index].tax_ids"
:value="tax_id"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'path' => route('modals.taxes.create'),
'type' => 'modal',
'field' => [
'key' => 'id',
'value' => 'title'
<div class="flex items-center justify-between h-10 ml-3 my-3" v-for="(row_tax, row_tax_index) in row.tax_ids"
:index="row_tax_index"
>
<span class="absolute text-sm ltr:-ml-7 rtl:-mr-7">{{ trans_choice('general.taxes', 1) }}</span>
<div class="lg:w-1/4 lg:absolute">
@stack('taxes_input_start')
<akaunting-select
class="mb-0 select-tax"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]"
:icon="''"
:title="''"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
:name="'items.' + index + '.taxes.' + row_tax_index"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
:dynamic-options="dynamic_taxes"
:disabled-options="form.items[index].tax_ids"
:value="row_tax.id"
@interface="row_tax.id = $event"
@change="onCalculateTotal()"
@new="dynamic_taxes.push($event)"
:form-error="form.errors.get('items.' + index + '.taxes')"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack('taxes_input_end')
</div>
<div class="flex items-center lg:absolute right-0">
<div class="text-right">
<x-form.input.money
name="tax"
value="0"
disabled
row-input
data-item="total"
v-model="row_tax.price"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
<div class="pl-2 group">
<button type="button" @click="onDeleteTax(index, row_tax_index)" class="btn btn-link btn-delete w-6 h-7 flex items-center rounded-lg p-0 group-hover:bg-gray-100">
<span class="w-full material-icons-outlined text-lg text-gray-300 group-hover:text-gray-500">delete</span>
</button>
</div>
</div>
</div>
<div v-if="row.add_tax" class="flex items-center justify-between h-10 ml-3 my-3" :class="{'pt-2' : row.add_discount}">
<span class="absolute text-sm ltr:-ml-7 rtl:-mr-7">{{ trans_choice('general.taxes', 1) }}</span>
<div class="lg:w-1/4 lg:absolute">
@stack('taxes_input_start')
<akaunting-select
class="mb-0 select-tax"
style="margin-left: 1px; margin-right: -2px;"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]"
:icon="''"
:title="''"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
:name="'items.' + index + '.taxes.999'"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
:dynamic-options="dynamic_taxes"
:disabled-options="form.items[index].tax_ids"
:value="tax_id"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'path' => route('modals.taxes.create'),
'type' => 'modal',
'field' => [
'key' => 'id',
'value' => 'title'
],
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
'confirm' => [
'text' => trans('general.save'),
'class' => 'disabled:bg-green-100'
]
])}}"
@interface="tax_id = $event"
@visible-change="onSelectedTax(index)"
@new="dynamic_taxes.push($event)"
:form-error="form.errors.get('items.' + index + '.taxes')"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack('taxes_input_end')
]
])}}"
@interface="tax_id = $event"
@visible-change="onSelectedTax(index)"
@new="dynamic_taxes.push($event)"
:form-error="form.errors.get('items.' + index + '.taxes')"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack('taxes_input_end')
</div>
<div class="flex items-center lg:absolute right-0">
<div class="text-right">
<div class="required disabled text-right input-price disabled-money">
<input type="tel" class="v-money form-control text-right" name="discount_amount" disabled="disabled" value="__">
</div>
</div>
<div class="line-item-content-right">
<div class="line-item-content-right-price long-texts text-right">
<div>
<div class="required disabled text-right input-price disabled-money">
<input type="tel" class="v-money form-control text-right" name="discount_amount" disabled="disabled" value="__">
</div>
</div>
</div>
<div class="line-item-content-right-delete pl-2">
@if (!$hideDiscount && in_array(setting('localisation.discount_location'), ['item', 'both']))
<button type="button" @click="onDeleteTax(index, 999)" class="btn btn-link btn-delete p-0">
<i class="far fa-trash-alt"></i>
</button>
@endif
</div>
<div class="pl-2 group">
<button type="button" @click="onDeleteTax(index, 999)" class="btn btn-link btn-delete w-6 h-7 flex items-center rounded-lg p-0 group-hover:bg-gray-100">
<span class="w-full material-icons-outlined text-lg text-gray-300 group-hover:text-gray-500">delete</span>
</button>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</div>
</td>
</tr>
</tbody>
</table>
</td>
@stack('name_td_end')
</tr>

View File

@ -1,61 +1,15 @@
<div class="card">
<div class="document-loading" v-if="!page_loaded">
<div><i class="fas fa-spinner fa-pulse fa-7x"></i></div>
</div>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans($textSectionMainTitle) }}" description="{{ trans($textSectionMainDescription) }}" />
</x-slot>
<div class="card-body">
<x-documents.form.metadata
type="{{ $type }}"
:document="$document"
hide-contact="{{ $hideContact }}"
contact-type="{{ $contactType }}"
:contact="$contact"
:contacts="$contacts"
:search-route="$contactSearchRoute"
:create-route="$contactCreateRoute"
hide-issued-at="{{ $hideIssuedAt }}"
text-issued-at="{{ $textIssuedAt }}"
issued-at="{{ $issuedAt }}"
hide-document-number="{{ $hideDocumentNumber }}"
text-document-number="{{ $textDocumentNumber }}"
document-number="{{ $documentNumber }}"
hide-due-at="{{ $hideDueAt }}"
text-due-at="{{ $textDueAt }}"
due-at="{{ $dueAt }}"
hide-order-number="{{ $hideOrderNumber }}"
text-order-number="{{ $textOrderNumber }}"
order-number="{{ $orderNumber }}"
/>
<x-slot name="body">
<x-documents.form.metadata type="{{ $type }}" />
<x-documents.form.items
type="{{ $type }}"
:document="$document"
hide-edit-item-columns="{{ $hideEditItemColumns }}"
hide-items="{{ $hideItems }}"
hide-name="{{ $hideName }}"
hide-description="{{ $hideDescription }}"
text-items="{{ $textItems }}"
hide-quantity="{{ $hideQuantity }}"
text-quantity="{{ $textQuantity }}"
hide-price="{{ $hidePrice }}"
text-price="{{ $textPrice }}"
hide-discount="{{ $hideDiscount }}"
hide-amount="{{ $hideAmount }}"
text-amount="{{ $textAmount }}"
is-sale-price="{{ $isSalePrice }}"
is-purchase-price="{{ $isPurchasePrice }}"
search-char-limit="{{ $searchCharLimit }}"
/>
<x-documents.form.items type="{{ $type }}" />
<x-documents.form.totals
type="{{ $type }}"
:document="$document"
/>
<x-documents.form.totals type="{{ $type }}" />
<x-documents.form.note
type="{{ $type }}"
:document="$document"
notes-setting="{{ $notesSetting }}"
/>
</div>
</div>
<x-documents.form.note type="{{ $type }}" />
</x-slot>
</x-form.section>

View File

@ -1,47 +1,90 @@
<div class="row">
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideContact)
<div class="row">
<x-select-contact-card
type="{{ $contactType }}"
:contact="$contact"
:contacts="$contacts"
:search-route="$contactSearchRoute"
:create-route="$contactCreateRoute"
error="form.errors.get('contact_name')"
:text-add-contact="$textAddContact"
:text-create-new-contact="$textCreateNewContact"
:text-edit-contact="$textEditContact"
:text-contact-info="$textContactInfo"
:text-choose-different-contact="$textChooseDifferentContact"
<div class="grid sm:grid-cols-7 sm:col-span-6 gap-x-8 gap-y-6 my-3.5">
<div class="sm:col-span-2 required">
<label for="contact" class="form-control-label">
{{ trans_choice($textContact, 1) }}
</label>
<x-documents.form.contact
type="{{ $typeContact }}"
:contact="$contact"
:contacts="$contacts"
:search-route="$searchContactRoute"
:create-route="$createContactRoute"
error="form.errors.get('contact_name')"
:text-add-contact="$textAddContact"
:text-create-new-contact="$textCreateNewContact"
:text-edit-contact="$textEditContact"
:text-contact-info="$textContactInfo"
:text-choose-different-contact="$textChooseDifferentContact"
/>
</div>
<div class="sm:col-span-1"></div>
<div class="sm:col-span-4 grid sm:grid-cols-4 gap-x-8 gap-y-6">
@stack('issue_start')
@if (! $hideIssuedAt)
<x-form.group.date
name="issued_at"
label="{{ trans($textIssuedAt) }}"
icon="calendar_today"
value="{{ $issuedAt }}"
show-date-format="{{ company_date_format() }}"
date-format="Y-m-d"
autocomplete="off"
change="setDueMinDate"
form-group-class="sm:col-span-2"
/>
@endif
@stack('document_number_start')
@if (! $hideDocumentNumber)
<x-form.group.text
name="document_number"
label="{{ trans($textDocumentNumber) }}"
value="{{ $documentNumber }}"
form-group-class="sm:col-span-2"
/>
@endif
@stack('due_start')
@if (! $hideDueAt)
<x-form.group.date
name="due_at"
label="{{ trans($textDueAt) }}"
icon="calendar_today"
value="{{ $dueAt }}"
show-date-format="{{ company_date_format() }}"
date-format="Y-m-d"
autocomplete="off"
period="{{ $periodDueAt }}"
min-date="form.issued_at"
min-date-dynamic="min_due_date"
data-value-min
form-group-class="sm:col-span-2"
/>
@else
<x-form.input.hidden
name="due_at"
:value="old('issued_at', $issuedAt)"
v-model="form.issued_at"
form-group-class="sm:col-span-2"
/>
@endif
@stack('order_number_start')
@if (! $hideOrderNumber)
<x-form.group.text
name="order_number"
label="{{ trans($textOrderNumber) }}"
value="{{ $orderNumber }}"
form-group-class="sm:col-span-2"
not-required
/>
</div>
@endif
</div>
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
<div class="row">
@if (!$hideIssuedAt)
{{ Form::dateGroup('issued_at', trans($textIssuedAt), 'calendar', ['id' => 'issued_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'change' => 'setDueMinDate'], $issuedAt) }}
@endif
@if (!$hideDocumentNumber)
{{ Form::textGroup('document_number', trans($textDocumentNumber), 'file', ['required' => 'required'], $documentNumber) }}
@endif
@if (!$hideDueAt)
@if ($type == 'invoice')
{{ Form::dateGroup('due_at', trans($textDueAt), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'period' => setting('invoice.payment_terms'), 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'min-date' => 'form.issued_at', 'min-date-dynamic' => 'min_due_date', 'data-value-min' => true], $dueAt) }}
@else
{{ Form::dateGroup('due_at', trans($textDueAt), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'min-date' => 'form.issued_at', 'min-date-dynamic' => 'min_due_date', 'data-value-min' => true], $dueAt) }}
@endif
@else
{{ Form::hidden('due_at', old('issued_at', $issuedAt), ['id' => 'due_at', 'v-model' => 'form.issued_at']) }}
@endif
@if (!$hideOrderNumber)
{{ Form::textGroup('order_number', trans($textOrderNumber), 'shopping-cart', [], $orderNumber) }}
@endif
</div>
</div>
</div>

View File

@ -1,3 +1,12 @@
<div class="row embed-card-body-footer">
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2), '', $notesSetting, ['rows' => '3', 'class' => 'form-control embed-card-body-footer-textarea'], 'col-md-12 embed-acoordion-textarea') }}
<div class="sm:col-span-6 mb-8">
<x-form.group.textarea
name="notes"
label="{{ trans_choice('general.notes', 2) }}"
:value="$note"
not-required
class="form-element border-0 bg-transparent px-0 rounded-none resize-none"
form-label-class="lg:text-lg"
form-group-class="border-b pb-2 mb-3.5"
rows="1"
/>
</div>

View File

@ -0,0 +1,18 @@
<x-form.section class="-mt-10 mb-14" override="class">
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.schedules', 1) }}" description="{{ trans('recurring.form_description.schedule', ['type' => Str::lower(trans_choice('general.invoices', 1))]) }}" />
</x-slot>
<x-slot name="body">
<x-form.group.recurring
:type="$type"
@started="onChangeRecurringDate"
:frequency="$document ? $document->recurring->frequency : null"
:custom-frequency="$document ? $document->recurring->custom_frequency : null"
:limit="$document ? $document->recurring->limit_by : null"
:started-value="$document ? $document->recurring->started_at : null"
:limit-count="$document ? $document->recurring->limit_count : null"
:limit-date-value="$document ? $document->recurring->limit_date : null"
/>
</x-slot>
</x-form.section>

View File

@ -0,0 +1,85 @@
<div class="grid sm:grid-cols-7 sm:col-span-6 gap-x-8 gap-y-6 my-3.5">
<div class="sm:col-span-2 required">
<label for="contact" class="form-control-label">
{{ trans_choice($textContact, 1) }}
</label>
<x-documents.form.contact
type="{{ $typeContact }}"
:contact="$contact"
:contacts="$contacts"
:search-route="$searchContactRoute"
:create-route="$createContactRoute"
error="form.errors.get('contact_name')"
:text-add-contact="$textAddContact"
:text-create-new-contact="$textCreateNewContact"
:text-edit-contact="$textEditContact"
:text-contact-info="$textContactInfo"
:text-choose-different-contact="$textChooseDifferentContact"
/>
</div>
<div class="sm:col-span-1"></div>
<div class="sm:col-span-2 grid gap-x-8 gap-y-6">
@stack('issue_start')
@if (! $hideIssuedAt)
<div class="form-group form-group relative sm:col-span-3">
<label class="form-control-label">
{{ trans($textIssuedAt) }}
</label>
<x-tooltip id="tooltip-issued" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_date', ['type' => config('type.document.' . $type . '.setting.prefix', 'invoice')]) }}">
<div class="relative focused has-label">
<x-form.input.text name="disabled_document_date" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
</div>
</x-tooltip>
<x-form.input.hidden name="issued_at" value="{{ $issuedAt }}" />
</div>
@endif
@stack('due_start')
@if (! $hideDueAt)
<x-form.group.select
name="payment_terms"
label="{{ trans('invoices.payment_due') }}"
:options="$payment_terms"
:selected="($document) ? (string) \Date::parse($document->due_at)->diffInDays(\Date::parse($document->issued_at)) : setting($type . '.payment_terms', 0)"
visible-change="onChangeRecurringDate"
/>
<x-form.input.hidden name="due_at" :value="old('due_at', $dueAt)" v-model="form.due_at" />
@else
<x-form.input.hidden name="due_at" :value="old('due_at', $dueAt)" v-model="form.due_at" />
@endif
</div>
<div class="sm:col-span-2 grid gap-x-8 gap-y-6">
@stack('document_number_start')
@if (! $hideDocumentNumber)
<div class="form-group form-group relative sm:col-span-3">
<label class="form-control-label">
{{ trans($textDocumentNumber) }}
</label>
<x-tooltip id="tooltip-number" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_number', ['type' => config('type.document.' . $type . '.setting.prefix', 'invoice')]) }}">
<div class="relative focused has-label">
<x-form.input.text name="disabled_document_number" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
</div>
</x-tooltip>
<x-form.input.hidden name="document_number" value="{{ $documentNumber }}" />
</div>
@endif
@stack('order_number_start')
@if (! $hideOrderNumber)
<x-form.group.text name="order_number" label="{{ trans($textOrderNumber) }}" value="{{ $orderNumber }}" not-required />
@endif
</div>
</div>

View File

@ -1,156 +1,237 @@
<div class="row document-item-body">
<div class="col-sm-12 mb-4 p-0">
<div class="table-responsive overflow-x-scroll overflow-y-hidden">
<table class="table" id="totals">
<div class="sm:col-span-6">
<div class="mb-4 p-0">
<div class="overflow-y-hidden py-6">
<table id="totals" class="float-right">
<colgroup>
<col class="document-total-50">
<col class="document-total-30">
<col class="document-total-25">
<col class="document-total-50-px">
<col style="width: 47.5%;">
<col style="width: 30%;">
<col style="width: 18%;">
<col style="width: 50px;">
</colgroup>
<tbody id="invoice-total-rows" class="table-padding-05">
<tbody id="invoice-total-rows">
@stack('sub_total_td_start')
<tr id="tr-subtotal">
<td class="border-bottom-0 pb-0"></td>
<td class="text-right border-right-0 border-bottom-0 align-middle pb-0 pr-0">
<strong>{{ trans('invoices.sub_total') }}</strong>
<td class="border-b-0 py-0"></td>
<td class="font-medium text-right border-r-0 border-b-0 align-middle pb-0 pr-0">
{{ trans('invoices.sub_total') }}
</td>
<td class="text-right border-bottom-0 long-texts pb-0 pr-3">
<td class="text-right border-b-0 long-texts py-0">
<div>
{{ Form::moneyGroup('sub_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
<x-form.input.money
name="sub_total"
value="0"
disabled
row-input
v-model="totals.sub"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
</td>
<td class="border-bottom-0 pb-0" style="max-width: 50px"></td>
<td class="border-b-0 pb-0" style="width: 40px"></td>
</tr>
@stack('sub_total_td_end')
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
@stack('item_discount_td_start')
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
@stack('item_discount_td_start')
<tr id="tr-line-discount" v-if="totals.item_discount">
<td class="border-top-0 pt-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0 pr-0">
<strong>{{ trans('invoices.item_discount') }}</strong>
<td class="border-t-0 py-0"></td>
<td class="text-right border-t-0 border-r-0 border-b-0 align-middle py-0 pr-0">
<span class="font-medium">{{ trans('invoices.item_discount') }}</span>
</td>
<td class="text-right border-top-0 border-bottom-0 long-texts pt-0 pb-0 pr-3">
<td class="text-right border-t-0 border-b-0 long-texts py-0 pr-0">
<div>
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
<x-form.input.money
name="item_discount"
value="0"
disabled
row-input
v-model="totals.item_discount"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
</td>
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
</tr>
@stack('item_discount_td_end')
@endif
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
@stack('add_discount_td_start')
<td class="border-t-0 py-0" style="max-width: 24px"></td>
</tr>
@stack('item_discount_td_end')
@endif
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
@stack('add_discount_td_start')
<tr id="tr-discount">
<td class="border-top-0 pt-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0 pr-0">
<el-popover
popper-class="p-0 h-0"
placement="bottom"
width="350"
v-model="discount">
<div class="card d-none" :class="[{'show' : discount}]">
<div class="discount card-body">
<div class="row align-items-center">
<div class="col-sm-8">
<div class="input-group">
<div class="input-group-prepend">
<button class="btn btn-sm" :class="[{'btn-outline-primary' : form.discount_type !== 'percentage'}, {'btn-primary' : form.discount_type === 'percentage'}]"
@click="onChangeDiscountType('percentage')" type="button">
<i class="fa fa-percent fa-sm"></i>
</button>
<button class="btn btn-sm" :class="[{'btn-outline-primary' : form.discount_type !== 'fixed'}, {'btn-primary' : form.discount_type === 'fixed'}]"
@click="onChangeDiscountType('fixed')" type="button">{{ $currency->symbol }}
</button>
</div>
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control', 'v-model' => 'form.discount']) !!}
</div>
</div>
<div class="col-sm-4">
<div class="discount-description">
<strong>{{ trans('invoices.discount_desc') }}</strong>
</div>
</div>
</div>
</div>
<div class="discount card-footer py-3">
<div class="row float-right">
<div class="col-xs-12 col-sm-12">
<a href="javascript:void(0)" @click="discount = false" class="btn btn-outline-secondary" @click="closePayment">
{{ trans('general.cancel') }}
</a>
{!! Form::button(trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddTotalDiscount', 'class' => 'btn btn-success']) !!}
</div>
</div>
</div>
</div>
</div>
<el-link class="cursor-pointer text-info" slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
</el-popover>
</td>
<td class="text-right border-top-0 border-bottom-0 pt-0 pb-0 pr-3">
<div>
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
<td class="border-t-0 py-0"></td>
<td class="text-right border-t-0 border-r-0 border-b-0 align-middle py-0 pr-0">
<div v-if="show_discount_text">
<span class="border-b border-transparent transition-all text-sm text-purple cursor-pointer hover:border-purple" v-if="!totals.discount_text" @click="onAddDiscount()">
{{ trans('invoices.add_discount') }}
</span>
</div>
<span v-if="totals.discount_text" v-html="totals.discount_text"></span>
<div class="flex items-center justify-end" v-if="show_discount">
<div class="w-16 flex items-center bg-gray-200 p-1 ltr:mr-2 rtl:ml-2 rounded-lg">
<button type="button"
class="w-7 flex justify-center px-2"
:class="[{'btn-outline-primary' : form.discount_type !== 'percentage'}, {'bg-white rounded-lg' : form.discount_type === 'percentage'}]"
@click="onChangeDiscountType('percentage')"
>
<span class="material-icons text-lg">percent</span>
</button>
<button type="button"
class="w-7 flex text-lg justify-center px-2"
:class="[{'btn-outline-primary' : form.discount_type !== 'fixed'}, {'bg-white rounded-lg' : form.discount_type === 'fixed'}]"
@click="onChangeDiscountType('fixed')"
>
{{ $currency->symbol }}
</button>
</div>
<x-form.group.number name="pre_discount" id="pre-discount" form-group-class="-mt-1" v-model="form.discount" @input="onAddTotalDiscount" />
</div>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
</td>
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
<td class="relative text-right border-t-0 border-b-0 py-0 pr-0">
<div>
<x-form.input.money
name="discount_total"
value="0"
disabled
row-input
v-model="totals.discount"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
<x-form.input.hidden name="discount" v-model="form.discount" />
<span v-if="delete_discount" @click="onRemoveDiscountArea()" class="material-icons-outlined absolute w-6 h-7 flex justify-center -right-10 top-2 text-lg text-gray-300 rounded-lg cursor-pointer hover:bg-gray-100 hover:text-gray-500">delete</span>
</td>
<td class="border-t-0 py-0" style="max-width: 50px"></td>
</tr>
@stack('add_discount_td_end')
@endif
@stack('tax_total_td_start')
<tr v-for="(tax, tax_index) in totals.taxes"
:index="tax_index">
<td class="border-top-0 pt-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0 pr-0">
<strong v-html="tax.name"></strong>
@stack('add_discount_td_end')
@endif
@stack('tax_total_td_start')
<tr v-for="(tax, tax_index) in totals.taxes" :index="tax_index">
<td class="border-t-0 pt-5 pb-0"></td>
<td class="text-right border-t-0 border-r-0 border-b-0 align-middle pt-5 pb-0 pr-0">
<span class="font-medium" v-html="tax.name"></span>
</td>
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0 pr-3">
<td class="text-right border-t-0 border-b-0 long-texts pt-5 pb-0 pl-3">
<div>
{{ Form::moneyGroup('tax_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'tax.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
<x-form.input.money
name="tax_total"
value="0"
disabled
row-input
v-model="tax.total"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
</td>
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<td class="border-t-0 pt-5 pb-0" style="max-width: 50px"></td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr id="tr-total">
<td class="border-top-0 pt-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 align-middle pt-0 pb-0 pr-0">
<strong class="document-total-span">{{ trans('invoices.total') }}</strong>
{{ Form::selectGroup('currency_code', '', 'exchange-alt', $currencies, $currency->code, ['required' => 'required', 'model' => 'form.currency_code', 'change' => 'onChangeCurrency'], 'document-total-currency') }}
{!! Form::hidden('currency_rate', (!empty($document)) ? $document->currency_rate : $currency->rate, ['id' => 'currency_rate', 'class' => 'form-control', 'required' => 'required']) !!}
<td class="border-t-0 pt-5 pb-0"></td>
<td class="flex items-center justify-end pt-5 pb-0">
<span class="w-16 text-right font-medium mt-2 ltr:mr-2 rtl:ml-2">
{{ trans('invoices.total') }}
</span>
<x-form.group.select
name="currency_code"
:options="$currencies"
selected="{{ $currency->code }}"
change="onChangeCurrency"
model="form.currency_code"
form-group-class="h-8 -mt-2"
/>
<x-form.input.hidden name="currency_rate" :value="(!empty($document)) ? $document->currency_rate : $currency->rate" />
</td>
<td class="text-right border-top-0 long-texts pt-0 pb-0 pr-3">
<td class="text-right border-t-0 long-texts pt-5 pb-0 pr-0">
<div>
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
<x-form.input.money
name="grand_total"
value="0"
disabled
row-input
v-model="totals.total"
:currency="$currency"
dynamicCurrency="currency"
money-class="text-right disabled-money px-0"
form-group-class="text-right disabled-money"
/>
</div>
</td>
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
<td class="border-t-0 pt-5 pb-0" style="max-width: 50px"></td>
</tr>
@stack('grand_total_td_end')
@stack('currency_conversion_td_start')
<tr id="tr-currency-conversion" class="d-none" :class="[{'d-table-row': (('{{ $currency->code }}' != form.currency_code) && totals.total || dropdown_visible)}]">
<td class="border-top-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 align-middle pb-0 pr-3 pr-0" colspan="2">
<akaunting-currency-conversion
currency-conversion-text="{{ trans('currencies.conversion') }}"
:price="(totals.total / form.currency_rate).toFixed(2)"
:currecy-code="form.currency_code"
:currency-rate="form.currency_rate"
:currency-symbol="currency_symbol"
@change="form.currency_rate = $event"
></akaunting-currency-conversion>
</td>
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
</tr>
@stack('currency_conversion_td_end')
<tr id="tr-currency-conversion" :class="[
{'hidden': ! (('{{ $currency->code }}' != form.currency_code) && totals.total || dropdown_visible)},
{'contents': (('{{ $currency->code }}' != form.currency_code) && totals.total || dropdown_visible)}
]">
<td class="border-t-0 pt-5 pb-0"></td>
<td colspan="2" class="text-right border-t-0 border-r-0 align-middle pt-5 pb-0 pr-0">
<akaunting-currency-conversion
currency-conversion-text="{{ trans('currencies.conversion') }}"
:price="(totals.total / form.currency_rate).toFixed(2)"
:currecy-code="form.currency_code"
:currency-rate="form.currency_rate"
:currency-symbol="currency_symbol"
@change="form.currency_rate = $event"
></akaunting-currency-conversion>
</td>
<td class="border-t-0 pt-5 pb-0" style="max-width: 50px"></td>
</tr>
@stack('currency_conversion_td_end')
</tbody>
</table>
</div>

View File

@ -0,0 +1,15 @@
@if ($checkPermissionCreate)
@can($permissionCreate)
@if (! $hideCreate)
<x-link href="{{ route($createRoute) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice($textPage, 1)]) }}
</x-link>
@endif
@endcan
@else
@if (! $hideCreate)
<x-link href="{{ route($createRoute) }}" kind="primary">
{{ trans('general.title.new', ['type' => trans_choice($textPage, 1)]) }}
</x-link>
@endif
@endif

View File

@ -1,101 +0,0 @@
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
@if (!$hideBulkAction)
<th class="{{ $classBulkAction }}">
{{ Form::bulkActionAllGroup() }}
</th>
@endif
@stack('document_number_th_start')
@if (!$hideDocumentNumber)
<th class="{{ $classDocumentNumber }}">
@stack('document_number_th_inside_start')
@if (!$hideBulkAction)
@sortablelink('document_number', trans_choice($textDocumentNumber, 1), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])
@else
@sortablelink('document_number', trans_choice($textDocumentNumber, 1), ['filter' => 'active, visible'], ['rel' => 'nofollow'])
@endif
@stack('document_number_th_inside_end')
</th>
@endif
@stack('document_number_th_end')
@stack('contact_name_th_start')
@if (!$hideContactName)
<th class="{{ $classContactName }}">
@stack('contact_name_th_inside_start')
@sortablelink('contact_name', trans_choice($textContactName, 1))
@stack('contact_name_th_inside_end')
</th>
@endif
@stack('contact_name_th_end')
@stack('amount_th_start')
@if (!$hideAmount)
<th class="{{ $classAmount }}">
@stack('amount_th_inside_start')
@sortablelink('amount', trans('general.amount'))
@stack('amount_th_inside_end')
</th>
@endif
@stack('amount_th_end')
@stack('issued_at_th_start')
@if (!$hideIssuedAt)
<th class="{{ $classIssuedAt }}">
@stack('issued_at_th_inside_start')
@sortablelink('issued_at', trans($textIssuedAt))
@stack('issued_at_th_inside_end')
</th>
@endif
@stack('issued_at_th_end')
@stack('due_at_th_start')
@if (!$hideDueAt)
<th class="{{ $classDueAt }}">
@stack('due_at_th_inside_start')
@sortablelink('due_at', trans($textDueAt))
@stack('due_at_th_inside_end')
</th>
@endif
@stack('due_at_th_end')
@stack('status_th_start')
@if (!$hideStatus)
<th class="{{ $classStatus }}">
@stack('status_th_inside_start')
@sortablelink('status', trans_choice('general.statuses', 1))
@stack('status_th_inside_end')
</th>
@endif
@stack('status_th_end')
@if (!$hideActions)
<th class="{{ $classActions }}">
<a>{{ trans('general.actions') }}</a>
</th>
@endif
</tr>
</thead>
<tbody>
@foreach($documents as $item)
@include('partials.documents.index.card-table-row')
@endforeach
</tbody>
</table>
</div>

View File

@ -1,5 +0,0 @@
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $documents])
</div>
</div>

View File

@ -1,33 +0,0 @@
@if (!$hideBulkAction)
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => $formCardHeaderRoute,
'role' => 'form',
'class' => 'mb-0'
]) !!}
@if (!$hideSearchString)
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="{{ $searchStringModel }}" />
</div>
@endif
{{ Form::bulkActionRowGroup($textBulkAction, $bulkActions, $bulkActionRouteParameters) }}
{!! Form::close() !!}
</div>
@else
@if (!$hideSearchString)
<div class="card-header border-bottom-0">
{!! Form::open([
'method' => 'GET',
'route' => $formCardHeaderRoute,
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center">
<x-search-string model="{{ $searchStringModel }}" />
</div>
{!! Form::close() !!}
</div>
@endif
@endif

View File

@ -1,73 +1,110 @@
@if ($hideEmptyPage || ($documents->count() || request()->get('search', false)))
<div class="card">
<x-documents.index.card-header
type="{{ $type }}"
hide-bulk-action="{{ $hideBulkAction }}"
:form-card-header-route="$formCardHeaderRoute"
hide-search-string="{{ $hideSearchString }}"
search-string-model="{{ $searchStringModel }}"
text-bulk-action="{{ $textBulkAction }}"
bulk-action-class="{{ $bulkActionClass }}"
:bulk-actions="$bulkActions"
:bulk-action-route-parameters="$bulkActionRouteParameters"
/>
@if (! $hideSummary)
<x-index.summary :items="$summaryItems" />
@endif
<x-documents.index.card-body
type="{{ $type }}"
:documents="$documents"
hide-bulk-action="{{ $hideBulkAction }}"
class-bulk-action="{{ $classBulkAction }}"
hide-document-number="{{ $hideDocumentNumber }}"
text-document-number="{{ $textDocumentNumber }}"
class-document-number="{{ $classDocumentNumber }}"
hide-contact-name="{{ $hideContactName }}"
text-contact-name="{{ $textContactName }}"
class-contact-name="{{ $classContactName }}"
hide-amount="{{ $hideAmount }}"
class-amount="{{ $classAmount }}"
hide-issued-at="{{ $hideIssuedAt }}"
text-issued-at="{{ $textIssuedAt }}"
class-issued-at="{{ $classIssuedAt }}"
hide-due-at="{{ $hideDueAt }}"
class-due-at="{{ $classDueAt }}"
text-due-at="{{ $textDueAt }}"
hide-status="{{ $hideStatus }}"
class-status="{{ $classStatus }}"
hide-actions="{{ $hideActions }}"
class-actions="{{ $classActions }}"
text-document-status="{{ $textDocumentStatus }}"
hide-button-show="{{ $hideButtonShow }}"
route-button-show="{{ $routeButtonShow }}"
hide-button-edit="{{ $hideButtonEdit }}"
check-button-reconciled="{{ $checkButtonReconciled }}"
route-button-edit="{{ $routeButtonEdit }}"
check-button-cancelled="{{ $checkButtonCancelled }}"
hide-button-duplicate="{{ $hideButtonDuplicate }}"
permission-create="{{ $permissionCreate }}"
route-button-duplicate="{{ $routeButtonDuplicate }}"
hide-button-cancel="{{ $hideButtonCancel }}"
permission-update="{{ $permissionUpdate }}"
route-button-cancelled="{{ $routeButtonCancelled }}"
hide-button-delete="{{ $hideButtonDelete }}"
permission-delete="{{ $permissionDelete }}"
route-button-delete="{{ $routeButtonDelete }}"
text-modal-delete="{{ $textModalDelete }}"
value-modal-delete="{{ $valueModalDelete }}"
/>
<x-index.container>
@if (! $withoutTabs)
<x-tabs active="{{ $tabActive }}">
<x-slot name="navs">
@stack('document_nav_start')
<x-documents.index.card-footer
type="{{ $type }}"
:documents="$documents"
/>
</div>
@if ($tabActive == $type)
<x-tabs.nav id="{{ $type }}" name="{{ trans_choice($textTabDocument, 2) }}" active />
@else
<x-tabs.nav-link id="{{ $type }}" name="{{ trans_choice($textTabDocument, 2) }}" href="{{ route($routeTabDocument) }}" />
@endif
@stack('document_nav_end')
@if ($tabActive == 'recurring-templates')
@if (! $hideRecurringTemplates)
<x-tabs.nav id="recurring-templates" name="{{ trans_choice('general.recurring_templates', 2) }}" active />
@endif
@else
@if (! $hideRecurringTemplates)
<x-tabs.nav-link id="recurring-templates" name="{{ trans_choice('general.recurring_templates', 2) }}" href="{{ route($routeTabRecurring) }}" />
@endif
@endif
@stack('recurring_nav_end')
</x-slot>
<x-slot name="content">
@if ((! $hideSearchString) && (! $hideBulkAction))
<x-index.search
search-string="{{ $searchStringModel }}"
bulk-action="{{ $bulkActionClass }}"
route="{{ $searchRoute }}"
/>
@elseif ((! $hideSearchString) && $hideBulkAction)
<x-index.search
search-string="{{ $searchStringModel }}"
route="{{ $searchRoute }}"
/>
@elseif ($hideSearchString && (! $hideBulkAction))
<x-index.search
bulk-action="{{ $bulkActionClass }}"
route="{{ $searchRoute }}"
/>
@endif
@stack('document_tab_start')
@if ($tabActive == $type)
<x-tabs.tab id="{{ $type }}">
<x-documents.index.document :type="$type" :documents="$documents" />
</x-tabs.tab>
@endif
@stack('document_tab_end')
@if ($tabActive == 'recurring-templates')
@if (! $hideRecurringTemplates)
<x-tabs.tab id="recurring-templates">
<x-documents.index.recurring-templates :type="$type" :documents="$documents" />
</x-tabs.tab>
@endif
@endif
@stack('recurring_tab_end')
</x-slot>
</x-tabs>
@else
@if ((! $hideSearchString) && (! $hideBulkAction))
<x-index.search
search-string="{{ $searchStringModel }}"
bulk-action="{{ $bulkActionClass }}"
route="{{ $searchRoute }}"
/>
@elseif ((! $hideSearchString) && $hideBulkAction)
<x-index.search
search-string="{{ $searchStringModel }}"
route="{{ $searchRoute }}"
/>
@elseif ($hideSearchString && (! $hideBulkAction))
<x-index.search
bulk-action="{{ $bulkActionClass }}"
route="{{ $searchRoute }}"
/>
@endif
@stack('document_start')
<x-documents.index.document :type="$type" :documents="$documents" />
@stack('document_end')
@endif
</x-index.container>
@else
<x-documents.index.empty-page
type="{{ $type }}"
<x-empty-page
group="{{ $group }}"
page="{{ $page }}"
alias="{{ $alias }}"
:buttons="$emptyPageButtons"
image-empty-page="{{ $imageEmptyPage }}"
text-empty-page="{{ $textEmptyPage }}"
url-docs-path="{{ $urlDocsPath }}"
create-route="{{ $createRoute }}"
check-permission-create="{{ $checkPermissionCreate }}"
permission-create="{{ $permissionCreate }}"
/>
@endif

View File

@ -0,0 +1,182 @@
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
@if (! $hideBulkAction)
<x-table.th class="{{ $classBulkAction }}" override="class">
<x-index.bulkaction.all />
</x-table.th>
@endif
@stack('due_at_and_issued_at_th_start')
@if (! $hideDueAt || ! $hideIssuedAt)
<x-table.th class="{{ $classDueAtAndIssueAt }}">
@stack('due_at_th_start')
@if (! $hideDueAt)
<x-slot name="first">
@stack('due_at_th_inside_start')
<x-sortablelink column="due_at" title="{{ trans($textDueAt) }}" />
@stack('due_at_th_inside_end')
</x-slot>
@endif
@stack('due_at_th_end')
@stack('issued_at_th_start')
@if (! $hideIssuedAt)
<x-slot name="second">
@stack('issued_at_th_inside_start')
<x-sortablelink column="issued_at" title="{{ trans($textIssuedAt) }}" />
@stack('issued_at_th_inside_end')
</x-slot>
@endif
@stack('issued_at_th_end')
</x-table.th>
@endif
@stack('due_at_and_issued_at_th_end')
@stack('status_th_start')
@if (! $hideStatus)
<x-table.th class="{{ $classStatus }}">
@stack('status_th_inside_start')
<x-sortablelink column="status" title="{{ trans_choice('general.statuses', 1) }}" />
@stack('status_th_inside_end')
</x-table.th>
@endif
@stack('status_th_end')
@stack('contact_name_ane_document_number_th_start')
@if (! $hideContactName || ! $hideDocumentNumber)
<x-table.th class="{{ $classContactNameAndDocumentNumber }}">
@stack('contact_name_th_start')
@if (! $hideContactName)
<x-slot name="first">
@stack('contact_name_th_inside_start')
<x-sortablelink column="contact_name" title="{{ trans_choice($textContactName, 1) }}" />
@stack('contact_name_th_inside_end')
</x-slot>
@endif
@stack('contact_name_th_end')
@stack('document_number_th_start')
@if (! $hideDocumentNumber)
<x-slot name="second">
@stack('document_number_th_inside_start')
<x-sortablelink column="document_number" title="{{ trans_choice($textDocumentNumber, 1) }}" />
@stack('document_number_th_inside_end')
</x-slot>
@endif
@stack('document_number_th_end')
</x-table.th>
@endif
@stack('contact_name_ane_document_number_th_end')
@stack('amount_th_start')
@if (! $hideAmount)
<x-table.th class="{{ $classAmount }}" kind="amount">
@stack('amount_th_inside_start')
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
@stack('amount_th_inside_end')
</x-table.th>
@endif
@stack('amount_th_end')
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($documents as $item)
@php $paid = $item->paid; @endphp
<x-table.tr href="{{ route($showRoute, $item->id) }}">
@if (! $hideBulkAction)
<x-table.td class="{{ $classBulkAction }}" override="class">
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->document_number }}" />
</x-table.td>
@endif
@stack('due_at_and_issued_at_td_start')
@if (! $hideDueAt || ! $hideIssuedAt)
<x-table.td class="{{ $classDueAtAndIssueAt }}">
@stack('due_at_td_start')
@if (! $hideDueAt)
<x-slot name="first" class="font-bold truncate" override="class">
@stack('due_at_td_inside_start')
<x-date :date="$item->due_at" function="diffForHumans" />
@stack('due_at_td_inside_end')
</x-slot>
@endif
@stack('due_at_td_end')
@stack('issued_at_td_start')
@if (! $hideIssuedAt)
<x-slot name="second">
@stack('issued_at_td_inside_start')
<x-date date="{{ $item->issued_at }}" />
@stack('issued_at_td_inside_end')
</x-slot>
@endif
@stack('issued_at_td_end')
</x-table.td>
@endif
@stack('due_at_and_issued_at_td_end')
@stack('status_td_start')
@if (!$hideStatus)
<x-table.td class="{{ $classStatus }}">
@stack('status_td_inside_start')
<span class="px-2.5 py-1 text-xs font-medium rounded-xl bg-{{ $item->status_label }} text-text-{{ $item->status_label }}">
{{ trans($textDocumentStatus . $item->status) }}
</span>
@stack('status_td_inside_end')
</x-table.td>
@endif
@stack('status_td_end')
@stack('contact_name_and_document_number_td_start')
@if (! $hideContactName || ! $hideDocumentNumber)
<x-table.td class="{{ $classContactNameAndDocumentNumber }}">
@stack('contact_name_td_start')
@if (! $hideContactName)
<x-slot name="first">
@stack('contact_name_td_inside_start')
{{ $item->contact_name }}
@stack('contact_name_td_inside_end')
</x-slot>
@endif
@stack('contact_name_td_end')
@stack('document_number_td_start')
@if (! $hideDocumentNumber)
<x-slot name="second" class="w-20 font-normal group" data-tooltip-target="tooltip-information-{{ $item->id }}" data-tooltip-placement="left" override="class">
@stack('document_number_td_inside_start')
<span class="border-black border-b border-dashed">
{{ $item->document_number }}
</span>
<div class="w-28 absolute h-10 -ml-12 -mt-6"></div>
@stack('document_number_td_inside_end')
<x-documents.index.information :document="$item" :hide-show="$hideShow" :show-route="$showContactRoute" />
</x-slot>
@endif
@stack('document_number_td_end')
</x-table.td>
@endif
@stack('contact_name_and_document_number_td_end')
@stack('amount_td_start')
@if (! $hideAmount)
<x-table.td class="{{ $classAmount }}" kind="amount">
@stack('amount_td_inside_start')
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
@stack('amount_td_inside_end')
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
@endif
@stack('amount_td_end')
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$documents" />

View File

@ -1,26 +0,0 @@
<div class="card">
<div class="row align-items-center">
<div class="col-xs-12 col-sm-6 text-center p-5">
<img class="blank-image" src="{{ asset($imageEmptyPage) }}" alt="@yield('title')"/>
</div>
<div class="col-xs-12 col-sm-6 text-center p-5">
<p class="text-justify description">
{!! trans($textEmptyPage) !!} {!! trans('general.empty.documentation', ['url' => $urlDocsPath]) !!}
</p>
@if ($checkPermissionCreate)
@can($permissionCreate)
<a href="{{ route($createRoute) }}" class="btn btn-success float-right mt-4">
<span class="btn-inner--text">{{ trans('general.title.create', ['type' => trans_choice($textPage, 1)]) }}</span>
</a>
@endcan
@else
<a href="{{ route($createRoute) }}" class="btn btn-success float-right mt-4">
<span class="btn-inner--text">{{ trans('general.title.create', ['type' => trans_choice($textPage, 1)]) }}</span>
</a>
@endif
</div>
</div>
</div>

View File

@ -0,0 +1,124 @@
<div id="tooltip-information-{{ $document->id }}" role="tooltip" class="w-96 inline-block absolute z-10 text-sm font-medium rounded-lg border border-gray-200 shadow-sm whitespace-nowrap tooltip-content transition-visible bg-lilac-900 border-none text-black p-6 cursor-auto opacity-0 invisible">
<div class="absolute w-2 h-2 inset-y-1/2 -right-1 before:content-[' '] before:absolute before:w-2 before:h-2 before:bg-lilac-900 before:border-gray-200 before:transform before:rotate-45 before:border before:border-t-0 before:border-l-0 data-popper-arrow"></div>
<ul>
<li class="relative flex items-center text-sm mb-7">
<div class="flex flex-col items-center mr-2">
<span class="material-icons-outlined text-black-300">person</span>
</div>
<div class="flex flex-col items-start">
<div class="font-bold">
{{ $document->document_number }}
</div>
<div class="absolute ltr:right-0 rtl:left-0">
<x-index.status status="{{ $document->status }}" background-color="bg-{{ $document->status_label }}" text-color="text-text-{{ $document->status_label }}" />
</div>
@if (! $hideShow)
<a href="{{ route($showRoute, $document->contact_id) }}" class="font-medium border-b border-black">
{{ $document->contact_name }}
</a>
@else
<div class="font-medium border-b border-black">
{{ $document->contact_name }}
</div>
@endif
</div>
</li>
<li class="relative flex items-center text-sm mb-7">
<div class="flex flex-col items-center mr-2">
<span class="material-icons-outlined text-black-300">bookmark_border</span>
</div>
<div class="flex flex-col">
<div class="flex items-center">
@php $history = $document->last_history; @endphp
<span class="font-medium mr-2">
{{ $history->description }}
</span>
<span class="flex items-center font-normal">
{{ \Date::parse($history->created_at)->diffForHumans() }}
</span>
</div>
</div>
</li>
@if ($document->items->count())
@foreach ($document->items as $document_item)
<li class="relative flex items-center text-sm mb-7">
<div class="flex flex-col items-center mr-2">
<span class="material-icons-outlined text-black-300">sell</span>
</div>
<div class="w-full flex flex-col">
<div class="flex items-center justify-between">
<div class="w-60 font-medium truncate">
{{ $document_item->name }}
</div>
<span class="font-normal">
<x-money :amount="$document_item->price" :currency="$document->currency_code" convert />
</span>
</div>
<div class="w-40 font-normal text-sm truncate">
{{ $document_item->description }}
</div>
</div>
</li>
@if ($loop->index >= 2)
@break
@endif
@endforeach
@endif
@if ($document->items->count() > 2)
<li class="ml-10 mb-10">
@if (! $hideShow)
<a href="{{ route($showRoute, $document->id) }}" class="border-b">
{{ trans('documents.invoice_detail.more_item', ['count' => $document->items->count() - 2]) }}
</a>
@else
<div class="border-b">
{{ trans('documents.invoice_detail.more_item', ['count' => $document->items->count() - 2]) }}
</div>
@endif
</li>
@endif
<li class="relative flex items-center text-sm">
<div class="flex flex-col items-center mr-2">
<span class="material-icons-outlined text-black-300">attach_money</span>
</div>
<div class="w-full flex flex-col">
<div class="flex items-center justify-between font-medium">
<span>
{{ trans('general.paid') }}
</span>
@if ($document->paid)
<span>
<x-money :amount="$document->paid" :currency="$document->currency_code" convert />
</span>
@endif
</div>
<div class="flex items-center justify-between font-medium">
<span>
{{ trans('general.due') }}
</span>
<span>
<x-money :amount="$document->amount" :currency="$document->currency_code" convert />
</span>
</div>
</div>
</li>
</ul>
</div>

View File

@ -0,0 +1,27 @@
<x-dropdown id="dropdown-more-actions">
<x-slot name="trigger">
<span class="material-icons">more_horiz</span>
</x-slot>
@if ($checkPermissionCreate)
@can($permissionCreate)
@if (! $hideImport)
<x-dropdown.link href="{{ route($importRoute, $importRouteParameters) }}">
{{ trans('import.import') }}
</x-dropdown.link>
@endif
@endcan
@else
@if (! $hideImport)
<x-dropdown.link href="{{ route($importRoute, $importRouteParameters) }}">
{{ trans('import.import') }}
</x-dropdown.link>
@endif
@endif
@if (! $hideExport)
<x-dropdown.link href="{{ route($exportRoute, request()->input()) }}">
{{ trans('general.export') }}
</x-dropdown.link>
@endif
</x-dropdown>

View File

@ -0,0 +1,101 @@
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
@if (! $hideBulkAction)
<x-table.th class="{{ $classBulkAction }}" override="class">
<x-index.bulkaction.all />
</x-table.th>
@endif
<x-table.th class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-sortablelink column="recurring.started_at" title="{{ trans('general.start_date') }}" />
</x-slot>
<x-slot name="second">
{{ trans('recurring.last_issued') }}
</x-slot>
</x-table.th>
<x-table.th class="w-2/12 ltr:pr-6 rtl:pl-6 py-3 ltr:text-left rtl:text-right text-xs font-medium text-black tracking-wider hidden sm:table-cell">
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
</x-table.th>
<x-table.th class="w-4/12 sm:w-3/12">
<x-sortablelink column="recurring.status" title="{{ trans_choice('general.statuses', 1) }}" />
</x-table.th>
<x-table.th class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ trans('recurring.frequency') }}
</x-slot>
<x-slot name="second">
{{ trans('recurring.duration') }}
</x-slot>
</x-table.th>
<x-table.th class="w-4/12 sm:w-2/12 text-right pl-6 pr-0">
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
</x-table.th>
</x-table.tr>
</x-table.thead>
<x-table.tbody>
@foreach($documents as $item)
<x-table.tr href="{{ route('recurring-transactions.show', $item->id) }}">
@if (! $hideBulkAction)
<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->contact->name }}" />
</x-table.td>
@endif
<x-table.td class="w-4/12 sm:w-3/12">
<x-slot name="first">
<x-date date="{{ $item->recurring->started_at }}" />
</x-slot>
<x-slot name="second">
@if ($last = $item->recurring->getLastRecurring())
{{ $last->format(company_date_format()) }}
@endif
</x-slot>
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<div class="flex items-center">
<x-index.category :model="$item->category" />
</div>
</x-table.td>
<x-table.td class="w-4/12 sm:w-3/12">
<x-index.status status="{{ $item->recurring->status }}" background-color="bg-{{ $item->recurring_status_label }}" text-color="text-text-{{ $item->recurring_status_label }}" />
</x-table.td>
<x-table.td class="w-2/12 hidden sm:table-cell">
<x-slot name="first">
{{ trans('recurring.' . $item->recurring->frequency) }}
</x-slot>
<x-slot name="second">
@if ($item->recurring->limit_by == 'count')
@if ($item->recurring->limit_count == 0)
{{ trans('recurring.ends_never') }}
@else
{{ trans('recurring.ends_after', ['times' => $item->recurring->limit_count]) }}
@endif
@else
{{ trans('recurring.ends_date', ['date' => company_date($item->recurring->limit_date)]) }}
@endif
</x-slot>
</x-table.td>
<x-table.td class="relative w-4/12 sm:w-2/12 text-right pl-6 pr-0">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
</x-table.td>
<x-table.td kind="action">
<x-table.actions :model="$item" />
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
<x-pagination :items="$documents" />

View File

@ -1,23 +0,0 @@
@if ($checkPermissionCreate)
@can($permissionCreate)
@if (!$hideCreate)
<a href="{{ route($createRoute) }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endif
@if (!$hideImport)
<a href="{{ route($importRoute, $importRouteParameters) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
@endif
@endcan
@else
@if (!$hideCreate)
<a href="{{ route($createRoute) }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endif
@if (!$hideImport)
<a href="{{ route($importRoute, $importRouteParameters) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
@endif
@endif
@if (!$hideExport)
<a href="{{ route($exportRoute, request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
@endif

View File

@ -1,18 +1,22 @@
@php
$document_items = 'false';
@push('scripts_start')
@php
$document_items = 'false';
$document_app_env = env('APP_ENV');
if ($items) {
$document_items = json_encode($items);
} else if (old('items')) {
$document_items = json_encode(old('items'));
}
@endphp
if ($items) {
$document_items = json_encode($items);
} else if (old('items')) {
$document_items = json_encode(old('items'));
}
@endphp
<script type="text/javascript">
var document_items = {!! $document_items !!};
var document_default_currency = '{{ $currency_code }}';
var document_currencies = {!! $currencies !!};
var document_taxes = {!! $taxes !!};
</script>
<script type="text/javascript">
var document_items = {!! $document_items !!};
var document_default_currency = '{{ $currency_code }}';
var document_currencies = {!! $currencies !!};
var document_taxes = {!! $taxes !!};
var document_app_env = '{{ $document_app_env }}';
</script>
@endpush
<script src="{{ asset( $scriptFile . '?v=' . $version) }}"></script>
<x-script :alias="$alias" :folder="$folder" :file="$file" />

View File

@ -1,9 +1,17 @@
@if ($attachment)
<div class="row align-items-center">
@foreach ($attachment as $file)
<div class="col-xs-12 col-sm-4 mb-4">
@include('partials.media.file')
</div>
@endforeach
</div>
<x-show.accordion type="attachment" :open="($accordionActive == 'attachment')">
<x-slot name="head">
<x-show.accordion.head
title="{{ trans_choice('general.attachments', 2) }}"
description="{{ trans('documents.form_description.attachment', ['type' => $type]) }}"
/>
</x-slot>
<x-slot name="body">
@foreach ($attachment as $file)
<x-media.file :file="$file" />
@endforeach
</x-slot>
</x-show.accordion>
@endif

View File

@ -0,0 +1,23 @@
@stack('add_new_button_start')
@if (! $hideCreate)
@can($permissionCreate)
<x-link href="{{ route($createRoute) }}" kind="primary">
{{ trans($textCreate) }}
</x-link>
@endcan
@endif
@stack('edit_button_start')
@if (! in_array($document->status, $hideButtonStatuses))
@if (! $hideEdit)
@can($permissionUpdate)
<x-link href="{{ route($editRoute, $document->id) }}">
{{ trans('general.edit') }}
</x-link>
@endcan
@endif
@endif
@stack('edit_button_end')

View File

@ -0,0 +1,24 @@
<x-show.accordion type="children" :open="($accordionActive == 'children')">
<x-slot name="head">
<x-show.accordion.head
title="{{ trans_choice('general.invoices', 2) }}"
description="{!! trans('invoices.slider.children', ['count' => $document->children()->count()]) !!}"
/>
</x-slot>
<x-slot name="body" class="block" override="class">
<div class="flex my-3 space-x-2 rtl:space-x-reverse">
@if ($document->children()->count())
@foreach ($document->children() as $child)
@php $url = '<a href="' . route('transactions.show', $child->id) . '" class="text-purple" @click="e => e.target.classList.add(\'disabled\')">' . $child->number . '</a>' @endphp
<div class="my-2">
{{ trans('recurring.child', ['url' => $url, 'date' => company_date($child->due_at)]) }}
</div>
@endforeach
@else
{{ trans('general.none') }}
@endif
</div>
</x-slot>
</x-show.accordion>

View File

@ -1,157 +1,120 @@
@stack('content_header_start')
@if (!$hideHeader)
<x-documents.show.header
type="{{ $type }}"
:document="$document"
hide-header-status="{{ $hideHeaderStatus }}"
text-history-status="{{ $textHistoryStatus }}"
class-header-status="{{ $classHeaderStatus }}"
hide-header-contact="{{ $hideHeaderContact }}"
text-header-contact="{{ $textHeaderContact }}"
class-header-contact="{{ $classHeaderContact }}"
route-contact-show="{{ $routeContactShow }}"
hide-header-amount="{{ $hideHeaderAmount }}"
text-header-amount="{{ $textHeaderAmount }}"
class-header-amount="{{ $classHeaderAmount }}"
hide-header-due-at="{{ $hideHeaderDueAt }}"
text-header-due-at="{{ $textHeaderDueAt }}"
class-header-due-at="{{ $classHeaderDueAt }}"
/>
@endif
@stack('content_header_end')
<div class="flex flex-col lg:flex-row my-10 lg:space-x-24 rtl:space-x-reverse space-y-12 lg:space-y-0">
<div class="w-full lg:w-5/12 space-y-12">
@stack('recurring_message_start')
@stack('recurring_message_start')
@if (!$hideRecurringMessage)
<x-documents.show.recurring-message
type="{{ $type }}"
:document="$document"
text-recurring-type="{{ $textRecurringType }}"
/>
@endif
@stack('recurring_message_end')
@if (! $hideRecurringMessage)
@if (($recurring = $document->recurring) && ($next = $recurring->getNextRecurring()))
@php
$recurring_message = trans('recurring.message', [
'type' => mb_strtolower(trans_choice($textRecurringType, 1)),
'date' => $next->format(company_date_format())
]);
@endphp
@stack('status_message_start')
@if (!$hideStatusMessage)
<x-documents.show.status-message
type="{{ $type }}"
:document="$document"
text-status-message="{{ $textStatusMessage }}"
/>
@endif
@stack('status_message_end')
<x-documents.show.message type="recurring" background-color="bg-blue-100" text-color="text-blue-600" message="{{ $recurring_message }}" />
@endif
@stack('timeline_start')
@if (!$hideTimeline)
<x-documents.show.timeline
type="{{ $type }}"
:document="$document"
:hide-timeline-statuses="$hideTimelineStatuses"
hide-timeline-create="{{ $hideTimelineCreate }}"
text-timeline-create-title="{{ $textTimelineCreateTitle }}"
text-timeline-create-message="{{ $textTimelineCreateMessage }}"
hide-button-edit="{{ $hideButtonEdit }}"
permission-update="{{ $permissionUpdate }}"
route-button-edit="{{ $routeButtonEdit }}"
hide-timeline-sent="{{ $hideTimelineSent }}"
text-timeline-sent-title="{{ $textTimelineSentTitle }}"
text-timeline-sent-status-draft="{{ $textTimelineSentStatusDraft }}"
hide-button-sent="{{ $hideButtonSent }}"
route-button-sent="{{ $routeButtonSent }}"
text-timeline-sent-status-mark-sent="{{ $textTimelineSentStatusMarkSent }}"
hide-button-received="{{ $hideButtonReceived }}"
route-button-received="{{ $routeButtonReceived }}"
text-timeline-sent-status-received="{{ $textTimelineSentStatusReceived }}"
hide-button-email="{{ $hideButtonEmail }}"
route-button-email="{{ $routeButtonEmail }}"
text-timeline-send-status-mail="{{ $textTimelineSendStatusMail }}"
hide-button-share="{{ $hideButtonShare }}"
:signed-url="$signedUrl"
hide-timeline-paid="{{ $hideTimelinePaid }}"
text-timeline-get-paid-title="{{ $textTimelineGetPaidTitle }}"
text-timeline-get-paid-status-await="{{ $textTimelineGetPaidStatusAwait }}"
text-timeline-get-paid-status-partially-paid="{{ $textTimelineGetPaidStatusPartiallyPaid }}"
hide-button-paid="{{ $hideButtonPaid }}"
route-button-paid="{{ $routeButtonPaid }}"
text-timeline-get-paid-mark-paid="{{ $textTimelineGetPaidMarkPaid }}"
hide-button-add-payment="{{ $hideButtonAddPayment }}"
text-timeline-get-paid-add-payment="{{ $textTimelineGetPaidAddPayment }}"
/>
@endif
@stack('timeline_end')
@if (($parent = $document->parent))
@php
$recurring_message = trans('recurring.message_parent', [
'type' => mb_strtolower(trans_choice($textRecurringType, 1)),
'link' => '<a href="' . route(config('type.document.' . $document->paten->type . '.route.prefix', 'invoices') . '.show', $parent->id) . '"><u>' . $parent->id . '</u></a>'
]);
@endphp
@stack('document_start')
<x-documents.show.document
type="{{ $type }}"
:document="$document"
document-template="{{ $documentTemplate }}"
logo="{{ $logo }}"
background-color="{{ $backgroundColor }}"
hide-footer="{{ $hideFooter }}"
hide-company-logo="{{ $hideCompanyLogo }}"
hide-company-details="{{ $hideCompanyDetails }}"
hide-company-name="{{ $hideCompanyName }}"
hide-company-address="{{ $hideCompanyAddress }}"
hide-company-tax-number="{{ $hideCompanyTaxNumber }}"
hide-company-phone="{{ $hideCompanyPhone }}"
hide-company-email="{{ $hideCompanyEmail }}"
hide-contact-info="{{ $hideContactInfo }}"
hide-contact-name="{{ $hideContactName }}"
hide-contact-address="{{ $hideContactAddress }}"
hide-contact-tax-number="{{ $hideContactTaxNumber }}"
hide-contact-phone="{{ $hideContactPhone }}"
hide-contact-email="{{ $hideContactEmail }}"
hide-order-number="{{ $hideOrderNumber }}"
hide-document-number="{{ $hideDocumentNumber }}"
hide-issued-at="{{ $hideIssuedAt }}"
hide-due-at="{{ $hideDueAt }}"
text-contact-info="{{ $textContactInfo }}"
text-issued-at="{{ $textIssuedAt }}"
text-document-number="{{ $textDocumentNumber }}"
text-due-at="{{ $textDueAt }}"
text-order-number="{{ $textOrderNumber }}"
text-document-title="{{ $textDocumentTitle }}"
text-document-subheading="{{ $textDocumentSubheading }}"
hide-items="{{ $hideItems }}"
hide-name="{{ $hideName }}"
hide-description="{{ $hideDescription }}"
hide-quantity="{{ $hideQuantity }}"
hide-price="{{ $hidePrice }}"
hide-discount="{{ $hideDiscount }}"
hide-amount="{{ $hideAmount }}"
hide-note="{{ $hideNote }}"
text-items="{{ $textItems }}"
text-quantity="{{ $textQuantity }}"
text-price="{{ $textPrice }}"
text-amount="{{ $textAmount }}"
/>
@stack('document_end')
<x-documents.show.message type="recurring" background-color="bg-blue-100" text-color="text-blue-600" message="{{ $recurring_message }}" />
@endif
@endif
@stack('attachment_start')
@if (!$hideAttachment)
<x-documents.show.attachment
type="{{ $type }}"
:document="$document"
:attachment="$attachment"
/>
@endif
@stack('attachment_end')
@stack('recurring_message_end')
@stack('row_footer_start')
@if (!$hideFooter)
<x-documents.show.footer
type="{{ $type }}"
:document="$document"
:histories="$histories"
:transactions="$transactions"
class-footer-histories="{{ $classFooterHistories }}"
hide-footer-histories="{{ $hideFooterHistories }}"
text-histories="{{ $textHistories }}"
text-history-status="{{ $textHistoryStatus }}"
hide-footer-transactions="{{ $hideFooterTransactions }}"
class-footer-transactions="{{ $classFooterTransactions }}"
/>
@endif
@stack('row_footer_end')
@stack('status_message_start')
{{ Form::hidden('document_id', $document->id, ['id' => 'document_id']) }}
{{ Form::hidden($type . '_id', $document->id, ['id' => $type . '_id']) }}
@if (! $hideStatusMessage)
@if ($document->status == 'draft')
<x-documents.show.message type="status" background-color="bg-red-100" text-color="text-red-600" message="{!! trans($textStatusMessage) !!}" />
@endif
@endif
@stack('status_message_end')
@stack('create_start')
@if (! $hideCreated)
<x-documents.show.create type="{{ $type }}" :document="$document" />
@endif
@stack('create_end')
@stack('send_start')
@if (! $hideSend)
<x-documents.show.send type="{{ $type }}" :document="$document" />
@endif
@stack('send_end')
@stack('receive_start')
@if (! $hideReceive)
<x-documents.show.receive type="{{ $type }}" :document="$document" />
@endif
@stack('receive_end')
@stack('get_paid_start')
@if (! $hideGetPaid)
<x-documents.show.get-paid type="{{ $type }}" :document="$document" />
@endif
@stack('get_paid_end')
@stack('make_paid_start')
@if (! $hideMakePayment)
<x-documents.show.make-payment type="{{ $type }}" :document="$document" />
@endif
@stack('make_paid_end')
@stack('restore_start')
@if (! $hideRestore)
<x-documents.show.restore type="{{ $type }}" :document="$document" />
@endif
@stack('restore_end')
@stack('schedule_start')
@if (! $hideSchedule)
<x-documents.show.schedule type="{{ $type }}" :document="$document" />
@endif
@stack('schedule_end')
@stack('children_start')
@if (! $hideChildren)
<x-documents.show.children type="{{ $type }}" :document="$document" />
@endif
@stack('children_end')
@stack('attachment_start')
@if (! $hideAttachment)
<x-documents.show.attachment type="{{ $type }}" :document="$document" :attachment="$attachment" />
@endif
@stack('attachment_end')
</div>
<div class="w-full lg:w-7/12">
@stack('document_start')
<x-documents.show.template type="{{ $type }}" :document="$document" />
@stack('document_end')
</div>
<x-form.input.hidden name="document_id" :value="$document->id" />
<x-form.input.hidden name="{{ $type . '_id' }}" :value="$document->id" />
</div>

View File

@ -0,0 +1,19 @@
<x-show.accordion type="create" :open="($accordionActive == 'create')">
<x-slot name="head">
<x-show.accordion.head
title="{{ trans('general.create') }}"
description="{!! trans($description, [
'user' => $document->owner->name,
'date' => $created_date,
]) !!}"
/>
</x-slot>
<x-slot name="body">
<div class="flex">
<x-link href="{{ route($editRoute, $document->id) }}" @click="e => e.target.classList.add('disabled')">
{{ trans('general.edit') }}
</x-link>
</div>
</x-slot>
</x-show.accordion>

Some files were not shown because too many files have changed in this diff Show More