From 8e4bccf828e4378299b8f8f6b1946d1fd700ec6c Mon Sep 17 00:00:00 2001 From: Daniel Stock Date: Wed, 19 Nov 2025 11:42:54 +0100 Subject: [PATCH] Line item sections in PDF template, fixes #41 --- .../js/components/documents/LineItemTable.vue | 3 +- resources/views/invoice.blade.php | 34 +++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/resources/js/components/documents/LineItemTable.vue b/resources/js/components/documents/LineItemTable.vue index add4adb..eb15616 100644 --- a/resources/js/components/documents/LineItemTable.vue +++ b/resources/js/components/documents/LineItemTable.vue @@ -114,7 +114,7 @@ const recalculatePositions = () => { - + @@ -132,6 +132,7 @@ const recalculatePositions = () => { + diff --git a/resources/views/invoice.blade.php b/resources/views/invoice.blade.php index 562567c..7ddd545 100644 --- a/resources/views/invoice.blade.php +++ b/resources/views/invoice.blade.php @@ -148,18 +148,30 @@ @foreach ($invoice['items'] as $item) - - {{ $item['position'] }} - - {{ $item['title'] }}
- {{ $item['description'] }} - - @toCommaFloat($item['quantity']) - {{ $item['unit'] }} - @toCurrency($item['price']) - @toCurrency($item['quantity'] * $item['price']) - + @if($item['isSection']) + + +

{{ $item['title'] }}

+ @if($item['description']) +

{{ $item['description'] }}

+ @endif + + + @else + + {{ $item['position'] }} + + {{ $item['title'] }}
+ {{ $item['description'] }} + + @toCommaFloat($item['quantity']) + {{ $item['unit'] }} + @toCurrency($item['price']) + @toCurrency($item['quantity'] * $item['price']) + + @endif @endforeach +