Merge Invoice and Bill into Document

This commit is contained in:
Burak Çakırel
2020-12-24 01:28:38 +03:00
parent 830cc05957
commit 0c1424db47
436 changed files with 31655 additions and 37350 deletions

View File

@ -0,0 +1,29 @@
<div class="accordion">
<div class="card">
<div class="card-header" id="accordion-recurring-and-more-header" data-toggle="collapse" data-target="#accordion-recurring-and-more-body" aria-expanded="false" aria-controls="accordion-recurring-and-more-body">
<h4 class="mb-0">{{ trans('general.recurring_and_more') }}</h4>
</div>
<div id="accordion-recurring-and-more-body" class="collapse hide" aria-labelledby="accordion-recurring-and-more-header">
<div class="card-body">
<div class="row">
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideRecurring)
{{ Form::recurring('create') }}
@endif
</div>
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideCategory)
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.' . $category_type . '_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=' . $category_type, 'remote_action' => route('categories.index'). '?type=' . $category_type], 'col-md-12') }}
@endif
@if (!$hideAttachment)
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
@endif
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,8 @@
<div class="card">
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('invoices.index') }}
</div>
</div>
</div>

View File

@ -0,0 +1,51 @@
<div class="accordion">
<div class="card">
<div class="card-header" id="accordion-company-header" data-toggle="collapse" data-target="#accordion-company-body" aria-expanded="false" aria-controls="accordion-company-body">
<h4 class="mb-0">{{ trans_choice('general.companies', 1) }}</h4>
</div>
<div id="accordion-company-body" class="collapse hide" aria-labelledby="accordion-company-header">
<div class="card-body">
<div class="row">
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideLogo)
{{ Form::fileGroup('company_logo', trans('settings.company.logo'), 'file-image-o', [], setting('company.logo')) }}
@endif
</div>
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideDocumentTitle)
{{ Form::textGroup($inputNameType . '_title', trans('settings.' . $type . '.title'), 'font', [], setting($type . '.title'), 'col-md-12') }}
@endif
@if (!$hideDocumentSubheading)
{{ Form::textGroup($inputNameType . '_subheading', trans('settings.' . $type . '.subheading'), 'font', [], setting($type . '.subheading'), 'col-md-12') }}
@endif
@if (!$hideCompanyEdit)
<akaunting-company-edit company-id="{{ session('company_id') }}"
button-text="{{ trans('Edit your business address') }}"
taxt-number-text="{{ trans('general.tax_number') }}"
:company="{{ json_encode($company) }}"
:company-form="{{ json_encode([
'show' => true,
'text' => trans('Edit your business address'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
]
])}}"
></akaunting-company-edit>
@endif
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,74 @@
@if (empty($document))
{!! Form::open([
'route' => $formRoute,
'id' => $formId,
'@submit.prevent' => $formSubmit,
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
@else
{!! Form::model($document, [
'route' => [$formRoute, $document->id],
'id' => $formId,
'method' => 'PATCH',
'@submit.prevent' => $formSubmit,
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
@endif
@if (!$hideCompany)
<x-documents.form.company
type="{{ $type }}"
hide-logo="{{ $hideLogo }}"
hide-document-title="{{ $hideDocumentTitle }}"
hide-document-subheading="{{ $hideDocumentSubheading }}"
hide-company-edit="{{ $hideCompanyEdit }}"
/>
@endif
<x-documents.form.main
type="{{ $type }}"
:document="$document"
hide-contact="{{ $hideContact }}"
contact-type="{{ $contactType }}"
hide-issue-at="{{ $hideIssuedAt }}"
text-issue-at="{{ $textIssuedAt }}"
hide-document-number="{{ $hideDocumentNumber }}"
text-document-number="{{ $textDocumentNumber }}"
hide-due-at="{{ $hideDueAt }}"
text-due-at="{{ $textDueAt }}"
hide-order-number="{{ $hideOrderNumber }}"
text-order-number="{{ $textOrderNumber }}"
/>
@if (!$hideFooter)
<x-documents.form.footer type="{{ $type }}" :document="$document" />
@endif
@if (!$hideAdvanced)
<x-documents.form.advanced
type="{{ $type }}"
:document="$document"
hide-recurring="{{ $hideRecurring }}"
hide-category="{{ $hideCategory }}"
hide-attachment="{{ $hideAttachment }}"
/>
@endif
@if (!$hideButtons)
<x-documents.form.buttons
type="{{ $type }}"
:document="$document"
/>
@endif
{{ Form::hidden('type', old('type', $type), ['id' => 'type', 'v-model' => 'form.type']) }}
{{ Form::hidden('status', old('status', 'draft'), ['id' => 'status', 'v-model' => 'form.status']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
{!! Form::close() !!}

View File

@ -0,0 +1,12 @@
<div class="accordion">
<div class="card">
<div class="card-header" id="accordion-footer-header" data-toggle="collapse" data-target="#accordion-footer-body" aria-expanded="false" aria-controls="accordion-footer-body">
<h4 class="mb-0">{{ trans('general.footer') }}</h4>
</div>
<div id="accordion-footer-body" class="collapse hide" aria-labelledby="accordion-footer-header">
{{ Form::textareaGroup('footer', '', '', setting($type . '.footer'), ['rows' => '3'], 'embed-acoordion-textarea') }}
</div>
</div>
</div>

View File

@ -0,0 +1,81 @@
<div class="row document-item-body">
<div class="col-sm-12 p-0" style="table-layout: fixed;">
@php $item_colspan = in_array(setting('localisation.discount_location', 'total'), ['item', 'both']) ? '6' : '5' @endphp
@if (!$hideEditItemColumns)
<x-edit-item-columns type="{{ $type }}" />
@endif
<div class="table-responsive overflow-x-scroll overflow-y-hidden">
<table class="table" id="items" style="table-layout: fixed">
<colgroup>
<col style="width: 40px;">
<col style="width: 25%;">
<col style="width: 30%;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 250px;">
<col style="width: 40px;">
</colgroup>
<thead class="thead-light">
<tr>
@stack('move_th_start')
<th class="text-left border-top-0 border-right-0 border-bottom-0"></th>
@stack('move_th_end')
@if (!$hideItems)
@stack('name_th_start')
<th class="text-left border-top-0 border-right-0 border-bottom-0">{{ $textItems }}</th>
@stack('name_th_end')
@stack('move_th_start')
<th class="text-left border-top-0 border-right-0 border-bottom-0"></th>
@stack('move_th_end')
@endif
@stack('quantity_th_start')
@if (!$hideQuantity)
<th class="text-center border-top-0 border-right-0 border-bottom-0" style="padding-right: 5px;">{{ $textQuantity }}</th>
@endif
@stack('quantity_th_end')
@stack('price_th_start')
@if (!$hidePrice)
<th class="text-right border-top-0 border-right-0 border-bottom-0" style="padding-left: 5px;">{{ $textPrice }}</th>
@endif
@stack('price_th_end')
@if (!$hideDiscount)
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
@stack('discount_th_start')
<th class="text-right border-top-0 border-right-0 border-bottom-0">{{ trans('invoices.discount') }}</th>
@stack('discount_th_end')
@endif
@endif
@stack('total_th_start')
@if (!$hideAmount)
<th class="text-right border-top-0 border-bottom-0 item-total">{{ $textAmount }}</th>
@endif
@stack('total_th_end')
@stack('remove_th_start')
<th class="text-left border-top-0 border-right-0 border-bottom-0"></th>
@stack('remove_th_end')
</tr>
</thead>
<tbody id="invoice-item-rows">
@include('components.documents.form.line-item')
@stack('add_item_td_start')
<tr id="addItem">
<td class="text-right border-bottom-0" colspan="{{ '7' }}">
<x-select-item-button type="{{ $type }}" />
</td>
</tr>
@stack('add_item_td_end')
</tbody>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,318 @@
<tr v-for="(row, index) in items"
:index="index">
@stack('name_td_start')
<td class="border-right-0 border-bottom-0 p-0"
:class="[{'has-error': form.errors.has('items.' + index + '.name') }]"
colspan="7">
<table class="w-100">
<colgroup>
<col style="width: 40px;">
<col style="width: 25%;">
<col style="width: 30%;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 250px;">
<col style="width: 40px;">
</colgroup>
<tbody>
<tr>
@stack('move_td_start')
<td class="pb-4 align-middle" colspan="1" style="color: #8898aa;">
<div draggable="true">
<i class="fas fa-grip-vertical"></i>
</div>
</td>
@stack('move_td_end')
@stack('items_td_start')
@if (!$hideItems || (!$hideName && !$hideDescription))
@stack('name_td_start')
@if (!$hideName)
<td class="pb-4 align-middle" colspan="1">
<span class="aka-text aka-text--body" tabindex="0" v-html="row.name"></span>
</td>
@endif
@stack('name_td_end')
@stack('description_td_start')
@if (!$hideDescription)
<td class="pb-4" colspan="1">
<textarea
class="form-control"
placeholder="Enter item description"
style="height: 38px;"
:name="'items.' + index + '.description'"
v-model="row.description"
data-item="description"
resize="none"
></textarea>
</td>
@endif
@stack('description_td_end')
@endif
@stack('items_td_end')
@stack('quantity_td_start')
@if (!$hideQuantity)
<td colspan="1" class="pb-4" style="padding-right: 5px; padding-left: 5px;">
<div>
@stack('quantity_input_start')
<input type="text"
class="form-control text-center p-0"
:name="'items.' + index + '.quantity'"
autocomplete="off"
required="required"
data-item="quantity"
v-model="row.quantity"
@input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.quantity')">
<div class="invalid-feedback d-block"
v-if="form.errors.has('items.' + index + '.quantity')"
v-html="form.errors.get('items.' + index + '.quantity')">
</div>
@stack('quantity_input_end')
</div>
</td>
@endif
@stack('quantity_td_end')
@stack('price_td_start')
@if (!$hidePrice)
<td colspan="1" class="pb-4" style="padding-right: 5px; padding-left: 5px;">
<div>
@stack('price_input_start')
{{ Form::moneyGroup('price', '', '', ['required' => 'required', 'row-input' => 'true', 'v-model' => 'row.price', 'v-error' => 'form.errors.get(\'items.\' + index + \'.price\')', 'v-error-message' => 'form.errors.get(\'items.\' + index + \'.price\')' , 'data-item' => 'price', 'currency' => $currency, 'dynamic-currency' => 'currency', 'change' => 'row.price = $event; form.errors.clear(\'items.\' + index + \'.price\'); onCalculateTotal'], 0.00, 'text-right input-price p-0') }}
@stack('price_input_end')
</div>
</td>
@endif
@stack('price_td_end')
@if (!$hideDiscount)
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
@stack('discount_td_start')
<td colspan="1" class="pb-4"
:class="[{'has-error': form.errors.has('items.' + index + '.discount') }]">
@stack('discount_input_start')
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text" id="input-discount">
<i class="fa fa-percent"></i>
</span>
</div>
<input type="number"
max="100"
min="0"
class="form-control text-center p-0"
:name="'items.' + index + '.discount'"
autocomplete="off"
required="required"
data-item="discount"
v-model="row.discount"
@input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.discount')">
<div class="invalid-feedback d-block"
v-if="form.errors.has('items.' + index + '.discount')"
v-html="form.errors.get('items.' + index + '.discount')">
</div>
</div>
@stack('discount_input_end')
</td>
@stack('discount_td_end')
@endif
@endif
@stack('total_td_start')
@if (!$hideAmount)
<td colspan="1" class="text-right long-texts pb-4">
<div>
{{ Form::moneyGroup('total', '', '', ['required' => 'required', 'disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'row.total', 'data-item' => 'total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right input-price disabled-money') }}
</div>
</td>
@endif
@stack('total_td_end')
@stack('delete_td_start')
<td colspan="1" class="pb-4 align-middle">
<div>
<button type="button" @click="onDeleteItem(index)" class="btn btn-link btn-delete p-0">
<i class="far fa-trash-alt"></i>
</button>
</div>
</td>
@stack('delete_td_end')
</tr>
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
<tr v-if="!row.add_tax || !row.add_discount">
<td colspan="3" style="border: 0;">
</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="3" style="border: 0;"></td>
<td colspan="2" style="border: 0;">
<div>
@stack('tax_id_input_start')
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text" id="input-discount-rate">
<i class="fa fa-percent"></i>
</span>
</div>
<input type="number"
max="100"
min="0"
class="form-control text-center"
:name="'items.' + index + '.discount-rate'"
autocomplete="off"
required="required"
data-item="discount_rate"
v-model="row.discount_rate"
@input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.discount_rate')">
<div class="invalid-feedback d-block"
v-if="form.errors.has('items.' + index + '.discount_rate')"
v-html="form.errors.get('items.' + index + '.discount_rate')">
</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"
:index="row_tax_index">
@else
<tr v-for="(row_tax, row_tax_index) in row.tax_ids"
:index="row_tax_index">
@endif
<td class="pb-0" colspan="2" style="border: 0;">
</td>
<td class="pb-0 pr-0 align-middle text-right long-texts" colspan="1" style="border: 0;">
<span class="invoice-item-row-tax-section__tax__add__label">{{ trans_choice('general.taxes', 1) }}</span>
</td>
<td class="pb-0" colspan="2" style="border: 0; padding-right: 5px; padding-left: 5px;" >
<div>
@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 class="pb-0" colspan="2" style="border: 0;">
</td>
<td class="pb-0 pr-0 align-middle text-right long-texts" colspan="1" style="border: 0;">
<span class="invoice-item-row-tax-section__tax__add__label">{{ trans_choice('general.taxes', 1) }}</span>
</td>
<td colspan="2" style="border: 0; padding-right: 5px; padding-left: 5px;">
<div>
@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>
@stack('name_td_end')
</tr>

View File

@ -0,0 +1,33 @@
<div class="card">
<div class="card-body">
<x-documents.form.metadata
type="{{ $type }}"
:document="$document"
hide-contact="{{ $hideContact }}"
contact-type="{{ $contactType }}"
hide-issue-at="{{ $hideIssuedAt }}"
text-issue-at="{{ $textIssuedAt }}"
hide-document-number="{{ $hideDocumentNumber }}"
text-document-number="{{ $textDocumentNumber }}"
hide-due-at="{{ $hideDueAt }}"
text-due-at="{{ $textDueAt }}"
hide-order-number="{{ $hideOrderNumber }}"
text-order-number="{{ $textOrderNumber }}"
/>
<x-documents.form.items
type="{{ $type }}"
:document="$document"
/>
<x-documents.form.totals
type="{{ $type }}"
:document="$document"
/>
<x-documents.form.note
type="{{ $type }}"
:document="$document"
/>
</div>
</div>

View File

@ -0,0 +1,29 @@
<div class="row">
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
@if (!$hideContact)
<div class="row">
<x-select-contact-card type="{{ $contactType }}" :contact="($document) ? $document->contact : new stdClass()"/>
</div>
@endif
</div>
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
<div class="row">
@if (!$hideIssuedAt)
{{ Form::dateGroup('issued_at', $textIssuedAt, 'calendar', ['id' => 'issued_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], $issuedAt) }}
@endif
@if (!$hideDocumentNumber)
{{ Form::textGroup('document_number', $textDocumentNumber, 'file', ['required' => 'required'], $documentNumber) }}
@endif
@if (!$hideDueAt)
{{ Form::dateGroup('due_at', $textDueAt, 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], $dueAt) }}
@endif
@if (!$hideOrderNumber)
{{ Form::textGroup('order_number', $textOrderNumber, 'shopping-cart', [], $orderNumber) }}
@endif
</div>
</div>
</div>

View File

@ -0,0 +1,3 @@
<div class="row embed-card-body-footer">
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2), '', setting($type . '.notes'), ['rows' => '3', 'class' => 'form-control embed-card-body-footer-textarea'], 'col-md-12 embed-acoordion-textarea') }}
</div>

View File

@ -0,0 +1,135 @@
<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">
<colgroup>
<col style="width: 60%;">
<col style="width: 30%;">
<col style="width: 20%;">
<col style="width: 40px;">
</colgroup>
<tbody id="invoice-item-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">
<strong>{{ trans('invoices.sub_total') }}</strong>
</td>
<td class="text-right border-bottom-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('sub_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-bottom-0 pb-0"></td>
</tr>
@stack('sub_total_td_end')
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
@stack('item_discount_td_start')
<tr id="tr-subtotal">
<td class="border-top-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pb-0">
<strong>{{ trans('invoices.item_discount') }}</strong>
</td>
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-top-0 pb-0"></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 pb-0"></td>
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pb-0">
<el-popover
popper-class="p-0 h-0"
placement="bottom"
width="300"
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="input-group-prepend">
<span class="input-group-text" id="input-discount">
<i class="fa fa-percent"></i>
</span>
</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="discount-description">
<strong>{{ trans('invoices.discount_desc') }}</strong>
</div>
</div>
</div>
</div>
<div class="discount card-footer">
<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' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
</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 pb-0">
<div>
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
</div>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
</td>
<td class="border-top-0 pb-0"></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 pb-0"></td>
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pb-0">
<strong v-html="tax.name"></strong>
</td>
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('tax_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'tax.total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-top-0 pb-0"></td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr id="tr-total">
<td class="border-top-0 pb-0"></td>
<td class="text-right border-top-0 border-right-0 align-middle pb-0">
<strong class="document-total-span">{{ trans('invoices.total') }}</strong>
{{ Form::selectGroup('currency_code', '', 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => 'form.currency_code', 'change' => 'onChangeCurrency'], 'document-total-currency') }}
</td>
<td class="text-right border-top-0 long-texts pb-0">
<div>
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00, 'text-right disabled-money') }}
</div>
</td>
<td class="border-top-0"></td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
</div>
</div>
</div>