akaunting 3.0 (the last dance)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user