added show page item custom field..

This commit is contained in:
Cüneyt Şentürk 2020-12-26 19:40:04 +03:00
parent 0c2c5dd890
commit 97fa754eb7

View File

@ -146,174 +146,184 @@
@stack('delete_td_end') @stack('delete_td_end')
</tr> </tr>
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both'])) <tr>
<tr v-if="!row.add_tax || !row.add_discount"> <td colspan="3">
<td colspan="3" style="border: 0;"> @stack('item_custom_fields')
</td> </td>
<td colspan="1" style="border: 0;">
<div>
<button type="button" class="btn btn-link btn-sm p-0" @click="onAddDiscount(index)" v-if="!discount">Add Discount</button>
</div>
</td>
<td colspan="1" style="border: 0;">
<div>
<button type="button" class="btn btn-link btn-sm p-0" @click="onAddTax(index)" v-if="!tax">Add Tax</button>
</div>
</td>
<td colspan="1" style="border: 0;" class="text-right total-column border-bottom-0 long-texts">
</td>
<td colspan="1" style="border: 0;" class="w-1">
</td>
</tr>
<tr v-if="row.add_discount"> <td colspan="4" class="p-0">
<td colspan="3" style="border: 0;"></td> <table class="w-100">
<td colspan="2" style="border: 0;"> <colgroup>
<div> <col style="width: 100px;">
@stack('tax_id_input_start') <col style="width: 100px;">
<div class="input-group input-group-merge"> <col style="width: 250px;">
<div class="input-group-prepend"> <col style="width: 40px;">
<span class="input-group-text" id="input-discount-rate"> </colgroup>
<i class="fa fa-percent"></i> <tbody>
</span> @if (!in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
</div> <tr v-if="!row.add_tax || !row.add_discount">
<input type="number" <td colspan="1" style="border: 0; max-width: 100px; border: 0px; padding-left: 10px;">
max="100" <div style="max-width: 100px;">
min="0" <button type="button" class="btn btn-link btn-sm p-0" @click="onAddDiscount(index)" v-if="!discount">Add Discount</button>
class="form-control text-center" </div>
:name="'items.' + index + '.discount-rate'" </td>
autocomplete="off" <td colspan="1" style="border: 0; max-width: 100px; border: 0px; padding-right: 10px; text-align: right;">
required="required" <div style="max-width: 100px;">
data-item="discount_rate" <button type="button" class="btn btn-link btn-sm p-0" @click="onAddTax(index)" v-if="!tax">Add Tax</button>
v-model="row.discount_rate" </div>
@input="onCalculateTotal" </td>
@change="form.errors.clear('items.' + index + '.discount_rate')"> <td colspan="1" style="border: 0;" class="text-right total-column border-bottom-0 long-texts">
</td>
<div class="invalid-feedback d-block" <td colspan="1" style="border: 0;" class="w-1">
v-if="form.errors.has('items.' + index + '.discount_rate')" </td>
v-html="form.errors.get('items.' + index + '.discount_rate')"> </tr>
</div>
</div>
@stack('tax_id_input_end')
</div>
</td>
<td colspan="1" style="border: 0;" class="text-right total-column border-bottom-0 long-texts">
<div>
{{ Form::moneyGroup('discount', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row.discount', 'data-item' => 'discount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
</div>
</td>
<td colspan="1" style="border: 0;" class="w-1">
<button type="button" @click="onDeleteDiscount(index)" class="btn btn-link btn-sm p-0">
<i class="far fa-trash-alt"></i>
</button>
</td>
</tr>
<tr v-if="row.add_tax" v-for="(row_tax, row_tax_index) in row.tax_ids" <tr v-if="row.add_discount">
:index="row_tax_index"> <td colspan="3" style="border: 0;"></td>
@else <td colspan="2" style="border: 0;">
<tr v-for="(row_tax, row_tax_index) in row.tax_ids" <div>
:index="row_tax_index"> @stack('tax_id_input_start')
@endif <div class="input-group input-group-merge">
<td class="pb-0" colspan="2" style="border: 0;"> <div class="input-group-prepend">
</td> <span class="input-group-text" id="input-discount-rate">
<td class="pb-0 pr-0 align-middle text-right long-texts" colspan="1" style="border: 0;"> <i class="fa fa-percent"></i>
<span class="invoice-item-row-tax-section__tax__add__label">{{ trans_choice('general.taxes', 1) }}</span> </span>
</td> </div>
<td class="pb-0" colspan="2" style="border: 0; padding-right: 5px; padding-left: 5px;" > <input type="number"
<div> max="100"
@stack('taxes_input_start') min="0"
<akaunting-select class="form-control text-center"
class="mb-0 select-tax" :name="'items.' + index + '.discount-rate'"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]" autocomplete="off"
:icon="''" required="required"
:title="''" data-item="discount_rate"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'" v-model="row.discount_rate"
:name="'items.' + index + '.taxes.' + row_tax_index" @input="onCalculateTotal"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}" @change="form.errors.clear('items.' + index + '.discount_rate')">
:disabled-options="form.items[index].tax_ids"
:value="row_tax.id" <div class="invalid-feedback d-block"
@interface="row_tax.id = $event" v-if="form.errors.has('items.' + index + '.discount_rate')"
@change="onCalculateTotal()" v-html="form.errors.get('items.' + index + '.discount_rate')">
@new="taxes.push($event)" </div>
:form-error="form.errors.get('items.' + index + '.taxes')" </div>
:no-data-text="'{{ trans('general.no_data') }}'" @stack('tax_id_input_end')
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'" </div>
></akaunting-select> </td>
@stack('taxes_input_end') <td colspan="1" style="border: 0;" class="text-right total-column border-bottom-0 long-texts">
</div> <div>
</td> {{ Form::moneyGroup('discount', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row.discount', 'data-item' => 'discount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
<td colspan="1" style="border: 0;" class="pb-0 text-right long-texts"> </div>
<div> </td>
{{ Form::moneyGroup('tax', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row_tax.price', 'data-item' => 'total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }} <td colspan="1" style="border: 0;" class="w-1">
</div> <button type="button" @click="onDeleteDiscount(index)" class="btn btn-link btn-sm p-0">
</td> <i class="far fa-trash-alt"></i>
<td colspan="1" style="border: 0;" class="pb-0 align-middle"> </button>
<button type="button" @click="onDeleteTax(index, row_tax_index)" class="btn btn-link btn-delete p-0"> </td>
<i class="far fa-trash-alt"></i> </tr>
</button>
</td>
</tr>
<tr v-if="row.add_tax"> <tr v-if="row.add_tax" v-for="(row_tax, row_tax_index) in row.tax_ids"
<td class="pb-0" colspan="2" style="border: 0;"> :index="row_tax_index">
</td> @else
<td class="pb-0 pr-0 align-middle text-right long-texts" colspan="1" style="border: 0;"> <tr v-for="(row_tax, row_tax_index) in row.tax_ids"
<span class="invoice-item-row-tax-section__tax__add__label">{{ trans_choice('general.taxes', 1) }}</span> :index="row_tax_index">
</td> @endif
<td colspan="2" style="border: 0; padding-right: 5px; padding-left: 5px;"> <td colspan="2" class="pb-0" style="border: 0; padding-right: 5px; padding-left: 5px;" >
<div> <div style="margin-left: -30px; margin-right: 35px;">
@stack('taxes_input_start') <span style="float: left; margin-right: 10px; margin-top: 15px;">{{ trans_choice('general.taxes', 1) }}</span>
<akaunting-select
class="mb-0 select-tax"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]"
:icon="''"
:title="''"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
:name="'items.' + index + '.taxes.999'"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
:disabled-options="form.items[index].tax_ids"
:value="tax_id"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'path' => route('modals.taxes.create'),
'type' => 'modal',
'field' => [
'key' => 'id',
'value' => 'title'
],
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
]
])}}"
@interface="tax_id = $event"
@visible-change="onSelectedTax(index)"
@new="taxes.push($event)"
:form-error="form.errors.get('items.' + index + '.taxes')"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack('taxes_input_end')
</div>
</td>
<td colspan="1" style="border: 0;" class="text-right long-texts align-middle">
<div>
__
</div>
</td>
<td colspan="1" style="border: 0;">
@stack('taxes_input_start')
<akaunting-select
class="mb-0 select-tax"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]"
:icon="''"
:title="''"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
:name="'items.' + index + '.taxes.' + row_tax_index"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
:disabled-options="form.items[index].tax_ids"
:value="row_tax.id"
@interface="row_tax.id = $event"
@change="onCalculateTotal()"
@new="taxes.push($event)"
:form-error="form.errors.get('items.' + index + '.taxes')"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack('taxes_input_end')
</div>
</td>
<td colspan="1" style="border: 0;" class="pb-0 text-right long-texts">
<div>
{{ Form::moneyGroup('tax', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row_tax.price', 'data-item' => 'total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
</div>
</td>
<td colspan="1" style="border: 0;" class="pb-0 align-middle">
<button type="button" @click="onDeleteTax(index, row_tax_index)" class="btn btn-link btn-delete p-0">
<i class="far fa-trash-alt"></i>
</button>
</td>
</tr>
<tr v-if="row.add_tax">
<td colspan="2" style="border: 0; padding-right: 5px; padding-left: 5px;">
<div style="margin-left: -30px; margin-right:35px;">
<span style="float: left; margin-right: 10px; margin-top: 15px;">{{ trans_choice('general.taxes', 1) }}</span>
@stack('taxes_input_start')
<akaunting-select
class="mb-0 select-tax"
:form-classes="[{'has-error': form.errors.has('items.' + index + '.taxes') }]"
:icon="''"
:title="''"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
:name="'items.' + index + '.taxes.999'"
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
:disabled-options="form.items[index].tax_ids"
:value="tax_id"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'path' => route('modals.taxes.create'),
'type' => 'modal',
'field' => [
'key' => 'id',
'value' => 'title'
],
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
]
])}}"
@interface="tax_id = $event"
@visible-change="onSelectedTax(index)"
@new="taxes.push($event)"
:form-error="form.errors.get('items.' + index + '.taxes')"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack('taxes_input_end')
</div>
</td>
<td colspan="1" style="border: 0;" class="text-right long-texts align-middle">
<div>
__
</div>
</td>
<td colspan="1" style="border: 0;">
</td>
</tr>
</tbody>
</table>
</td> </td>
</tr> <tr>
</tbody> </tbody>
</table> </table>
</td> </td>