@php $azienda = App\Models\Azienda::first(); $logoService = app(App\Services\LogoUploadServices::class); $logoUrl = $azienda ? $logoService->getLogoUrl($azienda) : null; @endphp {{-- Display logo from database/Wasabi instead of env --}} @if($logoUrl) @elseif($azienda && $azienda->logo) {{-- Fallback if URL generation fails --}}
Logo non disponibile
@endif


RICEVUTA DI PAGAMENTO N. {{$receipt->number . "/" . $receipt->year}} del {{date("d/m/Y", strtotime($receipt->created_at))}}


@if($receipt->status == 99)
ANNULLATA


@endif
@if($azienda) @if($azienda->ragione_sociale) {{$azienda->ragione_sociale}} @elseif($azienda->nome_associazione) {{$azienda->nome_associazione}} @endif

Indirizzo: @php $addressParts = array_filter([ $azienda->sede_legale_indirizzo, $azienda->sede_legale_cap, $azienda->sede_legale_comune, $azienda->sede_legale_provincia ? '(' . $azienda->sede_legale_provincia . ')' : null ]); @endphp {{ implode(' ', $addressParts) }}

@if($azienda->codice_fiscale) C.F.: {{$azienda->codice_fiscale}}

@endif @if($azienda->partita_iva) P.IVA: {{$azienda->partita_iva}}

@endif @if($azienda->email) Email: {{$azienda->email}}

@endif @if($azienda->pec) PEC: {{$azienda->pec}}

@endif @else
ATTENZIONE: Configurare i dati aziendali nel sistema


@endif

Intestata a

@if(!$receipt->member->isAdult()) Genitore: {{$receipt->parent}}

@endif @if($receipt->member->last_name != '') Cognome: {{$receipt->member->last_name}}

@endif @if($receipt->member->first_name != '') Nome: {{$receipt->member->first_name}}

@endif @if(@$receipt->member->birth_city->name != '' || @$receipt->member->birth_province->name != '' || @$receipt->member->birth_date != '') Nato/a a: @if(@$receipt->member->birth_city->name != '') {{@$receipt->member->birth_city->name}} @endif @if(@$receipt->member->birth_province->name != '') ({{@$receipt->member->birth_province->name}}) @endif @if(@$receipt->member->birth_date != '') il {{$receipt->member->birth_date ? date("d/m/Y", strtotime($receipt->member->birth_date)) : ""}} @endif

@endif @if($receipt->member->address != '' || @$receipt->member->city->name != '' || @$receipt->member->province->name != '') Residente in: @if($receipt->member->address != '') {{$receipt->member->address}} @endif @if(@$receipt->member->city->name != '') {{@$receipt->member->city->name}} @endif @if(@$receipt->member->province->name != '') ({{@$receipt->member->province->name}}) @endif

@endif @if($receipt->member->fiscal_code != '') Codice Fiscale: {{$receipt->member->fiscal_code}}

@endif

@php $total = 0; $totalSconto = 0; $totalPrediscount = 0; $hasDiscount = false; @endphp @foreach($receipt->rows as $row) Causale: {{@$row->causal->getTree()}}

@if ($row->course) Corso: {{$row->course->getDetailsName()}}

@endif @if ($row->subscription) Abbonamento: {{$row->subscription->name}}

@endif @if ($row->note != '') Dettaglio causale: {{$row->note}}

@endif @if($row->sconto > 0) @php $hasDiscount = true; @endphp Importo: {{formatPrice($row->prediscount_amount)}}

Sconto: {{formatPrice($row->sconto)}}

@endif {{$row->sconto > 0 ? 'Importo finale' : 'Importo'}}: {{formatPrice($row->amount)}}



@php $totalSconto += $row->sconto; $totalPrediscount += $row->prediscount_amount; $total += $row->amount; @endphp @endforeach

@if($hasDiscount) Totale: {{formatPrice($totalPrediscount)}}

Sconto totale: {{formatPrice($totalSconto)}}

@endif Totale: {{formatPrice($total)}}