2020-02-04 15:16:15 +03:00
|
|
|
<tr class="d-flex flex-nowrap" v-for="(row, index) in form.items"
|
2019-11-16 10:21:14 +03:00
|
|
|
:index="index">
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('actions_td_start')
|
2019-11-16 10:21:14 +03:00
|
|
|
<td class="col-md-1 action-column border-right-0 border-bottom-0">
|
|
|
|
@stack('actions_button_start')
|
|
|
|
<button type="button"
|
|
|
|
@click="onDeleteItem(index)"
|
|
|
|
data-toggle="tooltip"
|
|
|
|
title="{{ trans('general.delete') }}"
|
|
|
|
class="btn btn-icon btn-outline-danger btn-lg"><i class="fa fa-trash"></i>
|
|
|
|
</button>
|
|
|
|
@stack('actions_button_end')
|
|
|
|
</td>
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('actions_td_end')
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('name_td_start')
|
2019-11-16 10:21:14 +03:00
|
|
|
<td class="col-md-3 border-right-0 border-bottom-0">
|
|
|
|
@stack('name_input_start')
|
2020-01-21 17:17:05 +03:00
|
|
|
<akaunting-select-remote
|
|
|
|
:form-classes="[{'has-error': form.errors.get('name') }]"
|
|
|
|
:placeholder="'{{ trans('general.type_item_name') }}'"
|
|
|
|
:name="'item_id'"
|
|
|
|
:options="{{ json_encode($items) }}"
|
|
|
|
:value="'{{ old('item_id', '') }}'"
|
|
|
|
:add-new="{{ json_encode([
|
|
|
|
'status' => true,
|
2020-01-23 10:55:42 +03:00
|
|
|
'text' => trans('general.add_new'),
|
2020-01-21 17:17:05 +03:00
|
|
|
'path' => route('modals.items.store'),
|
|
|
|
'type' => 'inline',
|
|
|
|
'field' => 'name',
|
|
|
|
])}}"
|
|
|
|
@interface="row.item_id = $event"
|
|
|
|
@label="row.name = $event"
|
|
|
|
@option="onSelectItem($event, index)"
|
|
|
|
:remote-action="'{{ route('items.autocomplete') }}'"
|
|
|
|
:remote-type="'bill'"
|
|
|
|
:currency-code="form.currency_code"
|
|
|
|
:form-error="form.errors.get('name')"
|
|
|
|
:loading-text="'{{ trans('general.loading') }}'"
|
|
|
|
:no-data-text="'{{ trans('general.no_data') }}'"
|
|
|
|
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
|
|
|
|
></akaunting-select-remote>
|
|
|
|
<input type="hidden"
|
|
|
|
data-item="name"
|
|
|
|
v-model="row.name"
|
|
|
|
@input="onCalculateTotal"
|
|
|
|
name="item[][name]">
|
|
|
|
{!! $errors->first('item.name', '<p class="help-block">:message</p>') !!}
|
2019-11-16 10:21:14 +03:00
|
|
|
@stack('name_input_end')
|
|
|
|
</td>
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('name_td_end')
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('quantity_td_start')
|
2020-01-29 06:19:03 +03:00
|
|
|
<td class="col-md-1 border-right-0 border-bottom-0">
|
2019-11-16 10:21:14 +03:00
|
|
|
@stack('quantity_input_start')
|
|
|
|
<input class="form-control text-center"
|
2019-12-19 14:07:44 +03:00
|
|
|
autocomplete="off"
|
2019-11-16 10:21:14 +03:00
|
|
|
required="required"
|
|
|
|
data-item="quantity"
|
|
|
|
v-model="row.quantity"
|
|
|
|
@input="onCalculateTotal"
|
|
|
|
name="item[][quantity]"
|
|
|
|
type="text">
|
|
|
|
{!! $errors->first('item.quantity', '<p class="help-block">:message</p>') !!}
|
|
|
|
@stack('quantity_input_end')
|
|
|
|
</td>
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('quantity_td_end')
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('price_td_start')
|
2019-11-16 10:21:14 +03:00
|
|
|
<td class="col-md-2 border-right-0 border-bottom-0">
|
|
|
|
@stack('price_input_start')
|
|
|
|
<input class="form-control text-right input-price"
|
2019-12-19 14:07:44 +03:00
|
|
|
autocomplete="off"
|
2020-01-21 17:17:05 +03:00
|
|
|
required="required"
|
2019-11-16 10:21:14 +03:00
|
|
|
data-item="price"
|
|
|
|
v-model.lazy="row.price"
|
|
|
|
v-money="money"
|
|
|
|
@input="onCalculateTotal"
|
|
|
|
name="items[][price]"
|
|
|
|
type="text">
|
|
|
|
<input name="items[][currency]"
|
|
|
|
data-item="currency"
|
|
|
|
v-model="row.currency"
|
|
|
|
@input="onCalculateTotal"
|
|
|
|
type="hidden">
|
|
|
|
{!! $errors->first('item.price', '<p class="help-block">:message</p>') !!}
|
|
|
|
@stack('price_input_end')
|
|
|
|
</td>
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('price_td_end')
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('taxes_td_start')
|
2020-01-29 06:19:03 +03:00
|
|
|
<td class="col-md-3 border-right-0 border-bottom-0">
|
2019-11-16 10:21:14 +03:00
|
|
|
@stack('tax_id_input_start')
|
|
|
|
{{ Form::multiSelectAddNewGroup('tax_id', '', '', $taxes, '', [
|
|
|
|
'data-item' => 'tax_id',
|
|
|
|
'v-model' => 'row.tax_id',
|
|
|
|
'change' => 'onCalculateTotal',
|
2020-01-21 17:17:05 +03:00
|
|
|
'class' => 'form-control',
|
|
|
|
'collapse' => 'false',
|
|
|
|
'path' => route('modals.taxes.create')
|
2019-11-16 10:21:14 +03:00
|
|
|
], 'mb-0 select-tax') }}
|
|
|
|
@stack('tax_id_input_end')
|
|
|
|
</td>
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('taxes_td_end')
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('total_td_start')
|
2019-11-27 11:16:17 +03:00
|
|
|
<td class="col-md-2 text-right total-column border-bottom-0 long-texts">
|
2019-11-16 10:21:14 +03:00
|
|
|
<input name="item[][total]"
|
|
|
|
data-item="total"
|
|
|
|
v-model.lazy="row.total"
|
|
|
|
v-money="money"
|
|
|
|
type="hidden">
|
|
|
|
@stack('total_input_start')
|
|
|
|
@if (empty($item) || !isset($item->total))
|
|
|
|
<span id="item-total" v-html="row.total">0</span>
|
|
|
|
@else
|
|
|
|
<span id="item-total" v-html="row.total">@money($item->total, $bill->currency_code, true)</span>
|
|
|
|
@endif
|
|
|
|
@stack('total_input_end')
|
|
|
|
</td>
|
2018-08-16 11:34:08 +03:00
|
|
|
@stack('total_td_end')
|
|
|
|
</tr>
|