From 6b53bb638cf9273f4b86107d9aa70c7bdac1aa8a Mon Sep 17 00:00:00 2001 From: cuneytsenturk Date: Tue, 10 Jul 2018 19:37:06 +0300 Subject: [PATCH] refs #412 --- .../views/expenses/payments/create.blade.php | 29 ++++++++++--------- .../views/expenses/payments/edit.blade.php | 5 ++-- .../views/incomes/revenues/create.blade.php | 29 ++++++++++--------- .../views/incomes/revenues/edit.blade.php | 5 ++-- 4 files changed, 36 insertions(+), 32 deletions(-) diff --git a/resources/views/expenses/payments/create.blade.php b/resources/views/expenses/payments/create.blade.php index 795624c2f..9e84470e4 100644 --- a/resources/views/expenses/payments/create.blade.php +++ b/resources/views/expenses/payments/create.blade.php @@ -10,6 +10,9 @@
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => ''], Date::now()->toDateString()) }} + {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} + {!! Form::hidden('currency_rate', '', ['id' => 'currency_rate']) !!} + {{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
@@ -19,8 +22,6 @@ {!! Form::select('account_id', $accounts, setting('general.default_account'), array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!} - {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} - {!! Form::hidden('currency_rate', '', ['id' => 'currency_rate']) !!}
@@ -170,7 +171,7 @@ modal += ' '; modal += '
'; modal += '
'; - modal += ' '; modal += ' '; @foreach($currencies as $currency_code => $currency_name) modal += ' '; @@ -198,7 +199,7 @@ $('body').append(modal); - $("#modal-create-vendor #currency_code").select2({ + $("#modal-create-vendor #vendor_currency_code").select2({ placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}" }); @@ -229,18 +230,18 @@ $('#span-loading').remove(); if (error.responseJSON.name) { - $("input[name='name']").parent().parent().addClass('has-error'); - $("input[name='name']").parent().after('

' + error.responseJSON.name + '

'); + $("#modal-create-vendor input[name='name']").parent().parent().addClass('has-error'); + $("#modal-create-vendor input[name='name']").parent().after('

' + error.responseJSON.name + '

'); } if (error.responseJSON.email) { - $("input[name='email']").parent().parent().addClass('has-error'); - $("input[name='email']").parent().after('

' + error.responseJSON.email + '

'); + $("#modal-create-vendor input[name='email']").parent().parent().addClass('has-error'); + $("#modal-create-vendor input[name='email']").parent().after('

' + error.responseJSON.email + '

'); } if (error.responseJSON.currency_code) { - $("select[name='currency_code']").parent().parent().addClass('has-error'); - $("select[name='currency_code']").parent().after('

' + error.responseJSON.currency_code + '

'); + $("#modal-create-vendor select[name='currency_code']").parent().parent().addClass('has-error'); + $("#modal-create-vendor select[name='currency_code']").parent().after('

' + error.responseJSON.currency_code + '

'); } } }); @@ -318,13 +319,13 @@ $('#span-loading').remove(); if (error.responseJSON.name) { - $("input[name='name']").parent().parent().addClass('has-error'); - $("input[name='name']").parent().after('

' + error.responseJSON.name + '

'); + $("#modal-create-category input[name='name']").parent().parent().addClass('has-error'); + $("#modal-create-category input[name='name']").parent().after('

' + error.responseJSON.name + '

'); } if (error.responseJSON.color) { - $("input[name='color']").parent().parent().addClass('has-error'); - $("input[name='color']").parent().after('

' + error.responseJSON.color + '

'); + $("#modal-create-category input[name='color']").parent().parent().addClass('has-error'); + $("#modal-create-category input[name='color']").parent().after('

' + error.responseJSON.color + '

'); } } }); diff --git a/resources/views/expenses/payments/edit.blade.php b/resources/views/expenses/payments/edit.blade.php index 2f54fe4d3..af137ef2d 100644 --- a/resources/views/expenses/payments/edit.blade.php +++ b/resources/views/expenses/payments/edit.blade.php @@ -27,6 +27,9 @@
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => ''], Date::parse($payment->paid_at)->toDateString()) }} + {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} + {!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!} + {{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
@@ -36,8 +39,6 @@ {!! Form::select('account_id', $accounts, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!} - {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} - {!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
diff --git a/resources/views/incomes/revenues/create.blade.php b/resources/views/incomes/revenues/create.blade.php index 53dcc6b4c..fe31e50af 100644 --- a/resources/views/incomes/revenues/create.blade.php +++ b/resources/views/incomes/revenues/create.blade.php @@ -10,6 +10,9 @@
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => ''], Date::now()->toDateString()) }} + {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} + {!! Form::hidden('currency_rate', '', ['id' => 'currency_rate']) !!} + {{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
@@ -19,8 +22,6 @@ {!! Form::select('account_id', $accounts, setting('general.accounts', 1), array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!} - {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} - {!! Form::hidden('currency_rate', '', ['id' => 'currency_rate']) !!}
@@ -170,7 +171,7 @@ modal += ' '; modal += '
'; modal += '
'; - modal += ' '; modal += ' '; @foreach($currencies as $currency_code => $currency_name) modal += ' '; @@ -198,7 +199,7 @@ $('body').append(modal); - $("#modal-create-customer #currency_code").select2({ + $("#modal-create-customer #customer_currency_code").select2({ placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}" }); @@ -229,18 +230,18 @@ $('#span-loading').remove(); if (error.responseJSON.name) { - $("input[name='name']").parent().parent().addClass('has-error'); - $("input[name='name']").parent().after('

' + error.responseJSON.name + '

'); + $("#modal-create-customer input[name='name']").parent().parent().addClass('has-error'); + $("#modal-create-customer input[name='name']").parent().after('

' + error.responseJSON.name + '

'); } if (error.responseJSON.email) { - $("input[name='email']").parent().parent().addClass('has-error'); - $("input[name='email']").parent().after('

' + error.responseJSON.email + '

'); + $("#modal-create-customer input[name='email']").parent().parent().addClass('has-error'); + $("#modal-create-customer input[name='email']").parent().after('

' + error.responseJSON.email + '

'); } if (error.responseJSON.currency_code) { - $("select[name='currency_code']").parent().parent().addClass('has-error'); - $("select[name='currency_code']").parent().after('

' + error.responseJSON.currency_code + '

'); + $("#modal-create-customer select[name='currency_code']").parent().parent().addClass('has-error'); + $("#modal-create-customer select[name='currency_code']").parent().after('

' + error.responseJSON.currency_code + '

'); } } }); @@ -318,13 +319,13 @@ $('#span-loading').remove(); if (error.responseJSON.name) { - $("input[name='name']").parent().parent().addClass('has-error'); - $("input[name='name']").parent().after('

' + error.responseJSON.name + '

'); + $("#modal-create-category input[name='name']").parent().parent().addClass('has-error'); + $("#modal-create-category input[name='name']").parent().after('

' + error.responseJSON.name + '

'); } if (error.responseJSON.color) { - $("input[name='color']").parent().parent().addClass('has-error'); - $("input[name='color']").parent().after('

' + error.responseJSON.color + '

'); + $("#modal-create-category input[name='color']").parent().parent().addClass('has-error'); + $("#modal-create-category input[name='color']").parent().after('

' + error.responseJSON.color + '

'); } } }); diff --git a/resources/views/incomes/revenues/edit.blade.php b/resources/views/incomes/revenues/edit.blade.php index 3b56ea1c3..ce05aa008 100644 --- a/resources/views/incomes/revenues/edit.blade.php +++ b/resources/views/incomes/revenues/edit.blade.php @@ -27,6 +27,9 @@
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => ''], Date::parse($revenue->paid_at)->toDateString()) }} + {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} + {!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!} + {{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
@@ -36,8 +39,6 @@ {!! Form::select('account_id', $accounts, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!} - {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!} - {!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}