| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <style>
- body {
- font-family: Helvetica, Arial, sans-serif;
- font-size:14px;
- }
- footer {
- position: fixed;
- bottom: -20px;
- left: 0px;
- right: 0px;
- height: 50px;
- }
- .logo {
- max-width: 200px;
- max-height: 100px;
- object-fit: contain;
- }
- </style>
- </head>
- <body>
- @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)
- <img src="{{ $logoUrl }}" class="logo" alt="Logo">
- @elseif($azienda && $azienda->logo)
- {{-- Fallback if URL generation fails --}}
- <div style="width: 200px; height: 100px; border: 1px dashed #ccc; display: flex; align-items: center; justify-content: center;">
- <small>Logo non disponibile</small>
- </div>
- @endif
- <br><br><br>
- <div align="right"><b>RICEVUTA DI PAGAMENTO N. {{$receipt->number . "/" . $receipt->year}} del {{date("d/m/Y", strtotime($receipt->created_at))}}</b></div><br><br>
- @if($receipt->status == 99)
- <div align="right"><b style="color:red">ANNULLATA</b></div><br><br>
- @endif
- <br>
- @if($azienda)
- @if($azienda->ragione_sociale)
- {{$azienda->ragione_sociale}}
- @elseif($azienda->nome_associazione)
- {{$azienda->nome_associazione}}
- @endif
- <br><br>
- <b>Indirizzo</b>:
- @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) }}
- <br><br>
- @if($azienda->codice_fiscale)
- <b>C.F.</b>: {{$azienda->codice_fiscale}}<br><br>
- @endif
- @if($azienda->partita_iva)
- <b>P.IVA</b>: {{$azienda->partita_iva}}<br><br>
- @endif
- @if($azienda->email)
- <b>Email</b>: {{$azienda->email}}<br><br>
- @endif
- @if($azienda->pec)
- <b>PEC</b>: {{$azienda->pec}}<br><br>
- @endif
- @else
- <div style="color: red; font-weight: bold;">
- ATTENZIONE: Configurare i dati aziendali nel sistema
- </div><br><br>
- @endif
- <hr><br>
- <b>Intestata a</b><br><br>
- @if(!$receipt->member->isAdult())
- <b>Genitore</b>: {{$receipt->parent}}<br><br>
- @endif
- @if($receipt->member->last_name != '')
- <b>Cognome</b>: {{$receipt->member->last_name}}<br><br>
- @endif
- @if($receipt->member->first_name != '')
- <b>Nome</b>: {{$receipt->member->first_name}}<br><br>
- @endif
- @if(@$receipt->member->birth_city->name != '' || @$receipt->member->birth_province->name != '' || @$receipt->member->birth_date != '')
- <b>Nato/a a</b>:
- @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
- <br><br>
- @endif
- @if($receipt->member->address != '' || @$receipt->member->city->name != '' || @$receipt->member->province->name != '')
- <b>Residente in</b>:
- @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
- <br><br>
- @endif
- @if($receipt->member->fiscal_code != '')
- <b>Codice Fiscale</b>: {{$receipt->member->fiscal_code}}<br><br>
- @endif
- <hr><br>
- @php
- $total = 0;
- $totalSconto = 0;
- $totalPrediscount = 0;
- $hasDiscount = false;
- @endphp
- @foreach($receipt->rows as $row)
- <b>Causale</b>: {{@$row->causal->getTree()}}<br><br>
- @if ($row->course)
- <b>Corso</b>: {{$row->course->getDetailsName()}}<br><br>
- @endif
- @if ($row->note != '')
- <b>Dettaglio causale</b>: {{$row->note}}<br><br>
- @endif
- @if($row->sconto > 0)
- @php $hasDiscount = true; @endphp
- <b>Importo</b>: {{formatPrice($row->prediscount_amount)}}<br><br>
- <b>Sconto</b>: {{formatPrice($row->sconto)}}<br><br>
- @endif
- <b>{{$row->sconto > 0 ? 'Importo finale' : 'Importo'}}</b>: {{formatPrice($row->amount)}}<br><br>
- <hr><br>
- @php
- $totalSconto += $row->sconto;
- $totalPrediscount += $row->prediscount_amount;
- $total += $row->amount;
- @endphp
- @endforeach
- <br><br>
- @if($hasDiscount)
- <b>Totale</b>: {{formatPrice($totalPrediscount)}}<br><br>
- <b>Sconto totale</b>: {{formatPrice($totalSconto)}}<br><br>
- @endif
- <b>Totale</b>: {{formatPrice($total)}}<br><br>
- <footer>
- <small>
- @if($azienda)
- @php
- $locationParts = array_filter([
- $azienda->sede_legale_comune,
- $azienda->sede_legale_provincia ? '(' . $azienda->sede_legale_provincia . ')' : null
- ]);
- $location = implode(' ', $locationParts);
- @endphp
- {{ $location ?: 'Sede legale' }} li {{date("d/m/Y", strtotime($receipt->created_at))}}
- @else
- {{date("d/m/Y", strtotime($receipt->created_at))}}
- @endif
- </small>
- </footer>
- </body>
- </html>
|