Line item sections in PDF template, fixes #41

This commit is contained in:
2025-11-19 11:42:54 +01:00
parent d1656b56a0
commit 7bea820649
2 changed files with 25 additions and 12 deletions
+23 -11
View File
@@ -148,18 +148,30 @@
<tbody>
@foreach ($invoice['items'] as $item)
<tr>
<td>{{ $item['position'] }}</td>
<td>
<strong>{{ $item['title'] }}</strong><br>
{{ $item['description'] }}
</td>
<td>@toCommaFloat($item['quantity'])</td>
<td>{{ $item['unit'] }}</td>
<td>@toCurrency($item['price'])</td>
<td>@toCurrency($item['quantity'] * $item['price'])</td>
</tr>
@if($item['isSection'])
<tr class="section-title">
<td colspan="6">
<h3>{{ $item['title'] }}</h3>
@if($item['description'])
<p>{{ $item['description'] }}</p>
@endif
</td>
</tr>
@else
<tr class="line-item">
<td>{{ $item['position'] }}</td>
<td>
<strong>{{ $item['title'] }}</strong><br>
{{ $item['description'] }}
</td>
<td>@toCommaFloat($item['quantity'])</td>
<td>{{ $item['unit'] }}</td>
<td>@toCurrency($item['price'])</td>
<td>@toCurrency($item['quantity'] * $item['price'])</td>
</tr>
@endif
@endforeach
</tbody>
<tfoot>
<tr>