@php $sub_total = 0; $total = 0; $discount = 0; $converter = new \TNkemdilim\MoneyToWords\Converter("Francs CFA", "", \TNkemdilim\MoneyToWords\Languages::FRENCH); @endphp Facture
logo

#{{ str_pad($analysis->first()->id, 10, '0', STR_PAD_LEFT) }}

Date: {{ date('d/m/Y') }}
Laboratoire:
{{ $analysis->first()->site->name }}
{{ $analysis->first()->site->address }}
{{ $analysis->first()->site->primary_phone }}
Institution PEC:
{{$care_institute->name}}
{{$care_institute->address}}
{{$care_institute->telephone}}
@foreach($analysis as $analyse) @php $sub_total += $analyse->sub_total; $total += $analyse->total; $discount += $analyse->discount; $nb_of_b = $analyse->patientAnalyses->reduce(function($cumul, $patientAnalyse) { return $cumul + $patientAnalyse->analyseType->number_of_b; }, 0) @endphp @endforeach
REF N° DOSSIER NOM-PRENOM NOMENCLATURE PRIX INTERESSES EMPLOYEUR
#{{ str_pad($analyse->id, 10, '0', STR_PAD_LEFT) }} {{$analyse->matricule}} {{optional($analyse->patient)->first_name}} {{optional($analyse->patient)->last_name}} {{ $nb_of_b ?? '-' }} {{formatpriceth($analyse->total, getCurrency())}} {{formatpriceth($analyse->sub_total, getCurrency())}} {{formatpriceth($analyse->discount, getCurrency())}}
TOTAUX {{formatpriceth($total, getCurrency())}} {{formatpriceth($sub_total, getCurrency())}} {{formatpriceth($discount, getCurrency())}}
NET A PAYER: {{ str_replace("seul", "", ucfirst($converter->convert($discount))) }}