v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

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

View File

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

View File

@@ -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> &nbsp;{{ 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> &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/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> &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="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