akaunting 3.0 (the last dance)
This commit is contained in:
@ -1,156 +1,237 @@
|
||||
<div class="row document-item-body">
|
||||
<div class="col-sm-12 mb-4 p-0">
|
||||
<div class="table-responsive overflow-x-scroll overflow-y-hidden">
|
||||
<table class="table" id="totals">
|
||||
<div class="sm:col-span-6">
|
||||
<div class="mb-4 p-0">
|
||||
<div class="overflow-y-hidden py-6">
|
||||
<table id="totals" class="float-right">
|
||||
<colgroup>
|
||||
<col class="document-total-50">
|
||||
<col class="document-total-30">
|
||||
<col class="document-total-25">
|
||||
<col class="document-total-50-px">
|
||||
<col style="width: 47.5%;">
|
||||
<col style="width: 30%;">
|
||||
<col style="width: 18%;">
|
||||
<col style="width: 50px;">
|
||||
</colgroup>
|
||||
<tbody id="invoice-total-rows" class="table-padding-05">
|
||||
|
||||
<tbody id="invoice-total-rows">
|
||||
@stack('sub_total_td_start')
|
||||
|
||||
<tr id="tr-subtotal">
|
||||
<td class="border-bottom-0 pb-0"></td>
|
||||
<td class="text-right border-right-0 border-bottom-0 align-middle pb-0 pr-0">
|
||||
<strong>{{ trans('invoices.sub_total') }}</strong>
|
||||
<td class="border-b-0 py-0"></td>
|
||||
|
||||
<td class="font-medium text-right border-r-0 border-b-0 align-middle pb-0 pr-0">
|
||||
{{ trans('invoices.sub_total') }}
|
||||
</td>
|
||||
<td class="text-right border-bottom-0 long-texts pb-0 pr-3">
|
||||
|
||||
<td class="text-right border-b-0 long-texts py-0">
|
||||
<div>
|
||||
{{ Form::moneyGroup('sub_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
|
||||
<x-form.input.money
|
||||
name="sub_total"
|
||||
value="0"
|
||||
disabled
|
||||
row-input
|
||||
v-model="totals.sub"
|
||||
:currency="$currency"
|
||||
dynamicCurrency="currency"
|
||||
money-class="text-right disabled-money px-0"
|
||||
form-group-class="text-right disabled-money"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td class="border-bottom-0 pb-0" style="max-width: 50px"></td>
|
||||
|
||||
<td class="border-b-0 pb-0" style="width: 40px"></td>
|
||||
</tr>
|
||||
|
||||
@stack('sub_total_td_end')
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('item_discount_td_start')
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('item_discount_td_start')
|
||||
|
||||
<tr id="tr-line-discount" v-if="totals.item_discount">
|
||||
<td class="border-top-0 pt-0 pb-0"></td>
|
||||
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0 pr-0">
|
||||
<strong>{{ trans('invoices.item_discount') }}</strong>
|
||||
<td class="border-t-0 py-0"></td>
|
||||
|
||||
<td class="text-right border-t-0 border-r-0 border-b-0 align-middle py-0 pr-0">
|
||||
<span class="font-medium">{{ trans('invoices.item_discount') }}</span>
|
||||
</td>
|
||||
<td class="text-right border-top-0 border-bottom-0 long-texts pt-0 pb-0 pr-3">
|
||||
|
||||
<td class="text-right border-t-0 border-b-0 long-texts py-0 pr-0">
|
||||
<div>
|
||||
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
|
||||
<x-form.input.money
|
||||
name="item_discount"
|
||||
value="0"
|
||||
disabled
|
||||
row-input
|
||||
v-model="totals.item_discount"
|
||||
:currency="$currency"
|
||||
dynamicCurrency="currency"
|
||||
money-class="text-right disabled-money px-0"
|
||||
form-group-class="text-right disabled-money"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
|
||||
</tr>
|
||||
@stack('item_discount_td_end')
|
||||
@endif
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
|
||||
@stack('add_discount_td_start')
|
||||
<td class="border-t-0 py-0" style="max-width: 24px"></td>
|
||||
</tr>
|
||||
|
||||
@stack('item_discount_td_end')
|
||||
@endif
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
|
||||
@stack('add_discount_td_start')
|
||||
|
||||
<tr id="tr-discount">
|
||||
<td class="border-top-0 pt-0 pb-0"></td>
|
||||
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0 pr-0">
|
||||
<el-popover
|
||||
popper-class="p-0 h-0"
|
||||
placement="bottom"
|
||||
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-8">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<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-4">
|
||||
<div class="discount-description">
|
||||
<strong>{{ trans('invoices.discount_desc') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="discount card-footer py-3">
|
||||
<div class="row float-right">
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
<a href="javascript:void(0)" @click="discount = false" class="btn btn-outline-secondary" @click="closePayment">
|
||||
{{ trans('general.cancel') }}
|
||||
</a>
|
||||
{!! Form::button(trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddTotalDiscount', 'class' => 'btn btn-success']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-link class="cursor-pointer text-info" slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
|
||||
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
|
||||
</el-popover>
|
||||
</td>
|
||||
<td class="text-right border-top-0 border-bottom-0 pt-0 pb-0 pr-3">
|
||||
<div>
|
||||
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
|
||||
<td class="border-t-0 py-0"></td>
|
||||
|
||||
<td class="text-right border-t-0 border-r-0 border-b-0 align-middle py-0 pr-0">
|
||||
<div v-if="show_discount_text">
|
||||
<span class="border-b border-transparent transition-all text-sm text-purple cursor-pointer hover:border-purple" v-if="!totals.discount_text" @click="onAddDiscount()">
|
||||
{{ trans('invoices.add_discount') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span v-if="totals.discount_text" v-html="totals.discount_text"></span>
|
||||
|
||||
<div class="flex items-center justify-end" v-if="show_discount">
|
||||
<div class="w-16 flex items-center bg-gray-200 p-1 ltr:mr-2 rtl:ml-2 rounded-lg">
|
||||
<button type="button"
|
||||
class="w-7 flex justify-center px-2"
|
||||
:class="[{'btn-outline-primary' : form.discount_type !== 'percentage'}, {'bg-white rounded-lg' : form.discount_type === 'percentage'}]"
|
||||
@click="onChangeDiscountType('percentage')"
|
||||
>
|
||||
<span class="material-icons text-lg">percent</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
class="w-7 flex text-lg justify-center px-2"
|
||||
:class="[{'btn-outline-primary' : form.discount_type !== 'fixed'}, {'bg-white rounded-lg' : form.discount_type === 'fixed'}]"
|
||||
@click="onChangeDiscountType('fixed')"
|
||||
>
|
||||
{{ $currency->symbol }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<x-form.group.number name="pre_discount" id="pre-discount" form-group-class="-mt-1" v-model="form.discount" @input="onAddTotalDiscount" />
|
||||
</div>
|
||||
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
|
||||
</td>
|
||||
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
|
||||
|
||||
<td class="relative text-right border-t-0 border-b-0 py-0 pr-0">
|
||||
<div>
|
||||
<x-form.input.money
|
||||
name="discount_total"
|
||||
value="0"
|
||||
disabled
|
||||
row-input
|
||||
v-model="totals.discount"
|
||||
:currency="$currency"
|
||||
dynamicCurrency="currency"
|
||||
money-class="text-right disabled-money px-0"
|
||||
form-group-class="text-right disabled-money"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<x-form.input.hidden name="discount" v-model="form.discount" />
|
||||
|
||||
<span v-if="delete_discount" @click="onRemoveDiscountArea()" class="material-icons-outlined absolute w-6 h-7 flex justify-center -right-10 top-2 text-lg text-gray-300 rounded-lg cursor-pointer hover:bg-gray-100 hover:text-gray-500">delete</span>
|
||||
</td>
|
||||
|
||||
<td class="border-t-0 py-0" style="max-width: 50px"></td>
|
||||
</tr>
|
||||
@stack('add_discount_td_end')
|
||||
@endif
|
||||
|
||||
@stack('tax_total_td_start')
|
||||
<tr v-for="(tax, tax_index) in totals.taxes"
|
||||
:index="tax_index">
|
||||
<td class="border-top-0 pt-0 pb-0"></td>
|
||||
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0 pr-0">
|
||||
<strong v-html="tax.name"></strong>
|
||||
@stack('add_discount_td_end')
|
||||
@endif
|
||||
|
||||
@stack('tax_total_td_start')
|
||||
|
||||
<tr v-for="(tax, tax_index) in totals.taxes" :index="tax_index">
|
||||
<td class="border-t-0 pt-5 pb-0"></td>
|
||||
|
||||
<td class="text-right border-t-0 border-r-0 border-b-0 align-middle pt-5 pb-0 pr-0">
|
||||
<span class="font-medium" v-html="tax.name"></span>
|
||||
</td>
|
||||
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0 pr-3">
|
||||
|
||||
<td class="text-right border-t-0 border-b-0 long-texts pt-5 pb-0 pl-3">
|
||||
<div>
|
||||
{{ Form::moneyGroup('tax_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'tax.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
|
||||
<x-form.input.money
|
||||
name="tax_total"
|
||||
value="0"
|
||||
disabled
|
||||
row-input
|
||||
v-model="tax.total"
|
||||
:currency="$currency"
|
||||
dynamicCurrency="currency"
|
||||
money-class="text-right disabled-money px-0"
|
||||
form-group-class="text-right disabled-money"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
|
||||
</tr>
|
||||
@stack('tax_total_td_end')
|
||||
|
||||
@stack('grand_total_td_start')
|
||||
<td class="border-t-0 pt-5 pb-0" style="max-width: 50px"></td>
|
||||
</tr>
|
||||
|
||||
@stack('tax_total_td_end')
|
||||
|
||||
@stack('grand_total_td_start')
|
||||
|
||||
<tr id="tr-total">
|
||||
<td class="border-top-0 pt-0 pb-0"></td>
|
||||
<td class="text-right border-top-0 border-right-0 align-middle pt-0 pb-0 pr-0">
|
||||
<strong class="document-total-span">{{ trans('invoices.total') }}</strong>
|
||||
{{ Form::selectGroup('currency_code', '', 'exchange-alt', $currencies, $currency->code, ['required' => 'required', 'model' => 'form.currency_code', 'change' => 'onChangeCurrency'], 'document-total-currency') }}
|
||||
{!! Form::hidden('currency_rate', (!empty($document)) ? $document->currency_rate : $currency->rate, ['id' => 'currency_rate', 'class' => 'form-control', 'required' => 'required']) !!}
|
||||
<td class="border-t-0 pt-5 pb-0"></td>
|
||||
|
||||
<td class="flex items-center justify-end pt-5 pb-0">
|
||||
<span class="w-16 text-right font-medium mt-2 ltr:mr-2 rtl:ml-2">
|
||||
{{ trans('invoices.total') }}
|
||||
</span>
|
||||
|
||||
<x-form.group.select
|
||||
name="currency_code"
|
||||
:options="$currencies"
|
||||
selected="{{ $currency->code }}"
|
||||
change="onChangeCurrency"
|
||||
model="form.currency_code"
|
||||
form-group-class="h-8 -mt-2"
|
||||
/>
|
||||
|
||||
<x-form.input.hidden name="currency_rate" :value="(!empty($document)) ? $document->currency_rate : $currency->rate" />
|
||||
</td>
|
||||
<td class="text-right border-top-0 long-texts pt-0 pb-0 pr-3">
|
||||
|
||||
<td class="text-right border-t-0 long-texts pt-5 pb-0 pr-0">
|
||||
<div>
|
||||
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
|
||||
<x-form.input.money
|
||||
name="grand_total"
|
||||
value="0"
|
||||
disabled
|
||||
row-input
|
||||
v-model="totals.total"
|
||||
:currency="$currency"
|
||||
dynamicCurrency="currency"
|
||||
money-class="text-right disabled-money px-0"
|
||||
form-group-class="text-right disabled-money"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
|
||||
|
||||
<td class="border-t-0 pt-5 pb-0" style="max-width: 50px"></td>
|
||||
</tr>
|
||||
|
||||
@stack('grand_total_td_end')
|
||||
|
||||
@stack('currency_conversion_td_start')
|
||||
<tr id="tr-currency-conversion" class="d-none" :class="[{'d-table-row': (('{{ $currency->code }}' != form.currency_code) && totals.total || dropdown_visible)}]">
|
||||
<td class="border-top-0 pb-0"></td>
|
||||
<td class="text-right border-top-0 border-right-0 align-middle pb-0 pr-3 pr-0" colspan="2">
|
||||
<akaunting-currency-conversion
|
||||
currency-conversion-text="{{ trans('currencies.conversion') }}"
|
||||
:price="(totals.total / form.currency_rate).toFixed(2)"
|
||||
:currecy-code="form.currency_code"
|
||||
:currency-rate="form.currency_rate"
|
||||
:currency-symbol="currency_symbol"
|
||||
@change="form.currency_rate = $event"
|
||||
></akaunting-currency-conversion>
|
||||
</td>
|
||||
<td class="border-top-0 pt-0 pb-0" style="max-width: 50px"></td>
|
||||
</tr>
|
||||
@stack('currency_conversion_td_end')
|
||||
|
||||
<tr id="tr-currency-conversion" :class="[
|
||||
{'hidden': ! (('{{ $currency->code }}' != form.currency_code) && totals.total || dropdown_visible)},
|
||||
{'contents': (('{{ $currency->code }}' != form.currency_code) && totals.total || dropdown_visible)}
|
||||
]">
|
||||
<td class="border-t-0 pt-5 pb-0"></td>
|
||||
|
||||
<td colspan="2" class="text-right border-t-0 border-r-0 align-middle pt-5 pb-0 pr-0">
|
||||
<akaunting-currency-conversion
|
||||
currency-conversion-text="{{ trans('currencies.conversion') }}"
|
||||
:price="(totals.total / form.currency_rate).toFixed(2)"
|
||||
:currecy-code="form.currency_code"
|
||||
:currency-rate="form.currency_rate"
|
||||
:currency-symbol="currency_symbol"
|
||||
@change="form.currency_rate = $event"
|
||||
></akaunting-currency-conversion>
|
||||
</td>
|
||||
|
||||
<td class="border-t-0 pt-5 pb-0" style="max-width: 50px"></td>
|
||||
</tr>
|
||||
|
||||
@stack('currency_conversion_td_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user