79 lines
4.1 KiB
PHP
Raw Normal View History

2017-09-14 22:21:00 +03:00
@extends('layouts.admin')
@section('title', trans_choice('general.transactions', 2))
2019-11-16 10:21:14 +03:00
@section('new_button')
2020-01-19 10:46:46 +03:00
@permission('create-sales-revenues')
2020-04-22 12:48:51 +03:00
<a href="{{ route('revenues.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_income') }}</a>
2020-01-19 10:46:46 +03:00
@endpermission
@permission('create-purchases-payments')
2020-04-22 12:48:51 +03:00
<a href="{{ route('payments.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_expense') }}</a>
2020-01-19 10:46:46 +03:00
@endpermission
2020-04-22 12:48:51 +03:00
<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>
2019-11-16 10:21:14 +03:00
@endsection
2017-09-14 22:21:00 +03:00
@section('content')
2019-11-16 10:21:14 +03:00
<div class="card">
<div class="card-header border-bottom-0">
{!! Form::open([
2020-02-21 15:09:43 +03:00
'method' => 'GET',
2020-01-21 18:13:29 +03:00
'route' => 'transactions.index',
2019-11-16 10:21:14 +03:00
'role' => 'form',
'class' => 'mb-0'
]) !!}
2020-02-21 15:09:43 +03:00
<akaunting-search
:placeholder="'{{ trans('general.search_placeholder') }}'"
:options="{{ json_encode([]) }}"
></akaunting-search>
2019-11-16 10:21:14 +03:00
{!! Form::close() !!}
2017-09-14 22:21:00 +03:00
</div>
2019-11-16 10:21:14 +03:00
<div class="table-responsive">
2020-01-21 16:02:01 +03:00
<table class="table table-flush table-hover">
2019-11-16 10:21:14 +03:00
<thead class="thead-light">
<tr class="row table-head-line">
2019-12-16 17:03:53 +03:00
<th class="col-sm-2 col-md-2 d-none d-sm-block">@sortablelink('paid_at', trans('general.date'))</th>
2019-11-16 10:21:14 +03:00
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('type', trans_choice('general.types', 1))</th>
2019-12-16 17:03:53 +03:00
<th class="col-sm-2 col-md-2 d-none d-sm-block">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-md-2 d-none d-md-block">@sortablelink('description', trans('general.description'))</th>
2019-11-16 10:21:14 +03:00
<th class="col-xs-4 col-sm-2 col-md-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
2017-09-14 22:21:00 +03:00
</tr>
</thead>
2019-11-16 10:21:14 +03:00
2017-09-14 22:21:00 +03:00
<tbody>
2019-11-16 10:21:14 +03:00
@foreach($transactions as $item)
2020-02-09 16:06:06 +03:00
<tr class="row align-items-center border-top-1 tr-py">
2019-12-16 17:03:53 +03:00
<td class="col-sm-2 col-md-2 d-none d-sm-block">@date($item->paid_at)</td>
2019-11-16 10:21:14 +03:00
<td class="col-xs-4 col-sm-3 col-md-2">{{ $item->account->name }}</td>
<td class="col-xs-4 col-sm-3 col-md-2">{{ trans_choice('general.' . Str::plural($item->type), 1) }}</td>
2019-12-16 17:03:53 +03:00
<td class="col-sm-2 col-md-2 d-none d-sm-block">{{ $item->category->name }}</td>
<td class="col-md-2 d-none d-md-block long-texts">{{ $item->description }}</td>
2019-12-03 10:07:52 +05:30
<td class="col-xs-4 col-sm-2 col-md-2 text-right">
2019-12-12 12:22:52 +03:00
@php
2020-01-21 16:02:01 +03:00
$id = !empty($item->document_id) ? $item->document_id : $item->id;
$route = ($item->type == 'income') ? (!empty($item->document_id) ? 'invoices.show' : 'revenues.edit') : (!empty($item->document_id) ? 'bills.show' : 'payments.edit');
2019-12-12 12:22:52 +03:00
@endphp
2020-01-22 19:03:34 +03:00
<a href="{{ route($route, $id) }}">
2019-12-03 10:07:52 +05:30
@money($item->amount, $item->currency_code, true)
</a>
</td>
2019-11-16 10:21:14 +03:00
</tr>
@endforeach
2017-09-14 22:21:00 +03:00
</tbody>
</table>
</div>
2019-11-16 10:21:14 +03:00
<div class="card-footer table-action">
<div class="row">
2019-12-24 17:53:18 +03:00
@include('partials.admin.pagination', ['items' => $transactions])
2019-11-16 10:21:14 +03:00
</div>
</div>
2017-09-14 22:21:00 +03:00
</div>
@endsection
2019-11-16 10:21:14 +03:00
@push('scripts_start')
<script src="{{ asset('public/js/banking/transactions.js?v=' . version('short')) }}"></script>
2018-11-02 11:32:42 +03:00
@endpush