currency fields
This commit is contained in:
@@ -10,13 +10,23 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
|
||||
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, setting('currencies.code')) }}
|
||||
|
||||
{{ Form::radioGroup('default_currency', trans('currencies.default')) }}
|
||||
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes) }}
|
||||
|
||||
{{ Form::textGroup('rate', trans('currencies.rate'), 'money') }}
|
||||
|
||||
{{ Form::textGroup('precision', trans('currencies.precision'), 'money') }}
|
||||
|
||||
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}
|
||||
|
||||
{{ Form::selectGroup('symbol_first', trans('currencies.symbol.position'), 'text-width', ['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')]) }}
|
||||
|
||||
{{ Form::textGroup('decimal_mark', trans('currencies.decimal_mark'), 'columns') }}
|
||||
|
||||
{{ Form::textGroup('thousands_separator', trans('currencies.thousands_separator'), 'columns', []) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
|
||||
{{ Form::radioGroup('default_currency', trans('currencies.default')) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@@ -42,6 +52,25 @@
|
||||
$("#code").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans('currencies.code')]) }}"
|
||||
});
|
||||
|
||||
$('#code').change(function() {
|
||||
$.ajax({
|
||||
url: '{{ url("settings/currencies/config") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: 'code=' + $(this).val(),
|
||||
success: function(data) {
|
||||
$('#precision').val(data.precision);
|
||||
$('#symbol').val(data.symbol);
|
||||
$('#symbol_first').val(data.symbol_first);
|
||||
$('#decimal_mark').val(data.decimal_mark);
|
||||
$('#thousands_separator').val(data.thousands_separator);
|
||||
|
||||
// This event Select2 Stylesheet
|
||||
$('#symbol_first').trigger('change');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -14,13 +14,23 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
|
||||
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, setting('currencies.code')) }}
|
||||
|
||||
{{ Form::radioGroup('default_currency', trans('currencies.default')) }}
|
||||
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes) }}
|
||||
|
||||
{{ Form::textGroup('rate', trans('currencies.rate'), 'money') }}
|
||||
|
||||
{{ Form::textGroup('precision', trans('currencies.precision'), 'money') }}
|
||||
|
||||
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}
|
||||
|
||||
{{ Form::selectGroup('symbol_first', trans('currencies.symbol.position'), 'text-width', ['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')]) }}
|
||||
|
||||
{{ Form::textGroup('decimal_mark', trans('currencies.decimal_mark'), 'columns') }}
|
||||
|
||||
{{ Form::textGroup('thousands_separator', trans('currencies.thousands_separator'), 'columns', []) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
|
||||
{{ Form::radioGroup('default_currency', trans('currencies.default')) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@@ -44,6 +54,25 @@
|
||||
$("#code").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans('currencies.code')]) }}"
|
||||
});
|
||||
|
||||
$('#code').change(function() {
|
||||
$.ajax({
|
||||
url: '{{ url("settings/currencies/config") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: 'code=' + $(this).val(),
|
||||
success: function(data) {
|
||||
$('#precision').val(data.precision);
|
||||
$('#symbol').val(data.symbol);
|
||||
$('#symbol_first').val(data.symbol_first);
|
||||
$('#decimal_mark').val(data.decimal_mark);
|
||||
$('#thousands_separator').val(data.thousands_separator);
|
||||
|
||||
// This event Select2 Stylesheet
|
||||
$('#symbol_first').trigger('change');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user