84 lines
3.2 KiB
PHP
84 lines
3.2 KiB
PHP
<!doctype html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Etichetta Documento</title>
|
|
<style>
|
|
@page { margin: 0; }
|
|
body { margin: 0; font-family: Arial, Helvetica, sans-serif; }
|
|
|
|
/*
|
|
* Formati supportati:
|
|
* - 11354: 57x32mm (LabelWriter)
|
|
* - 99014: 54x101mm (faldoni)
|
|
*/
|
|
.label {
|
|
box-sizing: border-box;
|
|
padding: 2.5mm;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
overflow: hidden;
|
|
}
|
|
.label.format-11354 { width: 57mm; height: 32mm; }
|
|
.label.format-99014 { width: 101mm; height: 54mm; padding: 4mm; }
|
|
|
|
.row { display: flex; justify-content: space-between; gap: 8px; }
|
|
.title { font-size: 12px; font-weight: 700; line-height: 1.1; }
|
|
.meta { font-size: 9px; color: #333; line-height: 1.15; }
|
|
.code { font-size: 10px; font-weight: 700; letter-spacing: .4px; }
|
|
.small { font-size: 8px; color: #444; }
|
|
.divider { border-top: 1px solid #000; margin: 1.5mm 0; }
|
|
|
|
.format-99014 .title { font-size: 18px; }
|
|
.format-99014 .meta { font-size: 12px; }
|
|
.format-99014 .code { font-size: 14px; }
|
|
.format-99014 .small { font-size: 10px; }
|
|
|
|
@media print { .no-print { display: none; } }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
@php($fmt = in_array(($format ?? '11354'), ['11354','99014'], true) ? $format : '11354')
|
|
<div class="label format-{{ $fmt }}">
|
|
<div>
|
|
<div class="row">
|
|
<div class="title">{{ $codiceUnico ?? $documento->numero_protocollo }}</div>
|
|
<div class="meta" style="text-align:right;">
|
|
<div>{{ strtoupper((string) $documento->tipo_documento) }}</div>
|
|
<div>{{ ($anno ?? ($documento->data_sottoscrizione?->format('Y'))) ?: now()->format('Y') }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="meta" style="margin-top: 1mm;">
|
|
<div><strong>Protocollo:</strong> {{ $documento->protocollo_formattato }}</div>
|
|
<div><strong>Stabile:</strong> {{ optional($documento->stabile)->denominazione ?: ('ID ' . (int) $documento->stabile_id) }}</div>
|
|
@if(!empty($faldone))
|
|
<div><strong>Faldone:</strong> {{ $faldone }}</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
<div class="row">
|
|
<div class="code">DOC-{{ (int) $documento->id }}</div>
|
|
@if($documento->data_scadenza)
|
|
<div class="small" style="text-align:right;">
|
|
<div><strong>Scad.:</strong> {{ \Carbon\Carbon::parse($documento->data_scadenza)->format('d-m-Y') }}</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
<div class="small">
|
|
Apri documento: {{ $openUrl ?? '' }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="no-print" style="padding-top: 6px;">
|
|
<button onclick="window.print()">Stampa</button>
|
|
<button onclick="window.close()">Chiudi</button>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|