@php $company = \App\Models\Company::all()->last() @endphp
{{ $company->name }}
@php $phones = collect(); ($company->phone1)?$phones->push($company->phone1): ''; ($company->phone2)?$phones->push($company->phone2): ''; ($company->phone3)?$phones->push($company->phone3): ''; ($company->phone4)?$phones->push($company->phone4): ''; @endphp
Tel: {{ $phones->join(', ') }}

Rapport des sorties par client

{{ \Carbon\Carbon::create($reportDate['from'])->isoFormat('ll') }} au {{ \Carbon\Carbon::create($reportDate['to'])->isoFormat('ll') }}

@foreach($customers as $customer) @php $totalVendu = 0; @endphp @foreach($customer as $sell) @php $totalVendu += ($sell->outType->name == 'Vente')?$sell->total : 0; @endphp @endforeach
Date Produits TypeSortie Client Total
{{ \Carbon\Carbon::create($sell->date)->isoFormat('ll') }}
@php $achats = json_decode($sell->achats); @endphp
@foreach($achats as $achat) {{ $achat->sell_quantity }} {{ json_decode($achat->product)->name }}, @endforeach
{{ $sell->outType->name }}
{{ ($sell->customer)?$sell->customer->name:"" }}
{{ number_format($sell->total, 0, ',', ' ') }} FCFA

TOTAL VENDU: {{ number_format($totalVendu, 0, ',', ' ') }} FCFA

TOTAL ATTENDU: {{ number_format($customer->sum('total'), 0, ',', ' ') }} FCFA

ECART: {{ number_format($customer->sum('total') - $totalVendu, 0, ',', ' ') }} FCFA

Créer le {{ \Carbon\Carbon::now()->isoFormat('lll') }}

@endforeach