Merge branch 'akaunting:master' into invoice-form-enhancements
This commit is contained in:
@ -78,7 +78,7 @@
|
||||
@if (!$hideQuantity)
|
||||
<div>
|
||||
@stack('quantity_input_start')
|
||||
<input
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
class="form-control text-center p-0 input-number-disabled"
|
||||
@ -163,11 +163,15 @@
|
||||
</div>
|
||||
@stack('discount_input_start')
|
||||
<div class="form-group mb-0 w-100" style="display: inline-block; position: relative;">
|
||||
<div class="input-group input-group-merge mb-0 select-tax">
|
||||
<div class="input-group mb-0 select-tax">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="input-discount">
|
||||
<i class="fa fa-percent"></i>
|
||||
</span>
|
||||
<button class="btn btn-sm" :class="[{'btn-outline-primary' : row.discount_type !== 'percentage'}, {'btn-primary' : row.discount_type === 'percentage'}]"
|
||||
@click="onChangeLineDiscountType(index, 'percentage')" type="button">
|
||||
<i class="fa fa-percent fa-sm"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm" :class="[{'btn-outline-primary' : row.discount_type !== 'fixed'}, {'btn-primary' : row.discount_type === 'fixed'}]"
|
||||
@click="onChangeLineDiscountType(index, 'fixed')" type="button">{{ $currency->symbol }}
|
||||
</button>
|
||||
</div>
|
||||
<input type="number"
|
||||
max="100"
|
||||
@ -217,18 +221,19 @@
|
||||
: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')) }}"
|
||||
:dynamic-options="dynamic_taxes"
|
||||
:disabled-options="form.items[index].tax_ids"
|
||||
:value="row_tax.id"
|
||||
@interface="row_tax.id = $event"
|
||||
@change="onCalculateTotal()"
|
||||
@new="taxes.push($event)"
|
||||
@new="dynamic_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>
|
||||
|
||||
|
||||
<div class="line-item-content-right">
|
||||
<div class="line-item-content-right-price long-texts text-right">
|
||||
{{ 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') }}
|
||||
@ -243,7 +248,7 @@
|
||||
<div v-if="row.add_tax" class="line-item-area pb-3" :class="{'pt-2' : row.add_discount}">
|
||||
<div class="line-item-content">
|
||||
<div class="long-texts line-item-text" style="float: left; margin-top: 15px; margin-right:2px; position: absolute; left: -63px;">
|
||||
{{ trans_choice('general.taxes', 1) }}
|
||||
{{ trans_choice('general.taxes', 1) }}
|
||||
</div>
|
||||
|
||||
@stack('taxes_input_start')
|
||||
@ -256,6 +261,7 @@
|
||||
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
|
||||
:name="'items.' + index + '.taxes.999'"
|
||||
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
|
||||
:dynamic-options="dynamic_taxes"
|
||||
:disabled-options="form.items[index].tax_ids"
|
||||
:value="tax_id"
|
||||
:add-new="{{ json_encode([
|
||||
@ -281,7 +287,7 @@
|
||||
])}}"
|
||||
@interface="tax_id = $event"
|
||||
@visible-change="onSelectedTax(index)"
|
||||
@new="taxes.push($event)"
|
||||
@new="dynamic_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') }}'"
|
||||
|
@ -49,27 +49,32 @@
|
||||
<el-popover
|
||||
popper-class="p-0 h-0"
|
||||
placement="bottom"
|
||||
width="300"
|
||||
width="350"
|
||||
v-model="discount">
|
||||
<div class="card d-none" :class="[{'show' : discount}]">
|
||||
<div class="discount card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="input-discount">
|
||||
<i class="fa fa-percent"></i>
|
||||
</span>
|
||||
<button class="btn btn-sm" :class="[{'btn-outline-primary' : form.discount_type !== 'percentage'}, {'btn-primary' : form.discount_type === 'percentage'}]"
|
||||
@click="onChangeDiscountType('percentage')" type="button">
|
||||
<i class="fa fa-percent fa-sm"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm" :class="[{'btn-outline-primary' : form.discount_type !== 'fixed'}, {'btn-primary' : form.discount_type === 'fixed'}]"
|
||||
@click="onChangeDiscountType('fixed')" type="button">{{ $currency->symbol }}
|
||||
</button>
|
||||
</div>
|
||||
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control', 'v-model' => 'form.discount']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-4">
|
||||
<div class="discount-description">
|
||||
<strong>{{ trans('invoices.discount_desc') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="discount card-footer">
|
||||
<div class="row float-right">
|
||||
|
@ -175,74 +175,76 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="c-lines">
|
||||
<thead>
|
||||
<tr>
|
||||
@stack('name_th_start')
|
||||
@if (!$hideItems || (!$hideName && !$hideDescription))
|
||||
<th class="text-left item">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th>
|
||||
@endif
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
@if (!$hideQuantity)
|
||||
<th class="quantity">{{ trans($textQuantity) }}</th>
|
||||
@endif
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
@if (!$hidePrice)
|
||||
<th class="price">{{ trans($textPrice) }}</th>
|
||||
@endif
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (!$hideDiscount)
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<th class="discount">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@stack('total_th_start')
|
||||
@if (!$hideAmount)
|
||||
<th class="total">{{ trans($textAmount) }}</th>
|
||||
@endif
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@if ($document->items->count())
|
||||
@foreach($document->items as $item)
|
||||
<x-documents.template.line-item
|
||||
type="{{ $type }}"
|
||||
:item="$item"
|
||||
:document="$document"
|
||||
hide-items="{{ $hideItems }}"
|
||||
hide-name="{{ $hideName }}"
|
||||
hide-description="{{ $hideDescription }}"
|
||||
hide-quantity="{{ $hideQuantity }}"
|
||||
hide-price="{{ $hidePrice }}"
|
||||
hide-discount="{{ $hideDiscount }}"
|
||||
hide-amount="{{ $hideAmount }}"
|
||||
/>
|
||||
@endforeach
|
||||
@else
|
||||
@if (!$hideItems)
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="c-lines">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="5" class="text-center empty-items">
|
||||
{{ trans('documents.empty_items') }}
|
||||
</td>
|
||||
@stack('name_th_start')
|
||||
@if (!$hideItems || (!$hideName && !$hideDescription))
|
||||
<th class="text-left item">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th>
|
||||
@endif
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
@if (!$hideQuantity)
|
||||
<th class="quantity">{{ trans($textQuantity) }}</th>
|
||||
@endif
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
@if (!$hidePrice)
|
||||
<th class="price">{{ trans($textPrice) }}</th>
|
||||
@endif
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (!$hideDiscount)
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<th class="discount">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@stack('total_th_start')
|
||||
@if (!$hideAmount)
|
||||
<th class="total">{{ trans($textAmount) }}</th>
|
||||
@endif
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@if ($document->items->count())
|
||||
@foreach($document->items as $item)
|
||||
<x-documents.template.line-item
|
||||
type="{{ $type }}"
|
||||
:item="$item"
|
||||
:document="$document"
|
||||
hide-items="{{ $hideItems }}"
|
||||
hide-name="{{ $hideName }}"
|
||||
hide-description="{{ $hideDescription }}"
|
||||
hide-quantity="{{ $hideQuantity }}"
|
||||
hide-price="{{ $hidePrice }}"
|
||||
hide-discount="{{ $hideDiscount }}"
|
||||
hide-amount="{{ $hideAmount }}"
|
||||
/>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="5" class="text-center empty-items">
|
||||
{{ trans('documents.empty_items') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row mt-4 clearfix">
|
||||
<div class="col-58">
|
||||
|
@ -160,73 +160,75 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="lines">
|
||||
<thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;">
|
||||
<tr>
|
||||
@stack('name_th_start')
|
||||
@if (!$hideItems || (!$hideName && !$hideDescription))
|
||||
<th class="item text-left text-white">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th>
|
||||
@endif
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
@if (!$hideQuantity)
|
||||
<th class="quantity text-white">{{ trans($textQuantity) }}</th>
|
||||
@endif
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
@if (!$hidePrice)
|
||||
<th class="price text-white">{{ trans($textPrice) }}</th>
|
||||
@endif
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (!$hideDiscount)
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<th class="discount text-white">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@stack('total_th_start')
|
||||
@if (!$hideAmount)
|
||||
<th class="total text-white">{{ trans($textAmount) }}</th>
|
||||
@endif
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($document->items->count())
|
||||
@foreach($document->items as $item)
|
||||
<x-documents.template.line-item
|
||||
type="{{ $type }}"
|
||||
:item="$item"
|
||||
:document="$document"
|
||||
hide-items="{{ $hideItems }}"
|
||||
hide-name="{{ $hideName }}"
|
||||
hide-description="{{ $hideDescription }}"
|
||||
hide-quantity="{{ $hideQuantity }}"
|
||||
hide-price="{{ $hidePrice }}"
|
||||
hide-discount="{{ $hideDiscount }}"
|
||||
hide-amount="{{ $hideAmount }}"
|
||||
/>
|
||||
@endforeach
|
||||
@else
|
||||
@if (!$hideItems)
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="lines">
|
||||
<thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;">
|
||||
<tr>
|
||||
<td colspan="5" class="text-center empty-items">
|
||||
{{ trans('documents.empty_items') }}
|
||||
</td>
|
||||
@stack('name_th_start')
|
||||
@if (!$hideItems || (!$hideName && !$hideDescription))
|
||||
<th class="item text-left text-white">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th>
|
||||
@endif
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
@if (!$hideQuantity)
|
||||
<th class="quantity text-white">{{ trans($textQuantity) }}</th>
|
||||
@endif
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
@if (!$hidePrice)
|
||||
<th class="price text-white">{{ trans($textPrice) }}</th>
|
||||
@endif
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (!$hideDiscount)
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<th class="discount text-white">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@stack('total_th_start')
|
||||
@if (!$hideAmount)
|
||||
<th class="total text-white">{{ trans($textAmount) }}</th>
|
||||
@endif
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($document->items->count())
|
||||
@foreach($document->items as $item)
|
||||
<x-documents.template.line-item
|
||||
type="{{ $type }}"
|
||||
:item="$item"
|
||||
:document="$document"
|
||||
hide-items="{{ $hideItems }}"
|
||||
hide-name="{{ $hideName }}"
|
||||
hide-description="{{ $hideDescription }}"
|
||||
hide-quantity="{{ $hideQuantity }}"
|
||||
hide-price="{{ $hidePrice }}"
|
||||
hide-discount="{{ $hideDiscount }}"
|
||||
hide-amount="{{ $hideAmount }}"
|
||||
/>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="5" class="text-center empty-items">
|
||||
{{ trans('documents.empty_items') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row mt-9 clearfix">
|
||||
<div class="col-58">
|
||||
|
@ -33,7 +33,11 @@
|
||||
@if (!$hideDiscount)
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<td class="discount">{{ $item->discount }}</td>
|
||||
@if ($item->discount_type === 'percentage')
|
||||
<td class="discount">{{ $item->discount }}</td>
|
||||
@else
|
||||
<td class="discount">@money($item->discount, $document->currency_code, true)</td>
|
||||
@endif
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
@endif
|
||||
|
@ -150,73 +150,75 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="m-lines">
|
||||
<thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;">
|
||||
<tr>
|
||||
@stack('name_th_start')
|
||||
@if (!$hideItems || (!$hideName && !$hideDescription))
|
||||
<th class="item text-left text-white">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th>
|
||||
@endif
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
@if (!$hideQuantity)
|
||||
<th class="quantity text-white">{{ trans($textQuantity) }}</th>
|
||||
@endif
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
@if (!$hidePrice)
|
||||
<th class="price text-white">{{ trans($textPrice) }}</th>
|
||||
@endif
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (!$hideDiscount)
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<th class="discount text-white">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@stack('total_th_start')
|
||||
@if (!$hideAmount)
|
||||
<th class="total text-white">{{ trans($textAmount) }}</th>
|
||||
@endif
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($document->items->count())
|
||||
@foreach($document->items as $item)
|
||||
<x-documents.template.line-item
|
||||
type="{{ $type }}"
|
||||
:item="$item"
|
||||
:document="$document"
|
||||
hide-items="{{ $hideItems }}"
|
||||
hide-name="{{ $hideName }}"
|
||||
hide-description="{{ $hideDescription }}"
|
||||
hide-quantity="{{ $hideQuantity }}"
|
||||
hide-price="{{ $hidePrice }}"
|
||||
hide-discount="{{ $hideDiscount }}"
|
||||
hide-amount="{{ $hideAmount }}"
|
||||
/>
|
||||
@endforeach
|
||||
@else
|
||||
@if (!$hideItems)
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="m-lines">
|
||||
<thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;">
|
||||
<tr>
|
||||
<td colspan="5" class="text-center empty-items">
|
||||
{{ trans('documents.empty_items') }}
|
||||
</td>
|
||||
@stack('name_th_start')
|
||||
@if (!$hideItems || (!$hideName && !$hideDescription))
|
||||
<th class="item text-left text-white">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th>
|
||||
@endif
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
@if (!$hideQuantity)
|
||||
<th class="quantity text-white">{{ trans($textQuantity) }}</th>
|
||||
@endif
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
@if (!$hidePrice)
|
||||
<th class="price text-white">{{ trans($textPrice) }}</th>
|
||||
@endif
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (!$hideDiscount)
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<th class="discount text-white">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@stack('total_th_start')
|
||||
@if (!$hideAmount)
|
||||
<th class="total text-white">{{ trans($textAmount) }}</th>
|
||||
@endif
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($document->items->count())
|
||||
@foreach($document->items as $item)
|
||||
<x-documents.template.line-item
|
||||
type="{{ $type }}"
|
||||
:item="$item"
|
||||
:document="$document"
|
||||
hide-items="{{ $hideItems }}"
|
||||
hide-name="{{ $hideName }}"
|
||||
hide-description="{{ $hideDescription }}"
|
||||
hide-quantity="{{ $hideQuantity }}"
|
||||
hide-price="{{ $hidePrice }}"
|
||||
hide-discount="{{ $hideDiscount }}"
|
||||
hide-amount="{{ $hideAmount }}"
|
||||
/>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="5" class="text-center empty-items">
|
||||
{{ trans('documents.empty_items') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row mt-7">
|
||||
<div class="col-58">
|
||||
|
Reference in New Issue
Block a user