123 lines
4.6 KiB
PHP
Raw Normal View History

2017-09-14 22:21:00 +03:00
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.transfers', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::model($transfer, [
'method' => 'PATCH',
'url' => ['banking/transfers', $transfer->id],
'role' => 'form'
]) !!}
<div class="box-body">
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts) }}
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts) }}
2018-05-10 09:55:34 +03:00
{{ Form::textGroup('amount', trans('general.amount'), 'money') }}
2017-09-14 22:21:00 +03:00
{{ 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']) }}
2017-09-14 22:21:00 +03:00
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, null) }}
2017-09-14 22:21:00 +03:00
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{!! Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) !!}
{!! Form::hidden('currency_rate', $currency->rate, ['id' => 'currency_rate']) !!}
2017-09-14 22:21:00 +03:00
</div>
<!-- /.box-body -->
@permission('update-banking-transfers')
<div class="box-footer">
{{ Form::saveButtons('banking/transfers') }}
</div>
<!-- /.box-footer -->
@endpermission
{!! Form::close() !!}
</div>
@endsection
2017-11-13 21:55:15 +03:00
@push('js')
2017-09-14 22:21:00 +03:00
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
2018-05-01 13:40:08 +03:00
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
2017-11-13 21:55:15 +03:00
@endpush
2017-09-14 22:21:00 +03:00
2017-11-13 21:55:15 +03:00
@push('css')
2017-09-14 22:21:00 +03:00
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
2017-11-13 21:55:15 +03:00
@endpush
2017-09-14 22:21:00 +03:00
2017-11-13 21:55:15 +03:00
@push('scripts')
2017-09-14 22:21:00 +03:00
<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();
2017-09-14 22:21:00 +03:00
//Date picker
$('#transferred_at').datepicker({
format: 'yyyy-mm-dd',
2018-06-24 00:36:46 +03:00
weekStart: 1,
2018-05-01 13:40:08 +03:00
autoclose: true,
language: '{{ language()->getShortCode() }}'
2017-09-14 22:21:00 +03:00
});
$("#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');
}
});
});
2017-09-14 22:21:00 +03:00
</script>
2017-11-13 21:55:15 +03:00
@endpush