document item line discount active then tax styling..
This commit is contained in:
parent
b86dadb278
commit
f753cfa077
10
resources/assets/js/views/common/documents.js
vendored
10
resources/assets/js/views/common/documents.js
vendored
@ -361,6 +361,12 @@ const app = new Vue({
|
||||
},
|
||||
|
||||
onDeleteTax(item_index, tax_index) {
|
||||
if (tax_index == '999') {
|
||||
this.items[item_index].add_tax = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.items[item_index].tax_ids.splice(tax_index, 1);
|
||||
this.form.items[item_index].tax_ids.splice(tax_index, 1);
|
||||
|
||||
@ -542,9 +548,9 @@ const app = new Vue({
|
||||
description: item.description === null ? "" : item.description,
|
||||
quantity: item.quantity,
|
||||
price: (item.price).toFixed(2),
|
||||
add_tax: true,
|
||||
add_tax: (!item_taxes.length && document.getElementById('invoice-item-discount-rows') != null) ? false : true,
|
||||
tax_ids: item_taxes,
|
||||
add_discount: (item_taxes.length) ? true : false,
|
||||
add_discount: (item.discount_rate) ? true : false,
|
||||
discount: item.discount_rate,
|
||||
total: (item.total).toFixed(2)
|
||||
});
|
||||
|
@ -73,7 +73,7 @@
|
||||
|
||||
@stack('add_item_td_start')
|
||||
<tr id="addItem">
|
||||
<td class="text-right border-bottom-0 p-0" colspan="{{ 7 }}" :colspan="colspan">
|
||||
<td class="text-right border-bottom-0 p-0" colspan="{{ 7 }}">
|
||||
<x-select-item-button
|
||||
type="{{ $type }}"
|
||||
is-sale="{{ $isSalePrice }}"
|
||||
|
@ -195,7 +195,7 @@
|
||||
@stack('discount_input_end')
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="1" style="border: 0;" class="text-right total-column border-bottom-0 long-texts">
|
||||
<td colspan="1" style="border: 0;" class="text-right long-texts">
|
||||
<div>
|
||||
{{ Form::moneyGroup('discount', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'value' => 'row.discount', 'data-item' => 'discount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
|
||||
</div>
|
||||
@ -206,14 +206,11 @@
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr v-if="row.add_tax" v-for="(row_tax, row_tax_index) in row.tax_ids"
|
||||
:index="row_tax_index">
|
||||
@else
|
||||
<tr v-for="(row_tax, row_tax_index) in row.tax_ids"
|
||||
:index="row_tax_index">
|
||||
@endif
|
||||
<td colspan="2" class="pb-0" style="border: 0; padding-right: 5px; padding-left: 5px;">
|
||||
<td colspan="2" class="pb-0" :class="{'pb-2' : !row.add_tax}" 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>
|
||||
|
||||
@ -238,12 +235,12 @@
|
||||
@stack('taxes_input_end')
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="1" style="border: 0;" class="pb-0 text-right long-texts">
|
||||
<td colspan="1" style="border: 0;" :class="{'pb-2' : !row.add_tax}" 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">
|
||||
<td colspan="1" style="border: 0;" :class="{'pb-2' : !row.add_tax}" 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>
|
||||
@ -253,7 +250,9 @@
|
||||
<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>
|
||||
<span style="float: left; margin-right: 10px; margin-top: 15px;">
|
||||
{{ trans_choice('general.taxes', 1) }}
|
||||
</span>
|
||||
|
||||
@stack('taxes_input_start')
|
||||
<akaunting-select
|
||||
@ -304,7 +303,7 @@
|
||||
</td>
|
||||
<td colspan="1" style="border: 0;">
|
||||
@if (!$hideDiscount && in_array(setting('localisation.discount_location'), ['item', 'both']))
|
||||
<button type="button" @click="onDeleteTax(index, row_tax_index)" class="btn btn-link btn-delete p-0">
|
||||
<button type="button" @click="onDeleteTax(index, 999)" class="btn btn-link btn-delete p-0">
|
||||
<i class="far fa-trash-alt"></i>
|
||||
</button>
|
||||
@endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user