Fixed hideItems option fixed PDF download method.

This commit is contained in:
Cüneyt Şentürk 2021-08-01 20:03:09 +03:00
parent 5aac80bf2b
commit 50f2e7d991
3 changed files with 196 additions and 190 deletions

View File

@ -175,74 +175,76 @@
</div> </div>
</div> </div>
<div class="row"> @if (!$hideItems)
<div class="col-100"> <div class="row">
<div class="text"> <div class="col-100">
<table class="c-lines"> <div class="text">
<thead> <table class="c-lines">
<tr> <thead>
@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
<tr> <tr>
<td colspan="5" class="text-center empty-items"> @stack('name_th_start')
{{ trans('documents.empty_items') }} @if (!$hideItems || (!$hideName && !$hideDescription))
</td> <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> </tr>
@endif </thead>
</tbody>
</table> <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> </div>
</div> @endif
<div class="row mt-4 clearfix"> <div class="row mt-4 clearfix">
<div class="col-58"> <div class="col-58">

View File

@ -160,73 +160,75 @@
</div> </div>
</div> </div>
<div class="row"> @if (!$hideItems)
<div class="col-100"> <div class="row">
<div class="text"> <div class="col-100">
<table class="lines"> <div class="text">
<thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;"> <table class="lines">
<tr> <thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;">
@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
<tr> <tr>
<td colspan="5" class="text-center empty-items"> @stack('name_th_start')
{{ trans('documents.empty_items') }} @if (!$hideItems || (!$hideName && !$hideDescription))
</td> <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> </tr>
@endif </thead>
</tbody> <tbody>
</table> @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> </div>
</div> @endif
<div class="row mt-9 clearfix"> <div class="row mt-9 clearfix">
<div class="col-58"> <div class="col-58">

View File

@ -150,73 +150,75 @@
</div> </div>
</div> </div>
<div class="row"> @if (!$hideItems)
<div class="col-100"> <div class="row">
<div class="text"> <div class="col-100">
<table class="m-lines"> <div class="text">
<thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;"> <table class="m-lines">
<tr> <thead style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;">
@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
<tr> <tr>
<td colspan="5" class="text-center empty-items"> @stack('name_th_start')
{{ trans('documents.empty_items') }} @if (!$hideItems || (!$hideName && !$hideDescription))
</td> <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> </tr>
@endif </thead>
</tbody> <tbody>
</table> @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> </div>
</div> @endif
<div class="row mt-7"> <div class="row mt-7">
<div class="col-58"> <div class="col-58">