v2 first commit
This commit is contained in:
@@ -3,97 +3,49 @@
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.accounts', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::open(['url' => 'banking/accounts', 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
||||
<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
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
|
||||
{{ Form::textGroup('number', trans('accounts.number'), 'pencil') }}
|
||||
{{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }}
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
|
||||
|
||||
{{ Form::textGroup('opening_balance', trans('accounts.opening_balance'), 'money', ['required' => 'required'], 0) }}
|
||||
{{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency], 0) }}
|
||||
|
||||
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
|
||||
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
|
||||
|
||||
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
|
||||
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
|
||||
|
||||
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
|
||||
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
|
||||
|
||||
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
|
||||
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('banking/accounts') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('banking/accounts') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#opening_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
|
||||
});
|
||||
|
||||
$("#opening_balance").focusout();
|
||||
|
||||
$('#enabled_1').trigger('click');
|
||||
|
||||
$('#name').focus();
|
||||
|
||||
$("#currency_code").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '#currency_code', function (e) {
|
||||
$.ajax({
|
||||
url: '{{ url("settings/currencies/currency") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: 'code=' + $(this).val(),
|
||||
success: function(data) {
|
||||
$('#currency').val(data.code);
|
||||
|
||||
$('#currency_code').val(data.code);
|
||||
$('#currency_rate').val(data.rate);
|
||||
|
||||
opening_balance = $('#opening_balance').maskMoney('unmasked')[0];
|
||||
|
||||
$("#opening_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
|
||||
});
|
||||
|
||||
$('#opening_balance').val(opening_balance);
|
||||
|
||||
$('#opening_balance').trigger('focusout');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -3,100 +3,52 @@
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.accounts', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
<div class="card">
|
||||
{!! Form::model($account, [
|
||||
'id' => 'account',
|
||||
'method' => 'PATCH',
|
||||
'url' => ['banking/accounts', $account->id],
|
||||
'route' => ['accounts.update', $account->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button'
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
|
||||
{{ Form::textGroup('number', trans('accounts.number'), 'pencil') }}
|
||||
{{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies) }}
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $account->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
|
||||
|
||||
{{ Form::textGroup('opening_balance', trans('accounts.opening_balance'), 'money') }}
|
||||
{{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency], $account->opening_balance) }}
|
||||
|
||||
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
|
||||
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
|
||||
|
||||
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
|
||||
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
|
||||
|
||||
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
|
||||
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
|
||||
|
||||
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
|
||||
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@permission('update-banking-accounts')
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('banking/accounts') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
@endpermission
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@permission('update-banking-accounts')
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('banking/accounts') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#opening_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
|
||||
});
|
||||
|
||||
$("#opening_balance").focusout();
|
||||
|
||||
$("#currency_code").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '#currency_code', function (e) {
|
||||
$.ajax({
|
||||
url: '{{ url("settings/currencies/currency") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: 'code=' + $(this).val(),
|
||||
success: function(data) {
|
||||
$('#currency').val(data.code);
|
||||
|
||||
$('#currency_code').val(data.code);
|
||||
$('#currency_rate').val(data.rate);
|
||||
|
||||
opening_balance = $('#opening_balance').maskMoney('unmasked')[0];
|
||||
|
||||
$("#opening_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
|
||||
});
|
||||
|
||||
$('#opening_balance').val(opening_balance);
|
||||
|
||||
$('#opening_balance').trigger('focusout');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -2,91 +2,93 @@
|
||||
|
||||
@section('title', trans_choice('general.accounts', 2))
|
||||
|
||||
@permission('create-banking-accounts')
|
||||
@section('new_button')
|
||||
<span class="new-button"><a href="{{ url('banking/accounts/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
@permission('create-banking-accounts')
|
||||
<span><a href="{{ route('accounts.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
@endpermission
|
||||
@endsection
|
||||
@endpermission
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
{!! Form::open(['url' => 'banking/accounts', 'role' => 'form', 'method' => 'GET']) !!}
|
||||
<div class="pull-left">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
|
||||
{!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
|
||||
{!! Form::button('<span class="fa fa-filter"></span> ' . 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="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'banking/accounts',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 card-header-search card-header-space">
|
||||
<span class="table-text hidden-lg card-header-search-text">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-accounts">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-4">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-md-3 hidden-xs">@sortablelink('number', trans('accounts.number'))</th>
|
||||
<th class="col-md-3 text-right amount-space">@sortablelink('opening_balance', trans('accounts.current_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>
|
||||
{{ Form::bulkActionRowGroup('general.accounts', $bulk_actions, 'banking/accounts') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-3 col-xl-4">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-md-2 col-lg-2 col-xl-2 text-center hidden-md">@sortablelink('number', trans('accounts.number'))</th>
|
||||
<th class="col-sm-2 col-md-2 col-lg-3 col-xl-3 text-right hidden-sm">@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-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($accounts as $item)
|
||||
<tr>
|
||||
@if ($auth_user->can('read-reports-income-expense-summary'))
|
||||
<td><a href="{{ url('reports/income-expense-summary?accounts[]=' . $item->id) }}">{{ $item->name }}</a></td>
|
||||
@else
|
||||
<td><a href="{{ route('accounts.edit', $item->id) }}">{{ $item->name }}</a></td>
|
||||
@endif
|
||||
<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">
|
||||
@if ($item->enabled)
|
||||
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
||||
@else
|
||||
<span class="label label-danger">{{ trans('general.disabled') }}</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('accounts.edit', $item->id) }}">{{ trans('general.edit') }}</a></li>
|
||||
@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 hidden-sm">
|
||||
{{ Form::bulkActionGroup($item->id, $item->name) }}
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-3 col-xl-4"><a class="col-aka text-success" href="{{ route('accounts.edit', $item->id) }}">{{ $item->name }}</a></td>
|
||||
<td class="col-md-2 col-lg-2 col-xl-2 text-center hidden-md">{{ $item->number }}</td>
|
||||
<td class="col-sm-2 col-md-2 col-lg-3 col-xl-3 text-right hidden-sm">@money($item->balance, $item->currency_code, true)</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-1">
|
||||
@if (user()->can('update-banking-accounts'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<li><a href="{{ route('accounts.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
|
||||
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
|
||||
@else
|
||||
<li><a href="{{ route('accounts.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
|
||||
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
|
||||
@endif
|
||||
@permission('delete-banking-accounts')
|
||||
<li class="divider"></li>
|
||||
<li>{!! Form::deleteLink($item, 'banking/accounts') !!}</li>
|
||||
@endpermission
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center border-0">
|
||||
<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('accounts.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@permission('delete-banking-accounts')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'banking/accounts') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
@include('partials.admin.pagination', ['items' => $accounts, 'type' => 'accounts'])
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $accounts, 'type' => 'accounts'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -3,227 +3,133 @@
|
||||
@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="card">
|
||||
{!! Form::open([
|
||||
'url' => 'banking/reconciliations/create',
|
||||
'id' => 'reconciliation',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button mb-0',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<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') }}
|
||||
<div class="card-body">
|
||||
<div class="form-row align-items-center">
|
||||
{{ Form::dateGroup('started_at', trans('reconciliations.start_date'), 'calendar',['id' => 'started_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request('started_at'), 'col-xl-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::dateGroup('ended_at', trans('reconciliations.end_date'), 'calendar',['id' => 'ended_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request('started_at'), 'col-xl-3') }}
|
||||
|
||||
{{ Form::textGroup('closing_balance', trans('reconciliations.closing_balance'), 'money', ['required' => 'required', 'autofocus' => 'autofocus'], '0', 'col-md-2') }}
|
||||
{{ Form::moneyGroup('closing_balance', trans('reconciliations.closing_balance'), 'balance-scale', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], '0', 'col-xl-2') }}
|
||||
|
||||
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('general.default_account')), ['required' => 'required'], 'col-md-2') }}
|
||||
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('default.account')), ['required' => 'required'], 'col-xl-2') }}
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<div class="input-group" style="margin-top: 25px;">
|
||||
{!! Form::button('<span class="fa fa-list"></span> ' . trans('reconciliations.list_transactions'), ['type' => 'submit', 'class' => 'btn btn-success']) !!}
|
||||
<div class="col-xl-2">
|
||||
<div class="input-group mt-1">
|
||||
{!! Form::button('<span class="fa fa-list"></span> ' . trans('reconciliations.transactions'), ['type' => 'submit', 'class' => 'btn btn-success header-button-top']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<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']) !!}
|
||||
<div class="card">
|
||||
<div class="card-header border-0">
|
||||
<h3 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h3>
|
||||
</div>
|
||||
|
||||
{{ 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('reconciliations.deposit') }}</th>
|
||||
<th class="col-md-2 text-right">{{ trans('reconciliations.withdrawal') }}</th>
|
||||
<th class="col-md-1 text-right">{{ trans('general.clear') }}</th>
|
||||
{!! Form::open([
|
||||
'url' => 'banking/reconciliations',
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'id' => 'form-reconciliations',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
|
||||
{{ 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-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 o-y">{{ trans('general.date') }}</th>
|
||||
<th class="col-md-2 text-center hidden-md">{{ trans('general.description') }}</th>
|
||||
<th class="col-md-2 col-sm-3 col-md-3 hidden-sm">{{ 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 o-y">{{ trans('reconciliations.withdrawal') }}</th>
|
||||
<th class="col-md-1 text-right hidden-md">{{ trans('general.clear') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<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 o-y">@date($item->paid_at)</td>
|
||||
<td class="col-md-2 text-center hidden-md">{{ $item->description }}</td>
|
||||
<td class="col-sm-3 col-md-3 hidden-sm">{{ $item->contact->name }}</td>
|
||||
@if ($item->type == 'income')
|
||||
<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 hidden-md">{{ Form::checkbox('transactions['. $item->id . '_'. $item->type . ']', $item->amount, $item->reconciled) }}</td>
|
||||
</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 (($item->model == 'App\Models\Income\InvoicePayment') || ($item->model == 'App\Models\Income\Revenue'))
|
||||
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td> </td>
|
||||
@else
|
||||
<td> </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>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@if ($transactions->count())
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr class="row">
|
||||
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('reconciliations.closing_balance') }}:</th>
|
||||
<td id="closing-balance" class="col-md-3 col-lg-1 text-right hidden-md">@money(request('closing_balance', '0'), $account->currency_code, true)</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('reconciliations.cleared_amount') }}:</th>
|
||||
<td id="cleared-amount" class="col-md-3 col-lg-1 text-right hidden-md">@money('0', $account->currency_code, true)</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('general.difference') }}:</th>
|
||||
<td id="difference" class="col-md-3 col-lg-1 text-right hidden-md">@money('0', $account->currency_code, true)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@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>
|
||||
<div class="float-right">
|
||||
<a href="{{ route('reconciliations.index') }}" class="btn btn-outline-secondary header-button-top"><span class="fa fa-times"></span> {{ trans('general.cancel') }}</a>
|
||||
{!! Form::button('<span class="fa fa-check"></span> ' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-info button-submit header-button-top', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
|
||||
{!! Form::button('<span class="fa fa-save"></span> ' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-success button-submit header-button-top', 'data-loading-text' => trans('general.loading')]) !!}
|
||||
</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>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
@if ($transactions->count())
|
||||
<div class="form-group no-margin">
|
||||
{!! Form::button('<span class="fa fa-save"></span> ' . 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> ' . 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> {{ trans('general.cancel') }}</a>
|
||||
</div>
|
||||
@else
|
||||
{{ trans('general.no_records') }}
|
||||
@endif
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
|
||||
@if (language()->getShortCode() != 'en')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
|
||||
@endif
|
||||
@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,
|
||||
allowNegative: 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>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
@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'
|
||||
]) !!}
|
||||
<div class="card">
|
||||
{!! Form::model($reconciliation, [
|
||||
'method' => 'PATCH',
|
||||
'url' => ['banking/reconciliations', $reconciliation->id],
|
||||
'role' => 'form',
|
||||
'id' => 'form-reconciliations',
|
||||
'class' => 'form-loading-button mb-0'
|
||||
]) !!}
|
||||
|
||||
<div class="card-header border-0">
|
||||
<h3 class="box-title">{{ trans_choice('general.transactions', 2) }}</h3>
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('account_id', $account->id) }}
|
||||
{{ Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) }}
|
||||
@@ -23,106 +23,73 @@
|
||||
{{ 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('reconciliations.deposit') }}</th>
|
||||
<th class="col-md-2 text-right">{{ trans('reconciliations.withdrawal') }}</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 (($item->model == 'App\Models\Income\InvoicePayment') || ($item->model == 'App\Models\Income\Revenue'))
|
||||
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td> </td>
|
||||
@else
|
||||
<td> </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>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table align-items-center table-flush">
|
||||
<thead class="thead-light">
|
||||
<tr class="row">
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 o-y">{{ trans('general.date') }}</th>
|
||||
<th class="col-md-2 text-center hidden-md">{{ trans('general.description') }}</th>
|
||||
<th class="col-md-2 col-sm-3 col-md-3 hidden-sm">{{ 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 o-y">{{ trans('reconciliations.withdrawal') }}</th>
|
||||
<th class="col-md-1 text-right hidden-md">{{ trans('general.clear') }}</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($transactions as $item)
|
||||
<tr class="row">
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 o-y">@date($item->paid_at)</td>
|
||||
<td class="col-md-2 text-center hidden-md">{{ $item->description }}</td>
|
||||
<td class="col-sm-3 col-md-3 hidden-sm">{{ $item->contact->name }}</td>
|
||||
@if ($item->type == 'income')
|
||||
<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"> </td>
|
||||
@else
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 text-right"> </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 hidden-md">{{ Form::checkbox('transactions['. $item->id . '_'. $item->type . ']', $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>
|
||||
<tr class="row">
|
||||
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ 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 class="row">
|
||||
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('reconciliations.cleared_amount') }}:</th>
|
||||
<td id="cleared-amount" class="col-md-3 col-lg-1 text-right hidden-md">@money('0', $account->currency_code, true)</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('general.difference') }}:</th>
|
||||
<td id="difference" class="col-md-3 col-lg-1 text-right hidden-md">@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> ' . 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> ' . 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> {{ trans('general.cancel') }}</a>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
@if ($transactions->count())
|
||||
<a href="{{ route('reconciliations.index') }}" class="btn btn-outline-secondary header-button-top"><span class="fa fa-times"></span> {{ trans('general.cancel') }}</a>
|
||||
{!! Form::button('<span class="fa fa-check"></span> ' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-info button-submit header-button-top', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
|
||||
{!! Form::button('<span class="fa fa-save"></span> ' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-success button-submit header-button-top', 'data-loading-text' => trans('general.loading')]) !!}
|
||||
@else
|
||||
<small>{{ trans('general.no_records') }}</small>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
{{ trans('general.no_records') }}
|
||||
@endif
|
||||
</div>
|
||||
</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>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -2,93 +2,93 @@
|
||||
|
||||
@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> {{ trans('general.add_new') }}</a></span>
|
||||
@permission('create-banking-reconciliations')
|
||||
<span><a href="{{ route('reconciliations.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
@endpermission
|
||||
@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 id="items" class="pull-left box-filter">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
|
||||
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
|
||||
{!! Form::button('<span class="fa fa-filter"></span> ' . 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="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'banking/reconciliations',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 card-header-search">
|
||||
<span class="table-text hidden-lg">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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.created_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>
|
||||
{{ Form::bulkActionRowGroup('general.reconciliations', $bulk_actions, 'banking/reconciliations') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-1 col-lg-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-sm-3 col-md-2 col-lg-2 hidden-sm">@sortablelink('created_at', trans('general.created_date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-3 col-lg-3">@sortablelink('account_id', trans_choice('general.accounts', 1))</th>
|
||||
<th class="col-lg-2 hidden-lg">{{ trans('general.period') }}</th>
|
||||
<th class="col-md-2 col-lg-2 hidden-md text-right">@sortablelink('closing_balance', trans('reconciliations.closing_balance'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<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
|
||||
@foreach($reconciliations as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-1 col-lg-1 hidden-sm">{{ Form::bulkActionGroup($item->id, $item->account->name) }}</td>
|
||||
<td class="col-sm-3 col-md-2 col-lg-2 hidden-sm"><a class="col-aka text-success" href="{{ route('reconciliations.edit', $item->id) }}">@date($item->created_at)</a></td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-3 col-lg-3">{{ $item->account->name }}</td>
|
||||
<td class="col-lg-2 hidden-lg border-0">@date($item->started_at) - @date($item->ended_at)</td>
|
||||
<td class="col-md-2 col-lg-2 hidden-md 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-1">
|
||||
@if (user()->can('update-banking-reconciliations'))
|
||||
{{ Form::enabledGroup($item->id, $item->account->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
|
||||
@else
|
||||
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h text-muted"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
<a class="dropdown-item" href="{{ route('reconciliations.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@permission('delete-banking-reconciliations')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'banking/reconciliations') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
@include('partials.admin.pagination', ['items' => $reconciliations, 'type' => 'reconciliations'])
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $reconciliations, 'type' => 'reconciliations'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#filter-accounts").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -2,88 +2,65 @@
|
||||
|
||||
@section('title', trans_choice('general.transactions', 2))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
{!! Form::open(['url' => 'banking/transactions', 'role' => 'form', 'method' => 'GET']) !!}
|
||||
<div id="items" class="pull-left box-filter">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
|
||||
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
|
||||
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
|
||||
{!! Form::select('type', $types, request('type'), ['class' => 'form-control input-filter input-sm']) !!}
|
||||
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
|
||||
{!! Form::button('<span class="fa fa-filter"></span> ' . 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 -->
|
||||
@section('new_button')
|
||||
<span><a href="{{ route('import.create', ['banking', 'transactions']) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload "></span> {{ trans('import.import') }}</a></span>
|
||||
<span><a href="{{ route('transactions.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> {{ trans('general.export') }}</a></span>
|
||||
@endsection
|
||||
|
||||
<div class="box-body">
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-transactions">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-2">@sortablelink('paid_at', trans('general.date'))</th>
|
||||
<th class="col-md-2">@sortablelink('account_name', trans('accounts.account_name'))</th>
|
||||
<th class="col-md-2">@sortablelink('type', trans_choice('general.types', 1))</th>
|
||||
<th class="col-md-2">@sortablelink('category_name', trans_choice('general.categories', 1))</th>
|
||||
<th class="col-md-2">@sortablelink('description', trans('general.description'))</th>
|
||||
<th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0">
|
||||
{!! Form::open([
|
||||
'url' => 'banking/transactions',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row">
|
||||
<div class="col-12 card-header-search">
|
||||
<span class="table-text hidden-lg">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-2 hidden-sm">@sortablelink('paid_at', trans('general.date'))</th>
|
||||
<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>
|
||||
<th class="col-sm-2 col-md-2 hidden-sm">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
|
||||
<th class="col-md-2 hidden-md">@sortablelink('description', trans('general.description'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($transactions as $item)
|
||||
<tr>
|
||||
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
|
||||
<td>{{ $item->account_name }}</td>
|
||||
<td>{{ $item->type }}</td>
|
||||
<td>{{ $item->category_name }}</td>
|
||||
<td>{{ $item->description }}</td>
|
||||
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach($transactions as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-2 hidden-sm">@date($item->paid_at)</td>
|
||||
<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>
|
||||
<td class="col-sm-2 col-md-2 hidden-sm">{{ $item->category->name }}</td>
|
||||
<td class="col-md-2 hidden-md">{{ $item->description }}</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
|
||||
@if (language()->getShortCode() != 'en')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
|
||||
@endif
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#filter-accounts").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
|
||||
});
|
||||
|
||||
$("#filter-categories").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/transactions.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -3,117 +3,48 @@
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.transfers', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::open(['url' => 'banking/transfers', 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
||||
<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
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts) }}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts, null, ['required' => 'required', 'change' => 'onChangeAccount']) }}
|
||||
|
||||
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts) }}
|
||||
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts) }}
|
||||
|
||||
{{ Form::textGroup('amount', trans('general.amount'), 'money') }}
|
||||
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency], 0) }}
|
||||
|
||||
{{ Form::textGroup('transferred_at', trans('general.date'), 'calendar',['id' => 'transferred_at', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
|
||||
{{ Form::dateGroup('transferred_at', trans('general.date'), 'calendar', ['id' => 'transferred_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
|
||||
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method')) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{!! Form::hidden('currency_code', null, ['id' => 'currency_code']) !!}
|
||||
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('banking/transfers') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
{!! 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>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('banking/transfers') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
|
||||
@if (language()->getShortCode() != 'en')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
|
||||
@endif
|
||||
@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(){
|
||||
$("#amount").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
|
||||
});
|
||||
|
||||
$("#amount").focusout();
|
||||
|
||||
//Date picker
|
||||
$('#transferred_at').datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: 'linked',
|
||||
weekStart: 1,
|
||||
autoclose: true,
|
||||
language: '{{ language()->getShortCode() }}'
|
||||
});
|
||||
|
||||
$("#from_account_id").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
|
||||
});
|
||||
|
||||
$("#to_account_id").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
|
||||
});
|
||||
|
||||
$("#payment_method").select2({
|
||||
placeholder: "{{ trans_choice('general.payment_methods', 1) }}"
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '#from_account_id', function (e) {
|
||||
$.ajax({
|
||||
url: '{{ url("banking/accounts/currency") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: 'account_id=' + $(this).val(),
|
||||
success: function(data) {
|
||||
$('#currency').val(data.currency_code);
|
||||
|
||||
$('#currency_code').val(data.currency_code);
|
||||
$('#currency_rate').val(data.currency_rate);
|
||||
|
||||
amount = $('#amount').maskMoney('unmasked')[0];
|
||||
|
||||
$("#amount").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
|
||||
});
|
||||
|
||||
$('#amount').val(amount);
|
||||
|
||||
$('#amount').trigger('focus');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -3,124 +3,51 @@
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.transfers', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
<div class="card">
|
||||
{!! Form::model($transfer, [
|
||||
'id' => 'transfer',
|
||||
'method' => 'PATCH',
|
||||
'url' => ['banking/transfers', $transfer->id],
|
||||
'route' => ['transfers.update', $transfer->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button'
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts) }}
|
||||
<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' => 'onChangeAccount']) }}
|
||||
|
||||
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts) }}
|
||||
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts, $transfer->to_account_id) }}
|
||||
|
||||
{{ Form::textGroup('amount', trans('general.amount'), 'money') }}
|
||||
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency], $transfer->amount) }}
|
||||
|
||||
{{ Form::textGroup('transferred_at', trans('general.date'), 'calendar',['id' => 'transferred_at', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => 'yyyy-mm-dd', 'autocomplete' => 'off']) }}
|
||||
{{ Form::dateGroup('transferred_at', trans('general.date'), 'calendar', ['id' => 'transferred_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($transfer->transferred_at)->toDateString()) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, null) }}
|
||||
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $transfer->payment_method) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{!! Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) !!}
|
||||
{!! Form::hidden('currency_rate', $currency->rate, ['id' => 'currency_rate']) !!}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@permission('update-banking-transfers')
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('banking/transfers') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
@endpermission
|
||||
{!! 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>
|
||||
|
||||
@permission('update-banking-transfers')
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('banking/transfers') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
|
||||
@if (language()->getShortCode() != 'en')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
|
||||
@endif
|
||||
@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(){
|
||||
$("#amount").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
|
||||
});
|
||||
|
||||
$("#amount").focusout();
|
||||
|
||||
//Date picker
|
||||
$('#transferred_at').datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: 'linked',
|
||||
weekStart: 1,
|
||||
autoclose: true,
|
||||
language: '{{ language()->getShortCode() }}'
|
||||
});
|
||||
|
||||
$("#from_account_id").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
|
||||
});
|
||||
|
||||
$("#to_account_id").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
|
||||
});
|
||||
|
||||
$("#payment_method").select2({
|
||||
placeholder: "{{ trans_choice('general.payment_methods', 1) }}"
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '#from_account_id', function (e) {
|
||||
$.ajax({
|
||||
url: '{{ url("banking/accounts/currency") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: 'account_id=' + $(this).val(),
|
||||
success: function(data) {
|
||||
$('#currency').val(data.currency_code);
|
||||
|
||||
$('#currency_code').val(data.currency_code);
|
||||
$('#currency_rate').val(data.currency_rate);
|
||||
|
||||
amount = $('#amount').maskMoney('unmasked')[0];
|
||||
|
||||
$("#amount").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
|
||||
});
|
||||
|
||||
$('#amount').val(amount);
|
||||
|
||||
$('#amount').trigger('focus');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
@@ -3,89 +3,80 @@
|
||||
@section('title', trans_choice('general.transfers', 2))
|
||||
|
||||
@permission('create-banking-transfers')
|
||||
@section('new_button')
|
||||
<span class="new-button"><a href="{{ url('banking/transfers/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
@endsection
|
||||
@section('new_button')
|
||||
<span><a href="{{ route('transfers.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> {{ 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/transfers', 'role' => 'form', 'method' => 'GET']) !!}
|
||||
<div class="pull-left">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
|
||||
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
|
||||
{!! Form::select('from_account', $accounts, request('from_account'), ['class' => 'form-control input-filter input-sm']) !!}
|
||||
{!! Form::select('to_account', $accounts, request('to_account'), ['class' => 'form-control input-filter input-sm']) !!}
|
||||
{!! Form::button('<span class="fa fa-filter"></span> ' . 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="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'route' => 'transfers.index',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 card-header-search">
|
||||
<span class="table-text hidden-lg">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-transfers">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-2">@sortablelink('payment.paid_at', trans('general.date'))</th>
|
||||
<th class="col-md-3">@sortablelink('payment.name', trans('transfers.from_account'))</th>
|
||||
<th class="col-md-3">@sortablelink('revenue.name', trans('transfers.to_account'))</th>
|
||||
<th class="col-md-3 text-right amount-space">@sortablelink('payment.amount', trans('general.amount'))</th>
|
||||
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($transfers as $item)
|
||||
<tr>
|
||||
<td><a href="{{ url('banking/transfers/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
|
||||
<td>{{ $item->from_account }}</td>
|
||||
<td>{{ $item->to_account }}</td>
|
||||
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</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="{{ url('banking/transfers/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
|
||||
@permission('delete-banking-transfers')
|
||||
<li>{!! Form::deleteLink($item, 'banking/transfers') !!}</li>
|
||||
@endpermission
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
{{ Form::bulkActionRowGroup('general.transfers', $bulk_actions, 'banking/transfers') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-md-2 hidden-md">@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 hidden-sm">@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>
|
||||
@endforeach
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($transfers as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-1 hidden-sm">{{ Form::bulkActionGroup($item->id, $item->from_account) }}</td>
|
||||
<td class="col-md-2 hidden-md"><a class="col-aka text-success" href="{{ route('transfers.edit', $item->id) }}">@date($item->paid_at)</a></td>
|
||||
<td class="col-sm-2 col-md-3 hidden-sm">{{ $item->from_account }}</td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-2">{{ $item->to_account }}</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 text-right">@money($item->amount, $item->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.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@permission('delete-banking-transfers')
|
||||
{!! Form::deleteLink($item, 'banking/transfers') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
@include('partials.admin.pagination', ['items' => $items, 'type' => 'transfers'])
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $transfers, 'type' => 'transfers'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
|
||||
@if (language()->getShortCode() != 'en')
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
|
||||
@endif
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user