Merge branch 'akaunting:master' into invoice-form-enhancements

This commit is contained in:
bengü thon mai mochi
2021-08-25 11:15:51 +03:00
committed by GitHub
148 changed files with 2103 additions and 1033 deletions

View File

@ -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') }}'"

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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

View File

@ -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">

View File

@ -7,7 +7,9 @@
<strong>
<span class="float-left long-texts mwpx-200 transaction-head-text">
{{ $transaction->account->name }}
<a href="{{ route('accounts.show', $transaction->account->id) }}">
{{ $transaction->account->name }}
</a>
</span>
</strong>
<br><br>

View File

@ -8,6 +8,7 @@
<div class="dropdown-menu" role="menu">
@stack('button_dropdown_start')
@stack('edit_button_start')
@if (!$transaction->hasTransferRelation)
@if (!$hideButtonEdit)
@can($permissionUpdate)
<a class="dropdown-item" href="{{ route($routeButtonEdit, $transaction->id) }}">
@ -15,9 +16,11 @@
</a>
@endcan
@endif
@endif
@stack('edit_button_end')
@stack('duplicate_button_start')
@if (!$transaction->hasTransferRelation)
@if (!$hideButtonDuplicate)
@can($permissionCreate)
<a class="dropdown-item" href="{{ route($routeButtonDuplicate, $transaction->id) }}">
@ -25,12 +28,15 @@
</a>
@endcan
@endif
@endif
@stack('duplicate_button_end')
@stack('button_dropdown_divider_1_start')
@if (!$transaction->hasTransferRelation)
@if (!$hideButtonGroupDivider1)
<div class="dropdown-divider"></div>
@endif
@endif
@stack('button_dropdown_divider_1_end')
@if (!$hideButtonPrint)
@ -42,14 +48,17 @@
@endif
@stack('share_button_start')
@if (!$transaction->hasTransferRelation)
@if (!$hideButtonShare)
<a class="dropdown-item" href="{{ $signedUrl }}" target="_blank">
{{ trans('general.share') }}
</a>
@endif
@endif
@stack('share_button_end')
@stack('edit_button_start')
@if (!$transaction->hasTransferRelation)
@if (!$hideButtonEmail)
@if($transaction->contact->email)
<a class="dropdown-item" href="{{ route($routeButtonEmail, $transaction->id) }}">
@ -63,6 +72,7 @@
</el-tooltip>
@endif
@endif
@endif
@stack('edit_button_end')
@stack('button_pdf_start')
@ -74,12 +84,15 @@
@stack('button_pdf_end')
@stack('button_dropdown_divider_3_start')
@if (!$transaction->hasTransferRelation)
@if (!$hideButtonGroupDivider3)
<div class="dropdown-divider"></div>
@endif
@endif
@stack('button_dropdown_divider_3_end')
@stack('delete_button_start')
@if (!$transaction->hasTransferRelation)
@if (!$hideButtonDelete)
@can($permissionDelete)
@if ($checkButtonReconciled)
@ -91,6 +104,7 @@
@endif
@endcan
@endif
@endif
@stack('delete_button_end')
@stack('button_dropdown_end')
</div>

View File

@ -8,6 +8,8 @@
hide-header-to-account="{{ $hideHeaderToAccount }}"
text-header-to-account="{{ $textHeaderToAccount }}"
class-header-to-account="{{ $classHeaderToAccount }}"
route-from-account-show="{{ $routeFromAccountShow }}"
route-to-account-show="{{ $routeToAccountShow }}"
hide-header-amount="{{ $hideHeaderAmount }}"
text-header-amount="{{ $textHeaderAmount }}"
class-header-amount="{{ $classHeaderAmount }}"

View File

@ -7,7 +7,9 @@
<strong>
<span class="float-left long-texts mwpx-200 transaction-head-text">
{{ $transfer->expense_transaction->account->name }}
<a href="{{ route($routeFromAccountShow, $transfer->expense_transaction->account->id) }}">
{{ $transfer->expense_transaction->account->name }}
</a>
</span>
</strong>
<br><br>
@ -23,7 +25,9 @@
<strong>
<span class="float-left long-texts mwpx-300 transaction-head-text">
{{ $transfer->income_transaction->account->name }}
<a href="{{ route($routeToAccountShow, $transfer->income_transaction->account->id) }}">
{{ $transfer->income_transaction->account->name }}
</a>
</span>
</strong>
<br><br>