refs #451 Bill create and edit item price mask
This commit is contained in:
		@@ -139,6 +139,7 @@
 | 
			
		||||
    <!-- /.box-footer -->
 | 
			
		||||
 | 
			
		||||
    {!! Form::close() !!}
 | 
			
		||||
</div>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@push('js')
 | 
			
		||||
@@ -164,7 +165,7 @@
 | 
			
		||||
                url: '{{ url("expenses/bills/addItem") }}',
 | 
			
		||||
                type: 'GET',
 | 
			
		||||
                dataType: 'JSON',
 | 
			
		||||
                data: {item_row: item_row},
 | 
			
		||||
                data: {item_row: item_row, currency_code : $('#currency_code').val()},
 | 
			
		||||
                success: function(json) {
 | 
			
		||||
                    if (json['success']) {
 | 
			
		||||
                        $('#items tbody #addItem').before(json['html']);
 | 
			
		||||
@@ -179,6 +180,19 @@
 | 
			
		||||
                            }
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        var currency = json['data']['currency'];
 | 
			
		||||
 | 
			
		||||
                        $("#item-price-" + item_row).maskMoney({
 | 
			
		||||
                            thousands : currency.thousands_separator,
 | 
			
		||||
                            decimal : currency.decimal_mark,
 | 
			
		||||
                            precision : currency.precision,
 | 
			
		||||
                            allowZero : true,
 | 
			
		||||
                            prefix : (currency.symbol_first) ? currency.symbol : '',
 | 
			
		||||
                            suffix : (currency.symbol_first) ? '' : currency.symbol
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        $("#item-price-" + item_row).trigger('focusout');
 | 
			
		||||
 | 
			
		||||
                        item_row++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
@@ -186,6 +200,20 @@
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        $(document).ready(function(){
 | 
			
		||||
            $(".input-price").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
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $('.input-price').trigger('focusout');
 | 
			
		||||
 | 
			
		||||
            //Date picker
 | 
			
		||||
            $('#billed_at').datepicker({
 | 
			
		||||
                format: 'yyyy-mm-dd',
 | 
			
		||||
@@ -341,6 +369,23 @@
 | 
			
		||||
                        $('#currency_code').val(data.currency_code);
 | 
			
		||||
                        $('#currency_rate').val(data.currency_rate);
 | 
			
		||||
 | 
			
		||||
                        $('.input-price').each(function(){
 | 
			
		||||
                            amount = $(this).maskMoney('unmasked')[0];
 | 
			
		||||
 | 
			
		||||
                            $(this).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
 | 
			
		||||
                            });
 | 
			
		||||
 | 
			
		||||
                            $(this).val(amount);
 | 
			
		||||
 | 
			
		||||
                            $(this).trigger('focusout');
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        // This event Select2 Stylesheet
 | 
			
		||||
                        $('#currency_code').trigger('change');
 | 
			
		||||
                    }
 | 
			
		||||
 
 | 
			
		||||
@@ -161,6 +161,19 @@
 | 
			
		||||
                            }
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        var currency = json['data']['currency'];
 | 
			
		||||
 | 
			
		||||
                        $("#item-price-" + item_row).maskMoney({
 | 
			
		||||
                            thousands : currency.thousands_separator,
 | 
			
		||||
                            decimal : currency.decimal_mark,
 | 
			
		||||
                            precision : currency.precision,
 | 
			
		||||
                            allowZero : true,
 | 
			
		||||
                            prefix : (currency.symbol_first) ? currency.symbol : '',
 | 
			
		||||
                            suffix : (currency.symbol_first) ? '' : currency.symbol
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        $("#item-price-" + item_row).trigger('focusout');
 | 
			
		||||
 | 
			
		||||
                        item_row++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
@@ -168,6 +181,20 @@
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        $(document).ready(function(){
 | 
			
		||||
            $(".input-price").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
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $('.input-price').trigger('focusout');
 | 
			
		||||
 | 
			
		||||
            totalItem();
 | 
			
		||||
 | 
			
		||||
            //Date picker
 | 
			
		||||
@@ -216,24 +243,24 @@
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            @if($bill->attachment)
 | 
			
		||||
                attachment_html  = '<span class="attachment">';
 | 
			
		||||
                attachment_html += '    <a href="{{ url('uploads/' . $bill->attachment->id . '/download') }}">';
 | 
			
		||||
                attachment_html += '        <span id="download-attachment" class="text-primary">';
 | 
			
		||||
                attachment_html += '            <i class="fa fa-file-{{ $bill->attachment->aggregate_type }}-o"></i> {{ $bill->attachment->basename }}';
 | 
			
		||||
                attachment_html += '        </span>';
 | 
			
		||||
                attachment_html += '    </a>';
 | 
			
		||||
                attachment_html += '    {!! Form::open(['id' => 'attachment-' . $bill->attachment->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $bill->attachment->id)], 'style' => 'display:inline']) !!}';
 | 
			
		||||
                attachment_html += '    <a id="remove-attachment" href="javascript:void();">';
 | 
			
		||||
                attachment_html += '        <span class="text-danger"><i class="fa fa fa-times"></i></span>';
 | 
			
		||||
                attachment_html += '    </a>';
 | 
			
		||||
                attachment_html += '    {!! Form::close() !!}';
 | 
			
		||||
                attachment_html += '</span>';
 | 
			
		||||
            attachment_html  = '<span class="attachment">';
 | 
			
		||||
            attachment_html += '    <a href="{{ url('uploads/' . $bill->attachment->id . '/download') }}">';
 | 
			
		||||
            attachment_html += '        <span id="download-attachment" class="text-primary">';
 | 
			
		||||
            attachment_html += '            <i class="fa fa-file-{{ $bill->attachment->aggregate_type }}-o"></i> {{ $bill->attachment->basename }}';
 | 
			
		||||
            attachment_html += '        </span>';
 | 
			
		||||
            attachment_html += '    </a>';
 | 
			
		||||
            attachment_html += '    {!! Form::open(['id' => 'attachment-' . $bill->attachment->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $bill->attachment->id)], 'style' => 'display:inline']) !!}';
 | 
			
		||||
            attachment_html += '    <a id="remove-attachment" href="javascript:void();">';
 | 
			
		||||
            attachment_html += '        <span class="text-danger"><i class="fa fa fa-times"></i></span>';
 | 
			
		||||
            attachment_html += '    </a>';
 | 
			
		||||
            attachment_html += '    {!! Form::close() !!}';
 | 
			
		||||
            attachment_html += '</span>';
 | 
			
		||||
 | 
			
		||||
                $('.fancy-file .fake-file').append(attachment_html);
 | 
			
		||||
            $('.fancy-file .fake-file').append(attachment_html);
 | 
			
		||||
 | 
			
		||||
                $(document).on('click', '#remove-attachment', function (e) {
 | 
			
		||||
                    confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete')  !!}");
 | 
			
		||||
                });
 | 
			
		||||
            $(document).on('click', '#remove-attachment', function (e) {
 | 
			
		||||
                confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete')  !!}");
 | 
			
		||||
            });
 | 
			
		||||
            @endif
 | 
			
		||||
 | 
			
		||||
            var autocomplete_path = "{{ url('common/items/autocomplete') }}";
 | 
			
		||||
@@ -350,6 +377,23 @@
 | 
			
		||||
                        $('#currency_code').val(data.currency_code);
 | 
			
		||||
                        $('#currency_rate').val(data.currency_rate);
 | 
			
		||||
 | 
			
		||||
                        $('.input-price').each(function(){
 | 
			
		||||
                            amount = $(this).maskMoney('unmasked')[0];
 | 
			
		||||
 | 
			
		||||
                            $(this).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
 | 
			
		||||
                            });
 | 
			
		||||
 | 
			
		||||
                            $(this).val(amount);
 | 
			
		||||
 | 
			
		||||
                            $(this).trigger('focusout');
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        // This event Select2 Stylesheet
 | 
			
		||||
                        $('#currency_code').trigger('change');
 | 
			
		||||
                    }
 | 
			
		||||
 
 | 
			
		||||
@@ -316,110 +316,6 @@
 | 
			
		||||
@push('scripts')
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        $(document).ready(function(){
 | 
			
		||||
            $(document).on('click', '#button-payment', function (e) {
 | 
			
		||||
                $('#payment-modal').remove();
 | 
			
		||||
 | 
			
		||||
                var html = '';
 | 
			
		||||
 | 
			
		||||
                html += '<div class="modal fade" id="payment-modal" tabindex="-1" role="dialog" aria-labelledby="paymentModalLabel">';
 | 
			
		||||
                html += '   <div class="modal-dialog" role="document">';
 | 
			
		||||
                html += '       <div class="modal-content box box-success">';
 | 
			
		||||
                html += '           <div class="modal-header">';
 | 
			
		||||
                html += '               <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>';
 | 
			
		||||
                html += '               <h4 class="modal-title" id="paymentModalLabel">{{ trans('bills.add_payment') }}</h4>';
 | 
			
		||||
                html += '           </div>';
 | 
			
		||||
                html += '           <div class="modal-body box-body">';
 | 
			
		||||
                html += '               <div class="modal-message"></div>';
 | 
			
		||||
                html += '               <div class="form-group col-md-6 required">';
 | 
			
		||||
                html += '                   {!! Form::label('paid_at', trans('general.date'), ['class' => 'control-label']) !!}';
 | 
			
		||||
                html += '                   <div class="input-group">';
 | 
			
		||||
                html += '                       <div class="input-group-addon"><i class="fa fa-calendar"></i></div>';
 | 
			
		||||
                html += '                       {!! Form::text('paid_at', \Date::now()->toDateString(), ['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off']) !!}';
 | 
			
		||||
                html += '                   </div>';
 | 
			
		||||
                html += '               </div>';
 | 
			
		||||
                html += '               <div class="form-group col-md-6 required">';
 | 
			
		||||
                html += '                   {!! Form::label('amount', trans('general.amount'), ['class' => 'control-label']) !!}';
 | 
			
		||||
                html += '                   <div class="input-group">';
 | 
			
		||||
                html += '                       <div class="input-group-addon"><i class="fa fa-money"></i></div>';
 | 
			
		||||
                html += '                       {!! Form::text('amount', $bill->grand_total, ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('general.amount')])]) !!}';
 | 
			
		||||
                html += '                   </div>';
 | 
			
		||||
                html += '               </div>';
 | 
			
		||||
                html += '               <div class="form-group col-md-6 required">';
 | 
			
		||||
                html += '                   {!! Form::label('account_id', trans_choice('general.accounts', 1), ['class' => 'control-label']) !!}';
 | 
			
		||||
                html += '                   <div class="input-group">';
 | 
			
		||||
                html += '                       <div class="input-group-addon"><i class="fa fa-university"></i></div>';
 | 
			
		||||
                html += '                       {!! Form::select('account_id', $accounts, setting('general.default_account'), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])]) !!}';
 | 
			
		||||
                html += '                   </div>';
 | 
			
		||||
                html += '               </div>';
 | 
			
		||||
                html += '               <div class="form-group col-md-6 required">';
 | 
			
		||||
                html += '                   {!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}';
 | 
			
		||||
                html += '                   <div class="input-group">';
 | 
			
		||||
                html += '                       <div class="input-group-addon"><i class="fa fa-exchange"></i></div>';
 | 
			
		||||
                html += '                       {!! Form::text('currency', $currencies[$account_currency_code], ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}';
 | 
			
		||||
                html += '                       {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}';
 | 
			
		||||
                html += '                   </div>';
 | 
			
		||||
                html += '               </div>';
 | 
			
		||||
                html += '               <div class="form-group col-md-12">';
 | 
			
		||||
                html += '                   {!! Form::label('description', trans('general.description'), ['class' => 'control-label']) !!}';
 | 
			
		||||
                html += '                   {!! Form::textarea('description', null, ['class' => 'form-control', 'rows' => '3', 'placeholder' => trans('general.form.enter', ['field' => trans('general.description')])]) !!}';
 | 
			
		||||
                html += '               </div>';
 | 
			
		||||
                html += '               <div class="form-group col-md-6 required">';
 | 
			
		||||
                html += '                   {!! Form::label('payment_method', trans_choice('general.payment_methods', 1), ['class' => 'control-label']) !!}';
 | 
			
		||||
                html += '                   <div class="input-group">';
 | 
			
		||||
                html += '                       <div class="input-group-addon"><i class="fa fa-folder-open-o"></i></div>';
 | 
			
		||||
                html += '                       {!! Form::select('payment_method', $payment_methods, setting('general.default_payment_method'), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)])]) !!}';
 | 
			
		||||
                html += '                   </div>';
 | 
			
		||||
                html += '               </div>';
 | 
			
		||||
                html += '               <div class="form-group col-md-6">';
 | 
			
		||||
                html += '                   {!! Form::label('reference', trans('general.reference'), ['class' => 'control-label']) !!}';
 | 
			
		||||
                html += '                   <div class="input-group">';
 | 
			
		||||
                html += '                       <div class="input-group-addon"><i class="fa fa-file-text-o"></i></div>';
 | 
			
		||||
                html += '                       {!! Form::text('reference', null, ['class' => 'form-control', 'placeholder' => trans('general.form.enter', ['field' => trans('general.reference')])]) !!}';
 | 
			
		||||
                html += '                   </div>';
 | 
			
		||||
                html += '               </div>';
 | 
			
		||||
                html += '               {!! Form::hidden('bill_id', $bill->id, ['id' => 'bill_id', 'class' => 'form-control', 'required' => 'required']) !!}';
 | 
			
		||||
                html += '           </div>';
 | 
			
		||||
                html += '           <div class="modal-footer" style="text-align: left;">';
 | 
			
		||||
                html += '               <button type="button" onclick="addPayment();" class="btn btn-success">{{ trans('general.save') }}</button>';
 | 
			
		||||
                html += '               <button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('general.cancel') }}</button>';
 | 
			
		||||
                html += '           </div>';
 | 
			
		||||
                html += '       </div>';
 | 
			
		||||
                html += '   </div>';
 | 
			
		||||
                html += '</div>';
 | 
			
		||||
 | 
			
		||||
                $('body').append(html);
 | 
			
		||||
 | 
			
		||||
                $('#paid_at').datepicker({
 | 
			
		||||
                    format: 'yyyy-mm-dd',
 | 
			
		||||
                    weekStart: 1,
 | 
			
		||||
                    autoclose: true,
 | 
			
		||||
                    language: '{{ language()->getShortCode() }}'
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                $("#account_id").select2({
 | 
			
		||||
                    placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                $("#payment_method").select2({
 | 
			
		||||
                    placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                $('#payment-modal').modal('show');
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $(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').val(data.currency_name);
 | 
			
		||||
                        $('#currency_code').val(data.currency_code);
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $(document).on('click', '#button-email', function (e) {
 | 
			
		||||
                $('#email-modal').remove();
 | 
			
		||||
 | 
			
		||||
@@ -445,6 +341,7 @@
 | 
			
		||||
 | 
			
		||||
                $('#email-modal').modal('show');
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            @if($bill->attachment)
 | 
			
		||||
            $(document).on('click', '#remove-attachment', function (e) {
 | 
			
		||||
                confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete')  !!}");
 | 
			
		||||
@@ -452,68 +349,19 @@
 | 
			
		||||
            @endif
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        function addPayment() {
 | 
			
		||||
            $('.help-block').remove();
 | 
			
		||||
        $(document).on('click', '#button-payment', function (e) {
 | 
			
		||||
            $('#modal-add-payment').remove();
 | 
			
		||||
 | 
			
		||||
            $.ajax({
 | 
			
		||||
                url: '{{ url("expenses/bills/payment") }}',
 | 
			
		||||
                type: 'POST',
 | 
			
		||||
                url: '{{ url("modals/bills/" . $bill->id . "/payment/create") }}',
 | 
			
		||||
                type: 'GET',
 | 
			
		||||
                dataType: 'JSON',
 | 
			
		||||
                data: $('#payment-modal input[type=\'text\'], #payment-modal input[type=\'hidden\'], #payment-modal textarea, #payment-modal select'),
 | 
			
		||||
                headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
 | 
			
		||||
                beforeSend: function() {
 | 
			
		||||
                    $('#payment-modal .modal-content').append('<div id="loading" class="text-center"><i class="fa fa-spinner fa-spin fa-5x checkout-spin"></i></div>');
 | 
			
		||||
                },
 | 
			
		||||
                complete: function() {
 | 
			
		||||
                    $('#loading').remove();
 | 
			
		||||
                },
 | 
			
		||||
                success: function(json) {
 | 
			
		||||
                    if (json['error']) {
 | 
			
		||||
                        $('#payment-modal .modal-message').append('<div class="alert alert-danger">' + json['message'] + '</div>');
 | 
			
		||||
                        $('div.alert-danger').delay(3000).fadeOut(350);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    if (json['success']) {
 | 
			
		||||
                        $('#payment-modal .modal-message').before('<div class="alert alert-success">' + json['message'] + '</div>');
 | 
			
		||||
                        $('div.alert-success').delay(3000).fadeOut(350);
 | 
			
		||||
 | 
			
		||||
                        setTimeout(function(){
 | 
			
		||||
                            $("#payment-modal").modal('hide');
 | 
			
		||||
 | 
			
		||||
                            location.reload();
 | 
			
		||||
                        }, 3000);
 | 
			
		||||
                    }
 | 
			
		||||
                },
 | 
			
		||||
                error: function(data){
 | 
			
		||||
                    var errors = data.responseJSON;
 | 
			
		||||
 | 
			
		||||
                    if (typeof errors !== 'undefined') {
 | 
			
		||||
                        if (errors.paid_at) {
 | 
			
		||||
                            $('#payment-modal #paid_at').parent().after('<p class="help-block">' + errors.paid_at + '</p>');
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        if (errors.amount) {
 | 
			
		||||
                            $('#payment-modal #amount').parent().after('<p class="help-block">' + errors.amount + '</p>');
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        if (errors.account_id) {
 | 
			
		||||
                            $('#payment-modal #account_id').parent().after('<p class="help-block">' + errors.account_id + '</p>');
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        if (errors.currency_code) {
 | 
			
		||||
                            $('#payment-modal #currency_code').parent().after('<p class="help-block">' + errors.currency_code + '</p>');
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        if (errors.category_id) {
 | 
			
		||||
                            $('#payment-modal #category_id').parent().after('<p class="help-block">' + errors.category_id + '</p>');
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        if (errors.payment_method) {
 | 
			
		||||
                            $('#payment-modal #payment_method').parent().after('<p class="help-block">' + errors.payment_method + '</p>');
 | 
			
		||||
                        }
 | 
			
		||||
                        $('body').append(json['html']);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
@endpush
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user