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,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>