bank reconciliation

This commit is contained in:
denisdulici
2018-10-27 17:57:40 +03:00
parent 42f6b00485
commit 268a4aa9d5
29 changed files with 1209 additions and 88 deletions

View File

@ -38,6 +38,10 @@ return [
'numbers' => 'Number|Numbers',
'statuses' => 'Status|Statuses',
'others' => 'Other|Others',
'contacts' => 'Contact|Contacts',
'reconciliations' => 'Reconciliation|Reconciliations',
'deposits' => 'Deposit|Deposits',
'withdrawals' => 'Withdrawal|Withdrawals',
'dashboard' => 'Dashboard',
'banking' => 'Banking',
@ -106,6 +110,13 @@ return [
'disable' => 'Disable',
'select_all' => 'Select All',
'unselect_all' => 'Unselect All',
'create_date' => 'Create Date',
'period' => 'Period',
'start' => 'Start',
'end' => 'End',
'clear' => 'Clear',
'difference' => 'Difference',
'title' => [
'new' => 'New :type',
'edit' => 'Edit :type',

View File

@ -0,0 +1,14 @@
<?php
return [
'reconcile' => 'Reconcile',
'reconciled' => 'Reconciled',
'closing_balance' => 'Closing Balance',
'unreconciled' => 'Unreconciled',
'list_transactions' => 'List Transactions',
'start_date' => 'Start Date',
'end_date' => 'End Date',
'cleared_amount' => 'Cleared Amount',
];

View File

@ -41,7 +41,7 @@
<tbody>
@foreach($accounts as $item)
<tr>
<td><a href="{{ url('banking/accounts/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
<td><a href="{{ route('accounts.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="hidden-xs">{{ $item->number }}</td>
<td class="text-right amount-space">@money($item->balance, $item->currency_code, true)</td>
<td class="hidden-xs">
@ -57,7 +57,7 @@
<i class="fa fa-ellipsis-h"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{{ url('banking/accounts/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
<li><a href="{{ route('accounts.edit', $item->id) }}">{{ trans('general.edit') }}</a></li>
@if ($item->enabled)
<li><a href="{{ route('accounts.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
@else

View File

@ -0,0 +1,226 @@
@extends('layouts.admin')
@section('title', trans('general.title.new', ['type' => trans_choice('general.reconciliations', 1)]))
@section('content')
<div class="row">
{!! Form::open(['url' => 'banking/reconciliations/create', 'role' => 'form', 'method' => 'GET']) !!}
<div class="col-md-12">
<div class="box box-success">
<div class="box-body">
{{ Form::textGroup('started_at', trans('reconciliations.start_date'), 'calendar',['id' => 'started_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], request('started_at'), 'col-md-3') }}
{{ Form::textGroup('ended_at', trans('reconciliations.end_date'), 'calendar',['id' => 'ended_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], request('started_at'), 'col-md-3') }}
{{ Form::textGroup('closing_balance', trans('reconciliations.closing_balance'), 'money', ['required' => 'required', 'autofocus' => 'autofocus'], '0', 'col-md-2') }}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('general.default_account')), ['required' => 'required'], 'col-md-2') }}
<div class="form-group col-md-2">
<div class="input-group" style="margin-top: 25px;">
{!! Form::button('<span class="fa fa-list"></span> &nbsp;' . trans('reconciliations.list_transactions'), ['type' => 'submit', 'class' => 'btn btn-success']) !!}
</div>
</div>
</div>
<!-- /.box-body -->
</div>
</div>
{!! Form::close() !!}
<div class="col-md-12">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
<div class="box-body">
{!! Form::open(['url' => 'banking/reconciliations', 'role' => 'form', 'class' => 'form-loading-button', 'id' => 'form-reconciliations']) !!}
{{ 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']) }}
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th class="col-md-2">{{ trans('general.date') }}</th>
<th class="col-md-3">{{ trans('general.description') }}</th>
<th class="col-md-2">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-md-2 text-right">{{ trans_choice('general.deposits', 1) }}</th>
<th class="col-md-2 text-right">{{ trans_choice('general.withdrawals', 1) }}</th>
<th class="col-md-1 text-right">{{ trans('general.clear') }}</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td>{{ $item->description }}</td>
<td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td>
@if ((basename($item->model) == 'Invoice') || (basename($item->model) == 'Revenue'))
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td>&nbsp;</td>
@else
<td>&nbsp;</td>
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="text-right">{{ Form::checkbox('transactions['. $item->id . '_'. $item->model . ']', $item->amount, $item->reconciled) }}</td>
</tr>
@endforeach
</tbody>
</table>
@if ($transactions->count())
<table class="table">
<tbody>
<tr>
<th class="text-right">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-1 text-right">@money(request('closing_balance', '0'), $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
</tbody>
</table>
@endif
</div>
</div>
<div class="box-footer">
@if ($transactions->count())
<div class="form-group no-margin">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-default button-submit', 'data-loading-text' => trans('general.loading')]) !!}
{!! Form::button('<span class="fa fa-check"></span> &nbsp;' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
<a href="{{ route('reconciliations.index') }}" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>
</div>
@else
{{ trans('general.no_records') }}
@endif
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#closing_balance").maskMoney({
thousands : '{{ $currency->thousands_separator }}',
decimal : '{{ $currency->decimal_mark }}',
precision : {{ $currency->precision }},
allowZero : true,
@if($currency->symbol_first)
prefix : '{{ $currency->symbol }}'
@else
suffix : '{{ $currency->symbol }}'
@endif
});
$("#account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
//Date picker
$('#started_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$('#ended_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
});
$(document).on('change', '#account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency_code').val(data.currency_code);
amount = $('#closing_balance').maskMoney('unmasked')[0];
$("#closing_balance").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#closing_balance').val(amount);
$('#closing_balance').trigger('focus');
}
});
});
$(document).ready(function(){
$('#tbl-transactions input[type="checkbox"]').trigger('change');
});
$(document).on('change', '#tbl-transactions input[type="checkbox"]', function (e) {
amount = $('#closing_balance').maskMoney('unmasked')[0];
$('#form-reconciliations #closing_balance').val(amount);
$.ajax({
url: '{{ url("banking/reconciliations/calculate") }}',
type: 'POST',
dataType: 'JSON',
data: $('#form-reconciliations').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
if (data.difference_raw != 0) {
$('#button-reconcile').attr('disabled','disabled');
$('#difference').css('background-color', '#f2dede');
} else {
$('#button-reconcile').removeAttr('disabled');
$('#difference').css('background-color', '#d0e9c6');
}
$('#closing-balance').html(data.closing_balance);
$('#cleared-amount').html(data.cleared_amount);
$('#difference').html(data.difference);
}
}
});
});
$(document).on('click', '#button-reconcile', function (e) {
$('#hidden-reconcile').val(1);
$('#form-reconciliations').submit();
});
</script>
@endpush

View File

@ -0,0 +1,128 @@
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.reconciliations', 1)]))
@section('content')
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
<div class="box-body">
{!! Form::model($reconciliation, [
'method' => 'PATCH',
'url' => ['banking/reconciliations', $reconciliation->id],
'role' => 'form',
'id' => 'form-reconciliations',
'class' => 'form-loading-button'
]) !!}
{{ 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']) }}
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th class="col-md-2">{{ trans('general.date') }}</th>
<th class="col-md-3">{{ trans('general.description') }}</th>
<th class="col-md-2">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-md-2 text-right">{{ trans_choice('general.deposits', 1) }}</th>
<th class="col-md-2 text-right">{{ trans_choice('general.withdrawals', 1) }}</th>
<th class="col-md-1 text-right">{{ trans('general.clear') }}</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td>{{ $item->description }}</td>
<td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td>
@if ((basename($item->model) == 'Invoice') || (basename($item->model) == 'Revenue'))
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td>&nbsp;</td>
@else
<td>&nbsp;</td>
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="text-right">{{ Form::checkbox('transactions['. $item->id . '_'. $item->model . ']', $item->amount, $item->reconciled) }}</td>
</tr>
@endforeach
</tbody>
</table>
@if ($transactions->count())
<table class="table">
<tbody>
<tr>
<th class="text-right">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-1 text-right">@money($reconciliation->closing_balance, $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
</tbody>
</table>
@endif
</div>
</div>
<div class="box-footer">
@if ($transactions->count())
<div class="form-group no-margin">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-default button-submit', 'data-loading-text' => trans('general.loading')]) !!}
{!! Form::button('<span class="fa fa-check"></span> &nbsp;' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
<a href="{{ route('reconciliations.index') }}" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>
</div>
@else
{{ trans('general.no_records') }}
@endif
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$('#tbl-transactions input[type="checkbox"]').trigger('change');
});
$(document).on('change', '#tbl-transactions input[type="checkbox"]', function (e) {
$.ajax({
url: '{{ url("banking/reconciliations/calculate") }}',
type: 'POST',
dataType: 'JSON',
data: $('#form-reconciliations').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
if (data.difference_raw != 0) {
$('#button-reconcile').attr('disabled','disabled');
$('#difference').css('background-color', '#f2dede');
} else {
$('#button-reconcile').removeAttr('disabled');
$('#difference').css('background-color', '#d0e9c6');
}
$('#closing-balance').html(data.closing_balance);
$('#cleared-amount').html(data.cleared_amount);
$('#difference').html(data.difference);
}
}
});
});
$(document).on('click', '#button-reconcile', function (e) {
$('#hidden-reconcile').val(1);
$('#form-reconciliations').submit();
});
</script>
@endpush

View File

@ -0,0 +1,85 @@
@extends('layouts.admin')
@section('title', trans_choice('general.reconciliations', 2))
@permission('create-banking-reconciliations')
@section('new_button')
<span class="new-button"><a href="{{ route('reconciliations.create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@endpermission
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'banking/reconciliations', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-left">
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::select('account', $accounts, request('account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
<span class="title-filter hidden-xs">{{ trans('general.show') }}:</span>
{!! Form::select('limit', $limits, request('limit', setting('general.list_limit', '25')), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
</div>
{!! Form::close() !!}
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-reconciliations">
<thead>
<tr>
<th class="col-md-2">@sortablelink('created_at', trans('general.create_date'))</th>
<th class="col-md-3">@sortablelink('account_id', trans_choice('general.accounts', 1))</th>
<th class="col-md-3 hidden-xs">{{ trans('general.period') }}</th>
<th class="col-md-2 text-right amount-space">@sortablelink('closing_balance', trans('reconciliations.closing_balance'))</th>
<th class="col-md-1 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</th>
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($reconciliations as $item)
<tr>
<td><a href="{{ route('reconciliations.edit', $item->id) }}">{{ Date::parse($item->created_at)->format($date_format) }}</a></td>
<td>{{ $item->account->name }}</td>
<td class="hidden-xs">{{ Date::parse($item->started_at)->format($date_format) }} - {{ Date::parse($item->ended_at)->format($date_format) }}</td>
<td class="text-right amount-space">@money($item->closing_balance, $item->account->currency_code, true)</td>
<td class="hidden-xs">
@if ($item->reconciled)
<span class="label label-success">{{ trans('reconciliations.reconciled') }}</span>
@else
<span class="label label-danger">{{ trans('reconciliations.unreconciled') }}</span>
@endif
</td>
<td class="text-center">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
<i class="fa fa-ellipsis-h"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{{ route('reconciliations.edit', $item->id) }}">{{ trans('general.edit') }}</a></li>
@permission('delete-banking-reconciliations')
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'banking/reconciliations') !!}</li>
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $reconciliations, 'type' => 'reconciliations'])
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection

View File

@ -61,14 +61,18 @@
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{{ url('expenses/bills/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@if ($item->paid && !$item->reconciled)
<li><a href="{{ url('expenses/bills/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
<li class="divider"></li>
@endif
@permission('create-expenses-bills')
<li><a href="{{ url('expenses/bills/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
<li class="divider"></li>
<li><a href="{{ url('expenses/bills/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-expenses-bills')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'expenses/bills') !!}</li>
@endif
@endpermission
</ul>
</div>

View File

@ -160,9 +160,11 @@
<div class="box-footer row no-print">
<div class="col-xs-12">
@if(!$bill->reconciled)
<a href="{{ url('expenses/bills/' . $bill->id . '/edit') }}" class="btn btn-default">
<i class="fa fa-pencil-square-o"></i>&nbsp; {{ trans('general.edit') }}
</a>
@endif
<a href="{{ url('expenses/bills/' . $bill->id . '/print') }}" target="_blank" class="btn btn-success">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a>
@ -170,7 +172,9 @@
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-circle-up"></i>&nbsp; {{ trans('general.more_actions') }}</button>
<ul class="dropdown-menu" role="menu">
@if($bill->status->code != 'paid')
@if(empty($bill->paid) || ($bill->paid != $bill->amount))
<li><a href="#" id="button-payment">{{ trans('bills.add_payment') }}</a></li>
@endif
@permission('update-expenses-bills')
@if($bill->bill_status_code == 'draft')
<li><a href="{{ url('expenses/bills/' . $bill->id . '/received') }}">{{ trans('bills.mark_received') }}</a></li>
@ -181,9 +185,11 @@
<li class="divider"></li>
@endif
<li><a href="{{ url('expenses/bills/' . $bill->id . '/pdf') }}">{{ trans('bills.download_pdf') }}</a></li>
<li class="divider"></li>
@permission('delete-expenses-bills')
@if(!$bill->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($bill, 'expenses/bills') !!}</li>
@endif
@endpermission
</ul>
</div>
@ -276,6 +282,11 @@
<td>@money($payment->amount, $payment->currency_code, true)</td>
<td>{{ $payment->account->name }}</td>
<td>
@if ($payment->reconciled)
<button type="button" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" title="{{ trans('reconciliations.reconciled') }}">
<i class="fa fa-check"></i>
</button>
@else
<a href="{{ url('expenses/bills/' . $payment->id) }}" class="btn btn-info btn-xs hidden"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a>
<a href="{{ url('expenses/bills/' . $payment->id . '/edit') }}" class="btn btn-primary btn-xs hidden"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a>
{!! Form::open([
@ -291,6 +302,7 @@
'onclick' => 'confirmDelete("' . '#bill-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '</strong>', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
)) !!}
{!! Form::close() !!}
@endif
</td>
</tr>
@endforeach

View File

@ -47,7 +47,11 @@
<tbody>
@foreach($payments as $item)
<tr>
@if ($item->reconciled)
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
@else
<td><a href="{{ url('expenses/payments/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
@endif
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ !empty($item->vendor->name) ? $item->vendor->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->category->name }}</td>
@ -59,14 +63,18 @@
<i class="fa fa-ellipsis-h"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right">
@if (!$item->reconciled)
<li><a href="{{ url('expenses/payments/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@permission('create-expenses-payments')
<li class="divider"></li>
@endif
@permission('create-expenses-payments')
<li><a href="{{ url('expenses/payments/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-expenses-payments')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'expenses/payments') !!}</li>
@endif
@endpermission
</ul>
</div>

View File

@ -60,14 +60,18 @@
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{{ url('incomes/invoices/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@if ($item->paid && !$item->reconciled)
<li><a href="{{ url('incomes/invoices/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@endif
@permission('create-incomes-invoices')
<li class="divider"></li>
<li><a href="{{ url('incomes/invoices/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
<li class="divider"></li>
@permission('delete-incomes-invoices')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'incomes/invoices') !!}</li>
@endif
@endpermission
</ul>
</div>

View File

@ -162,9 +162,11 @@
<div class="box-footer row no-print">
<div class="col-md-12">
@if(!$invoice->reconciled)
<a href="{{ url('incomes/invoices/' . $invoice->id . '/edit') }}" class="btn btn-default">
<i class="fa fa-pencil-square-o"></i>&nbsp; {{ trans('general.edit') }}
</a>
@endif
<a href="{{ url('incomes/invoices/' . $invoice->id . '/print') }}" target="_blank" class="btn btn-success">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a>
@ -178,7 +180,7 @@
@permission('update-incomes-invoices')
<li><a href="{{ url('incomes/invoices/' . $invoice->id . '/pay') }}">{{ trans('invoices.mark_paid') }}</a></li>
@endpermission
@if(empty($invoice->payments()->count()) || (!empty($invoice->payments()->count()) && $invoice->paid != $invoice->amount))
@if(empty($invoice->paid) || ($invoice->paid != $invoice->amount))
<li><a href="#" id="button-payment">{{ trans('invoices.add_payment') }}</a></li>
@endif
<li class="divider"></li>
@ -197,9 +199,11 @@
@endif
<li class="divider"></li>
<li><a href="{{ url('incomes/invoices/' . $invoice->id . '/pdf') }}">{{ trans('invoices.download_pdf') }}</a></li>
<li class="divider"></li>
@permission('delete-incomes-invoices')
@if(!$invoice->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($invoice, 'incomes/invoices') !!}</li>
@endif
@endpermission
</ul>
</div>
@ -292,6 +296,11 @@
<td>@money($payment->amount, $payment->currency_code, true)</td>
<td>{{ $payment->account->name }}</td>
<td>
@if ($payment->reconciled)
<button type="button" class="btn btn-default btn-xs">
<i class="fa fa-check"></i> {{ trans('reconciliations.reconciled') }}
</button>
@else
<a href="{{ url('incomes/invoices/' . $payment->id . '') }}" class="btn btn-info btn-xs hidden"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a>
<a href="{{ url('incomes/revenues/' . $payment->id . '/edit') }}" class="btn btn-primary btn-xs hidden"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a>
{!! Form::open([
@ -307,6 +316,7 @@
'onclick' => 'confirmDelete("' . '#invoice-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '</strong>', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
)) !!}
{!! Form::close() !!}
@endif
</td>
</tr>
@endforeach

View File

@ -47,7 +47,11 @@
<tbody>
@foreach($revenues as $item)
<tr>
@if ($item->reconciled)
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
@else
<td><a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
@endif
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ !empty($item->customer->name) ? $item->customer->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->category->name }}</td>
@ -59,14 +63,18 @@
<i class="fa fa-ellipsis-h"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right">
@if (!$item->reconciled)
<li><a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@permission('create-incomes-revenues')
<li class="divider"></li>
@endif
@permission('create-incomes-revenues')
<li><a href="{{ url('incomes/revenues/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-incomes-revenues')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'incomes/revenues') !!}</li>
@endif
@endpermission
</ul>
</div>

View File

@ -77,6 +77,9 @@
@permission('create-banking-transfers')
<li><a href="{{ url('banking/transfers/create') }}">{{ trans_choice('general.transfers', 1) }}</a></li>
@endpermission
@permission('create-banking-reconciliations')
<li><a href="{{ url('banking/reconciliations/create') }}">{{ trans_choice('general.reconciliations', 1) }}</a></li>
@endpermission
</ul>
</li>
</ul>