Merge pull request #1673 from cuneytsenturk/2.1-dev
Invoice columns name changed
This commit is contained in:
commit
c959838527
4
resources/assets/js/plugins/form.js
vendored
4
resources/assets/js/plugins/form.js
vendored
@ -56,7 +56,7 @@ export default class Form {
|
|||||||
|
|
||||||
if (type == 'radio') {
|
if (type == 'radio') {
|
||||||
if (!this[form_element.getAttribute('data-field')][name]) {
|
if (!this[form_element.getAttribute('data-field')][name]) {
|
||||||
this[form_element.getAttribute('data-field')][name] = (form_element.getAttribute('value') ? 1 : 0) || 0;
|
this[form_element.getAttribute('data-field')][name] = (form_element.getAttribute('value') ? form_element.getAttribute('value') : 0) || 0;
|
||||||
}
|
}
|
||||||
} else if (type == 'checkbox') {
|
} else if (type == 'checkbox') {
|
||||||
if (this[form_element.getAttribute('data-field')][name]) {
|
if (this[form_element.getAttribute('data-field')][name]) {
|
||||||
@ -83,7 +83,7 @@ export default class Form {
|
|||||||
|
|
||||||
if (type == 'radio') {
|
if (type == 'radio') {
|
||||||
if (!this[name]) {
|
if (!this[name]) {
|
||||||
this[name] = (form_element.getAttribute('value') ? 1 : 0) || 0;
|
this[name] = (form_element.getAttribute('value') ? form_element.getAttribute('value') : 0) || 0;
|
||||||
}
|
}
|
||||||
} else if (type == 'checkbox') {
|
} else if (type == 'checkbox') {
|
||||||
if (this[name]) {
|
if (this[name]) {
|
||||||
|
@ -1,88 +1,62 @@
|
|||||||
@stack($name . '_input_start')
|
@stack($name . '_input_start')
|
||||||
<div class="{{ $col }} input-group-invoice-text">
|
|
||||||
<akaunting-select
|
|
||||||
class="float-left{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
|
|
||||||
|
|
||||||
@if (!empty($attributes['v-error']))
|
<div
|
||||||
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }, form.{{ $name }} == 'custom' ? 'col-md-6' : 'col-md-12']"
|
class="form-group {{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['readonly']) ? ' readonly' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
|
||||||
@else
|
:class="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]">
|
||||||
:form-classes="[{'has-error': form.errors.has('{{ $name }}') }, form.{{ $name }} == 'custom' ? 'col-md-6' : 'col-md-12']"
|
@if (!empty($text))
|
||||||
@endif
|
{!! Form::label($name, $text, ['class' => 'form-control-label'])!!}
|
||||||
|
@endif
|
||||||
|
|
||||||
icon="{{ $icon }}"
|
<div class="input-group-invoice-text">
|
||||||
title="{{ $text }}"
|
@foreach ($values as $input_key => $input_value)
|
||||||
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
|
<div class="custom-control custom-radio mb-2">
|
||||||
name="{{ $name }}"
|
<input
|
||||||
:options="{{ json_encode($values) }}"
|
type="radio"
|
||||||
|
id="{{ $name }}-{{ $input_key }}"
|
||||||
|
name="{{ $name }}"
|
||||||
|
v-model="form.{{ $name }}"
|
||||||
|
@change="form.errors.clear('{{ $name }}');"
|
||||||
|
class="custom-control-input"
|
||||||
|
@if($selected == $input_value)
|
||||||
|
checked
|
||||||
|
@endif
|
||||||
|
value="{{ $input_key }}">
|
||||||
|
<label for="{{ $name }}-{{ $input_key }}" class="custom-control-label"> {{ $input_value }} </label>
|
||||||
|
|
||||||
@if (isset($selected) || old($name))
|
@if ($input_key == 'custom')
|
||||||
value="{{ old($name, $selected) }}"
|
<div :class="[{'has-error': form.errors.get('{{ $input_name }}')}, form.{{ $name }} == 'custom' ? 'col-md-12' : 'd-none']"
|
||||||
@endif
|
style="margin-top: -25px; padding-left: 5.5rem;"
|
||||||
|
>
|
||||||
|
<div class="input-group input-group-merge {{ $group_class }}">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">
|
||||||
|
<i class="fa fa-{{ $icon }}"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (!empty($attributes['model']))
|
{!! Form::text($input_name, $input_value, [
|
||||||
:model="{{ $attributes['model'] }}"
|
'class' => 'form-control',
|
||||||
@endif
|
'data-name' => $input_name,
|
||||||
|
'data-value' => $input_value,
|
||||||
|
'placeholder' => trans('general.form.enter', ['field' => $text]),
|
||||||
|
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $input_name : 'form.' . $input_name),
|
||||||
|
]) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (!empty($attributes['v-model']))
|
<div class="invalid-feedback d-block"
|
||||||
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
|
v-if="form.errors.has('{{ $input_name }}')"
|
||||||
@elseif (!empty($attributes['data-field']))
|
v-html="form.errors.get('{{ $input_name }}')">
|
||||||
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
|
</div>
|
||||||
@else
|
|
||||||
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event;"
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (!empty($attributes['change']))
|
|
||||||
@change="{{ $attributes['change'] }}($event)"
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (isset($attributes['readonly']))
|
|
||||||
:readonly="{{ $attributes['readonly'] }}"
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (isset($attributes['disabled']))
|
|
||||||
:disabled="{{ $attributes['disabled'] }}"
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (isset($attributes['show']))
|
|
||||||
v-if="{{ $attributes['show'] }}"
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (isset($attributes['v-error-message']))
|
|
||||||
:form-error="{{ $attributes['v-error-message'] }}"
|
|
||||||
@else
|
|
||||||
:form-error="form.errors.get('{{ $name }}')"
|
|
||||||
@endif
|
|
||||||
|
|
||||||
no-data-text="{{ trans('general.no_data') }}"
|
|
||||||
no-matching-data-text="{{ trans('general.no_matching_data') }}"
|
|
||||||
></akaunting-select>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="form-group float-left{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['readonly']) ? ' readonly' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
|
|
||||||
:class="[{'has-error': form.errors.get('{{ $input_name }}')}, form.{{ $name }} == 'custom' ? 'col-md-6' : 'd-none']">
|
|
||||||
{!! Form::label($input_name, trans('settings.invoice.custom'), ['class' => 'form-control-label'])!!}
|
|
||||||
|
|
||||||
<div class="input-group input-group-merge {{ $group_class }}">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text">
|
|
||||||
<i class="fa fa-{{ $icon }}"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
{!! Form::text($input_name, $input_value, [
|
|
||||||
'class' => 'form-control',
|
|
||||||
'data-name' => $input_name,
|
|
||||||
'data-value' => $input_value,
|
|
||||||
'placeholder' => trans('general.form.enter', ['field' => $text]),
|
|
||||||
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $input_name : 'form.' . $input_name),
|
|
||||||
]) !!}
|
|
||||||
</div>
|
</div>
|
||||||
|
@endforeach
|
||||||
<div class="invalid-feedback d-block"
|
|
||||||
v-if="form.errors.has('{{ $input_name }}')"
|
|
||||||
v-html="form.errors.get('{{ $input_name }}')">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="invalid-feedback d-block"
|
||||||
|
v-if="{{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.has("' . $name . '")' }}"
|
||||||
|
v-html="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@stack($name . '_input_end')
|
@stack($name . '_input_end')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user