diff --git a/app/Abstracts/View/Components/DocumentShow.php b/app/Abstracts/View/Components/DocumentShow.php index 27da0512c..c0d6ec6b7 100644 --- a/app/Abstracts/View/Components/DocumentShow.php +++ b/app/Abstracts/View/Components/DocumentShow.php @@ -557,7 +557,7 @@ abstract class DocumentShow extends Base return $template; } - $documentTemplate = setting($type . '.template', 'default'); + $documentTemplate = setting($type . '.template') !== null ?: 'default'; return $documentTemplate; } @@ -635,7 +635,7 @@ abstract class DocumentShow extends Base { if (!empty($textHistoryStatus)) { return $textHistoryStatus; - } + } $translation = $this->getTextFromConfig($type, 'document_status', 'statuses.'); diff --git a/resources/views/components/documents/form/items.blade.php b/resources/views/components/documents/form/items.blade.php index 584f6a5be..b6abe7a3d 100644 --- a/resources/views/components/documents/form/items.blade.php +++ b/resources/views/components/documents/form/items.blade.php @@ -36,27 +36,27 @@ @endif @stack('quantity_th_start') - @if (!$hideQuantity) - + + @if (!$hideQuantity) {{ trans($textQuantity) }} - - @endif + @endif + @stack('quantity_th_end') @stack('price_th_start') - @if (!$hidePrice) - + + @if (!$hidePrice) {{ trans($textPrice) }} - - @endif + @endif + @stack('price_th_end') @stack('total_th_start') - @if (!$hideAmount) - + + @if (!$hideAmount) {{ trans($textAmount) }} - - @endif + @endif + @stack('total_th_end') @stack('remove_th_start') diff --git a/resources/views/components/documents/form/line-item.blade.php b/resources/views/components/documents/form/line-item.blade.php index 9bf4830cb..7c5802ddb 100644 --- a/resources/views/components/documents/form/line-item.blade.php +++ b/resources/views/components/documents/form/line-item.blade.php @@ -27,8 +27,8 @@ @stack('items_td_start') @if (!$hideItems || (!$hideName && !$hideDescription)) @stack('name_td_start') - @if (!$hideName) - + + @if (!$hideName)
@stack('name_input_start') @@ -48,13 +48,13 @@
@stack('name_input_end') - - @endif + @endif + @stack('name_td_end') @stack('description_td_start') - @if (!$hideDescription) - + + @if (!$hideDescription) - - @endif + @endif + @stack('description_td_end') @endif @stack('items_td_end') @stack('quantity_td_start') - @if (!$hideQuantity) -
- @stack('quantity_input_start') - + @if (!$hideQuantity) +
+ @stack('quantity_input_start') + -
+
+
+ @stack('quantity_input_end')
- @stack('quantity_input_end') -
+ @endif - @endif @stack('quantity_td_end') @stack('price_td_start') - @if (!$hidePrice) - + + @if (!$hidePrice)
@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')
- - @endif + @endif + @stack('price_td_end') @stack('total_td_start') - @if (!$hideAmount) - + + @if (!$hideAmount)
{{ 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') }}
- - @endif + @endif + @stack('total_td_end') @stack('delete_td_start') diff --git a/resources/views/components/documents/template/classic.blade.php b/resources/views/components/documents/template/classic.blade.php index 5b32ebdc4..0035bb213 100644 --- a/resources/views/components/documents/template/classic.blade.php +++ b/resources/views/components/documents/template/classic.blade.php @@ -173,13 +173,13 @@ @stack('quantity_th_start') @if (!$hideQuantity) - {{ $textQuantity }} + {{ trans($textQuantity) }} @endif @stack('quantity_th_end') @stack('price_th_start') @if (!$hidePrice) - {{ $textPrice }} + {{ trans($textPrice) }} @endif @stack('price_th_end') diff --git a/resources/views/components/documents/template/default.blade.php b/resources/views/components/documents/template/default.blade.php index 0d23131e3..146eac8cf 100644 --- a/resources/views/components/documents/template/default.blade.php +++ b/resources/views/components/documents/template/default.blade.php @@ -148,12 +148,10 @@
- @foreach($document as $item) - - @endforeach + @stack('name_th_start') - @if ($hideItems || (!$hideName && !$hideDescription)) + @if (!$hideItems || (!$hideName && !$hideDescription)) @endif @stack('name_th_end')
{{ (trans_choice($textItems, 2) != $textItems) ? trans_choice($textItems, 2) : trans($textItems) }}