Add subcontract jobs section to work order PDF

Loads subcontractJobs.subcontractor relation and renders a new table
in the PDF after parts: description, subcontractor, category, client price.
Adds ru/en translations for the new section labels.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-06 12:24:59 +00:00
parent 4c7cacc765
commit 2caac4ae8e
4 changed files with 38 additions and 4 deletions
+30
View File
@@ -252,6 +252,36 @@
</table>
@endif
@if ($wo->subcontractJobs->isNotEmpty())
<h3 style="font-size: 12px; margin: 12px 0 4px; text-transform: uppercase; color: {{ $themeColor }};">{{ __('Lucrări terțe') }}</h3>
<table class="items">
<thead>
<tr>
<th style="width: 40%;">{{ __('Denumire') }}</th>
<th style="width: 20%;">{{ __('Terț') }}</th>
<th style="width: 15%;">{{ __('Categorie') }}</th>
<th class="r" style="width: 25%;">{{ __('Preț client') }}</th>
</tr>
</thead>
<tbody>
@foreach ($wo->subcontractJobs as $sj)
<tr>
<td>{{ $sj->description ?? '—' }}</td>
<td>{{ $sj->subcontractor?->name ?? '—' }}</td>
<td>{{ $sj->category ? __($sj->category) : '—' }}</td>
<td class="r"><b>{{ number_format((float) $sj->client_price, 2, '.', ' ') }}</b></td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="3" class="r">{{ __('Subtotal terțe:') }}</td>
<td class="r">{{ number_format((float) $wo->subcontractJobs->sum('client_price'), 2, '.', ' ') }} {{ $currency }}</td>
</tr>
</tfoot>
</table>
@endif
<div class="total-box">
@if ($wo->discount_pct > 0)
<div class="total-line">{{ __('Subtotal:') }} {{ number_format((float) ($worksTotal + $partsTotal), 2, '.', ' ') }} {{ $currency }}</div>