200 lines
8.3 KiB
PHP
200 lines
8.3 KiB
PHP
<x-filament-panels::page>
|
|
@php
|
|
$p = $preventivo;
|
|
$s = $p->stabile;
|
|
$a = $amministratore;
|
|
|
|
$fmtMoney = fn ($value) => '€ ' . number_format((float) $value, 2, ',', '.');
|
|
|
|
$logo1 = (string) data_get($a?->impostazioni, 'documento.logo_1', '');
|
|
$logo2 = (string) data_get($a?->impostazioni, 'documento.logo_2', '');
|
|
$cappello = trim((string) data_get($a?->impostazioni, 'documento.cappello', ''));
|
|
$datiFiscali = trim((string) data_get($a?->impostazioni, 'documento.dati_fiscali', ''));
|
|
$piede = trim((string) data_get($a?->impostazioni, 'documento.piede', ''));
|
|
$firma = trim((string) data_get($a?->impostazioni, 'documento.firma', ''));
|
|
|
|
$dataLettera = optional($p->data_creazione)->format('d/m/Y') ?: now()->format('d/m/Y');
|
|
$oggetto = 'Preventivo gestione ' . strtoupper((string) $p->tipo_gestione) . ' - anno ' . (string) $p->anno_gestione;
|
|
@endphp
|
|
|
|
<div class="space-y-6 document-root">
|
|
<div class="flex items-start justify-between gap-6 document-header">
|
|
<div class="flex items-start gap-4">
|
|
@if($logo1 !== '')
|
|
<img src="{{ \Illuminate\Support\Facades\Storage::disk('public')->url($logo1) }}" alt="Logo" class="h-14 w-auto" />
|
|
@endif
|
|
@if($logo2 !== '')
|
|
<img src="{{ \Illuminate\Support\Facades\Storage::disk('public')->url($logo2) }}" alt="Logo" class="h-14 w-auto" />
|
|
@endif
|
|
</div>
|
|
|
|
<div class="text-sm text-right">
|
|
<div>{{ $dataLettera }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="text-sm leading-6">
|
|
@if($cappello !== '')
|
|
<div class="whitespace-pre-line font-medium">{{ $cappello }}</div>
|
|
@else
|
|
<div class="font-medium">{{ $a?->denominazione_studio ?? 'Studio' }}</div>
|
|
<div>
|
|
{{ trim(($a?->indirizzo_studio ?? '') . ' ' . ($a?->cap_studio ?? '') . ' ' . ($a?->citta_studio ?? '') . ' ' . ($a?->provincia_studio ?? '')) }}
|
|
</div>
|
|
<div>
|
|
@if($a?->telefono_studio) Tel. {{ $a->telefono_studio }} @endif
|
|
@if($a?->email_studio) · {{ $a->email_studio }} @endif
|
|
@if($a?->pec_studio) · PEC {{ $a->pec_studio }} @endif
|
|
</div>
|
|
<div>
|
|
@if($a?->partita_iva) P.IVA {{ $a->partita_iva }} @endif
|
|
@if($a?->codice_fiscale_studio) · CF {{ $a->codice_fiscale_studio }} @endif
|
|
</div>
|
|
@endif
|
|
|
|
@if($datiFiscali !== '')
|
|
<div class="whitespace-pre-line text-xs text-gray-600 pt-2">{{ $datiFiscali }}</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="text-sm leading-6">
|
|
<div class="font-medium">Spett.le</div>
|
|
<div class="font-medium">Condominio {{ $s?->denominazione }}</div>
|
|
<div>{{ trim(($s?->indirizzo ?? '') . ' ' . ($s?->cap ?? '') . ' ' . ($s?->citta ?? '') . ' ' . ($s?->provincia ?? '')) }}</div>
|
|
</div>
|
|
|
|
<div class="text-sm">
|
|
<div class="font-medium">Oggetto: {{ $oggetto }}</div>
|
|
</div>
|
|
|
|
<div class="text-sm leading-6">
|
|
<p>
|
|
In allegato/di seguito si trasmette il preventivo per la gestione indicata in oggetto.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b">
|
|
<th class="py-2 text-left font-medium">Codice</th>
|
|
<th class="py-2 text-left font-medium">Descrizione</th>
|
|
<th class="py-2 text-left font-medium">Ripartizione</th>
|
|
<th class="py-2 text-right font-medium">Importo</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($p->voci as $voce)
|
|
<tr class="border-b align-top">
|
|
<td class="py-2 pr-3 whitespace-nowrap">{{ $voce->codice }}</td>
|
|
<td class="py-2 pr-3">{{ $voce->descrizione }}</td>
|
|
<td class="py-2 pr-3">
|
|
@if($voce->tabellaMillesimale)
|
|
Tabella: {{ $voce->tabellaMillesimale->nome_tabella ?? $voce->tabellaMillesimale->nome ?? '—' }}
|
|
@else
|
|
—
|
|
@endif
|
|
</td>
|
|
<td class="py-2 text-right whitespace-nowrap">{{ $fmtMoney($voce->importo_preventivato) }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="text-sm">
|
|
<div class="flex items-center justify-end gap-6">
|
|
<div class="text-right space-y-1">
|
|
<div>Totale voci: <span class="font-medium">{{ $fmtMoney($this->subtotaleVoci) }}</span></div>
|
|
|
|
@if($this->totaleCompensi > 0)
|
|
<div class="pt-2">
|
|
<div>Compenso base: <span class="font-medium">{{ $fmtMoney($this->compensoBase) }}</span></div>
|
|
@if($this->cassaPercento > 0)
|
|
<div>Cassa ({{ number_format($this->cassaPercento, 2, ',', '.') }}%): <span class="font-medium">{{ $fmtMoney($this->compensoBase * ($this->cassaPercento/100)) }}</span></div>
|
|
@endif
|
|
@if($this->ivaPercento > 0)
|
|
@php
|
|
$cassa = $this->compensoBase * ($this->cassaPercento/100);
|
|
$imponibile = $this->compensoBase + $cassa;
|
|
$iva = $imponibile * ($this->ivaPercento/100);
|
|
@endphp
|
|
<div>IVA ({{ number_format($this->ivaPercento, 2, ',', '.') }}%): <span class="font-medium">{{ $fmtMoney($iva) }}</span></div>
|
|
@endif
|
|
<div>Totale compensi: <span class="font-medium">{{ $fmtMoney($this->totaleCompensi) }}</span></div>
|
|
</div>
|
|
|
|
<div class="pt-2">Totale complessivo: <span class="font-medium">{{ $fmtMoney($this->totaleComplessivo) }}</span></div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if(!empty($p->note))
|
|
<div class="text-sm leading-6">
|
|
<div class="font-medium">Note</div>
|
|
<div class="whitespace-pre-line">{{ $p->note }}</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="text-sm leading-6 pt-6">
|
|
<div>Cordiali saluti.</div>
|
|
|
|
@if($firma !== '')
|
|
<div class="whitespace-pre-line pt-3">{{ $firma }}</div>
|
|
@else
|
|
<div class="pt-3">{{ $a?->denominazione_studio ?? '' }}</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.document-root {
|
|
padding-bottom: 3.5rem;
|
|
}
|
|
|
|
.document-footer {
|
|
border-top: 1px solid rgb(229 231 235);
|
|
margin-top: 2rem;
|
|
padding-top: .75rem;
|
|
font-size: 11px;
|
|
color: rgb(75 85 99);
|
|
}
|
|
|
|
@media print {
|
|
header,
|
|
nav,
|
|
.fi-header,
|
|
.fi-topbar,
|
|
.fi-sidebar,
|
|
.fi-footer,
|
|
.fi-breadcrumbs {
|
|
display: none !important;
|
|
}
|
|
|
|
main {
|
|
padding: 0 !important;
|
|
}
|
|
|
|
.document-footer {
|
|
position: fixed;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
padding: .5rem 0;
|
|
border-top: 1px solid #e5e7eb;
|
|
background: #fff;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<div class="document-footer">
|
|
<div class="flex items-start justify-between gap-6">
|
|
<div class="whitespace-pre-line">{{ $piede !== '' ? $piede : '' }}</div>
|
|
<div class="text-right">
|
|
{{ $a?->denominazione_studio ?? '' }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-filament-panels::page>
|