Fix document item columns

This commit is contained in:
Burak Çakırel 2021-01-12 13:23:54 +03:00
parent 35d24daad6
commit a763280da6
No known key found for this signature in database
GPG Key ID: 48FFBB7771B99C7C
5 changed files with 52 additions and 54 deletions

View File

@ -557,7 +557,7 @@ abstract class DocumentShow extends Base
return $template; return $template;
} }
$documentTemplate = setting($type . '.template', 'default'); $documentTemplate = setting($type . '.template') !== null ?: 'default';
return $documentTemplate; return $documentTemplate;
} }
@ -635,7 +635,7 @@ abstract class DocumentShow extends Base
{ {
if (!empty($textHistoryStatus)) { if (!empty($textHistoryStatus)) {
return $textHistoryStatus; return $textHistoryStatus;
} }
$translation = $this->getTextFromConfig($type, 'document_status', 'statuses.'); $translation = $this->getTextFromConfig($type, 'document_status', 'statuses.');

View File

@ -36,27 +36,27 @@
@endif @endif
@stack('quantity_th_start') @stack('quantity_th_start')
@if (!$hideQuantity) <th class="text-center pl-2 border-top-0 border-right-0 border-bottom-0">
<th class="text-center pl-2 border-top-0 border-right-0 border-bottom-0"> @if (!$hideQuantity)
{{ trans($textQuantity) }} {{ trans($textQuantity) }}
</th> @endif
@endif </th>
@stack('quantity_th_end') @stack('quantity_th_end')
@stack('price_th_start') @stack('price_th_start')
@if (!$hidePrice) <th class="text-right border-top-0 border-right-0 border-bottom-0 pr-1" style="padding-left: 5px;">
<th class="text-right border-top-0 border-right-0 border-bottom-0 pr-1" style="padding-left: 5px;"> @if (!$hidePrice)
{{ trans($textPrice) }} {{ trans($textPrice) }}
</th> @endif
@endif </th>
@stack('price_th_end') @stack('price_th_end')
@stack('total_th_start') @stack('total_th_start')
@if (!$hideAmount) <th class="text-right border-top-0 border-bottom-0 item-total">
<th class="text-right border-top-0 border-bottom-0 item-total"> @if (!$hideAmount)
{{ trans($textAmount) }} {{ trans($textAmount) }}
</th> @endif
@endif </th>
@stack('total_th_end') @stack('total_th_end')
@stack('remove_th_start') @stack('remove_th_start')

View File

@ -27,8 +27,8 @@
@stack('items_td_start') @stack('items_td_start')
@if (!$hideItems || (!$hideName && !$hideDescription)) @if (!$hideItems || (!$hideName && !$hideDescription))
@stack('name_td_start') @stack('name_td_start')
@if (!$hideName) <td class="pb-3 align-middle border-bottom-0">
<td class="pb-3 align-middle border-bottom-0"> @if (!$hideName)
<span class="aka-text aka-text--body" tabindex="0" v-html="row.name" v-if="row.item_id"></span> <span class="aka-text aka-text--body" tabindex="0" v-html="row.name" v-if="row.item_id"></span>
<div v-else> <div v-else>
@stack('name_input_start') @stack('name_input_start')
@ -48,13 +48,13 @@
</div> </div>
@stack('name_input_end') @stack('name_input_end')
</div> </div>
</td> @endif
@endif </td>
@stack('name_td_end') @stack('name_td_end')
@stack('description_td_start') @stack('description_td_start')
@if (!$hideDescription) <td class="pb-3 border-bottom-0">
<td class="pb-3 border-bottom-0"> @if (!$hideDescription)
<textarea <textarea
class="form-control" class="form-control"
placeholder="Enter item description" placeholder="Enter item description"
@ -65,57 +65,57 @@
resize="none" resize="none"
@input="onBindingItemField(index, 'description')" @input="onBindingItemField(index, 'description')"
></textarea> ></textarea>
</td> @endif
@endif </td>
@stack('description_td_end') @stack('description_td_end')
@endif @endif
@stack('items_td_end') @stack('items_td_end')
@stack('quantity_td_start') @stack('quantity_td_start')
@if (!$hideQuantity)
<td class="pb-3 pl-0 pr-2 border-bottom-0"> <td class="pb-3 pl-0 pr-2 border-bottom-0">
<div> @if (!$hideQuantity)
@stack('quantity_input_start') <div>
<input type="text" @stack('quantity_input_start')
class="form-control text-center p-0" <input type="text"
:name="'items.' + index + '.quantity'" class="form-control text-center p-0"
autocomplete="off" :name="'items.' + index + '.quantity'"
required="required" autocomplete="off"
data-item="quantity" required="required"
v-model="row.quantity" data-item="quantity"
@input="onCalculateTotal" v-model="row.quantity"
@change="form.errors.clear('items.' + index + '.quantity')"> @input="onCalculateTotal"
@change="form.errors.clear('items.' + index + '.quantity')">
<div class="invalid-feedback d-block" <div class="invalid-feedback d-block"
v-if="form.errors.has('items.' + index + '.quantity')" v-if="form.errors.has('items.' + index + '.quantity')"
v-html="form.errors.get('items.' + index + '.quantity')"> v-html="form.errors.get('items.' + index + '.quantity')">
</div>
@stack('quantity_input_end')
</div> </div>
@stack('quantity_input_end') @endif
</div>
</td> </td>
@endif
@stack('quantity_td_end') @stack('quantity_td_end')
@stack('price_td_start') @stack('price_td_start')
@if (!$hidePrice) <td class="pb-3 pl-0 pr-0 border-bottom-0" style="padding-right: 5px; padding-left: 5px;">
<td class="pb-3 pl-0 pr-0 border-bottom-0" style="padding-right: 5px; padding-left: 5px;"> @if (!$hidePrice)
<div> <div>
@stack('price_input_start') @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') }} {{ 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') @stack('price_input_end')
</div> </div>
</td> @endif
@endif </td>
@stack('price_td_end') @stack('price_td_end')
@stack('total_td_start') @stack('total_td_start')
@if (!$hideAmount) <td class="text-right long-texts pb-3 border-bottom-0">
<td class="text-right long-texts pb-3 border-bottom-0"> @if (!$hideAmount)
<div> <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') }} {{ 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> </div>
</td> @endif
@endif </td>
@stack('total_td_end') @stack('total_td_end')
@stack('delete_td_start') @stack('delete_td_start')

View File

@ -173,13 +173,13 @@
@stack('quantity_th_start') @stack('quantity_th_start')
@if (!$hideQuantity) @if (!$hideQuantity)
<th class="quantity">{{ $textQuantity }}</th> <th class="quantity">{{ trans($textQuantity) }}</th>
@endif @endif
@stack('quantity_th_end') @stack('quantity_th_end')
@stack('price_th_start') @stack('price_th_start')
@if (!$hidePrice) @if (!$hidePrice)
<th class="price">{{ $textPrice }}</th> <th class="price">{{ trans($textPrice) }}</th>
@endif @endif
@stack('price_th_end') @stack('price_th_end')

View File

@ -148,12 +148,10 @@
<div class="col-100"> <div class="col-100">
<div class="text"> <div class="text">
<table class="lines"> <table class="lines">
@foreach($document as $item) <thead style="background-color:{{ $backGroundColor }} !important; -webkit-print-color-adjust: exact;">
<thead style="background-color:{{ $backGroundColor }} !important; -webkit-print-color-adjust: exact;">
@endforeach
<tr> <tr>
@stack('name_th_start') @stack('name_th_start')
@if ($hideItems || (!$hideName && !$hideDescription)) @if (!$hideItems || (!$hideName && !$hideDescription))
<th class="item text-left text-white">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th> <th class="item text-left text-white">{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}</th>
@endif @endif
@stack('name_th_end') @stack('name_th_end')