Files
nala 63d20b10fc
tests / ci (push) Canceled after 0s
commit de armazens
2026-11-04 09:40:26 +02:00

60 lines
3.7 KiB
PHP

<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ $receipt->number }} · SGC</title>
<style>
@page { size: A4; margin: 17mm; }
* { box-sizing: border-box; }
body { font: 12px/1.5 Arial, sans-serif; color: #111; max-width: 950px; margin: 24px auto; }
h1 { font-size: 24px; } h2 { font-size: 16px; margin-top: 24px; }
table { width: 100%; border-collapse: collapse; margin: 16px 0; }
th, td { border: 1px solid #ccc; padding: 7px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
thead { display: table-header-group; } tr { break-inside: avoid; }
.notice { border: 1px solid #aaa; padding: 12px; } .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.fingerprint { font: 10px monospace; overflow-wrap: anywhere; } button { padding: 10px; }
@media print { .no-print { display: none; } body { margin: 0; max-width: none; } }
</style>
</head>
<body>
@php($quantity = fn ($milli) => number_format($milli / 1000, 3, ',', '.'))
@php($quality = ['compliant' => 'Conforme', 'reservations' => 'Conforme com reservas', 'nonconforming' => 'Não conforme'])
@php($types = ['delivery_note' => 'Guia de remessa', 'quality' => 'Qualidade', 'other' => 'Outro'])
<button type="button" class="no-print" onclick="window.print()">Imprimir ou guardar como PDF</button>
<h1>Recepção {{ $receipt->number }}</h1>
<p>Ordem {{ $receipt->snapshot['order']['number'] }} · Fornecedor: {{ $receipt->snapshot['supplier']['name'] }}</p>
@if($receipt->snapshot['development_only'] ?? false)
<p class="notice">Documento de desenvolvimento. Não autoriza compras reais.</p>
@endif
<p>Guia de remessa: {{ $receipt->delivery_note }}<br>
Recebido em: {{ $receipt->received_on->format('Y-m-d') }} · Por: {{ $receipt->snapshot['receiver']['name'] }}<br>
Armazém: {{ $receipt->snapshot['warehouse']['name'] ?? 'Sem entrada física' }}</p>
<h2>Confirmação original de quantidade e qualidade</h2>
<p>Esta reprodução conserva a confirmação original. Os estornos identificados abaixo devem ser considerados na leitura das quantidades; a situação efectiva consta da ordem.</p>
<table>
<thead><tr><th>Artigo / unidade</th><th>Recebido</th><th>Aceite</th><th>Rejeitado</th><th>Qualidade / observações</th></tr></thead>
<tbody>
@foreach($receipt->items as $item)
<tr>
<td>{{ $item->snapshot['order_item']['description'] }} · {{ $item->snapshot['order_item']['unit'] }}
@if($item->snapshot['stock_item'] ?? null)<br>{{ $item->snapshot['stock_item']['code'] }}@endif
@if(isset($corrections[$item->id]))<p><strong>Estornado integralmente: {{ $corrections[$item->id]->data['reference'] }}</strong></p>@endif
</td>
<td>{{ $quantity($item->received_milli) }}</td><td>{{ $quantity($item->accepted_milli) }}</td><td>{{ $quantity($item->rejected_milli) }}</td>
<td>{{ $quality[$item->quality_status] ?? $item->quality_status }}<p class="pre">{{ $item->notes }}</p></td>
</tr>
@endforeach
</tbody>
</table>
<h2>Referências documentais</h2>
<p>Os anexos permanecem no SGC e não são incorporados nesta impressão. A lista corresponde à consulta actual.</p>
@forelse($documents as $document)
<p>{{ $types[$document->document_type] ?? $document->document_type }} · {{ $document->original_name }}<br>
<span class="fingerprint">SHA-256: {{ $document->sha256 }}</span></p>
@empty
<p>Sem referências documentais disponíveis para esta consulta.</p>
@endforelse
</body>
</html>