@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(', ') }}

@php $from = \Carbon\CarbonImmutable::create($reportDate['from']); $to = \Carbon\CarbonImmutable::create($reportDate['to']); $today = \Carbon\CarbonImmutable::now(); @endphp

Inventaire du {{ $from->isoFormat('ll') }} au @if($to > $today) {{ $today->isoFormat('ll') }} @else {{ $to->isoFormat('ll') }} @endif

@foreach($inventories as $inventorie) @php $stock = \App\Models\Stock::where('product_id', $inventorie['product']->id)->first(); $wholesaleMeasure = ($stock)? $stock->wholesaleMeasure->unit .'s' : ''; $inDetailMeasure = ($stock)? $stock->inDetailMeasure->unit .'s | Détail ' : ''; @endphp @endforeach
Produit Stock au {{ $from->subDay()->isoFormat('ll') }} Entrer Sortie Stock au @if($to->greaterThan($today)) {{ $today->isoFormat('ll') }} @else {{ $to->isoFormat('ll') }} @endif
{{ $loop->iteration }}
{{ $inventorie['product']->name}}
{{ number_format($inventorie['stock_on_start']['wholesale_quantity'], 0, ',', ' ') }} {{ $wholesaleMeasure }} @if($inventorie['stock_on_start']['rest_in_detail']) + {{ $inventorie['stock_on_start']['rest_in_detail'] }} {{ $stock->inDetailMeasure->unit .'s' }} @endif
{{ number_format($inventorie['stock_on_start']['in_detail_quantity'], 0, ',', ' ') }} {!! $inDetailMeasure !!}
{{ number_format($inventorie['enter']['wholesale'], 0, ',', ' ') }} {{ $wholesaleMeasure }} @if($inventorie['enter']['rest_in_detail']) + {{ $inventorie['enter']['rest_in_detail'] }} {{ $stock->inDetailMeasure->unit .'s' }} @endif
{{ number_format($inventorie['enter']['detail'], 0, ',', ' ') }} {!! $inDetailMeasure !!}
{{ number_format($inventorie['outer']['wholesale'], 0, ',', ' ') }} {{ $wholesaleMeasure }} @if($inventorie['outer']['rest_in_detail']) + {{ $inventorie['outer']['rest_in_detail'] }} {{ $stock->inDetailMeasure->unit .'s' }} @endif
{{ number_format($inventorie['outer']['detail'], 0, ',', ' ') }} {!! $inDetailMeasure !!}
{{ number_format($inventorie['stock_on_end']['wholesale_quantity'], 0, ',', ' ') }} {{ $wholesaleMeasure }} @if($inventorie['stock_on_end']['rest_in_detail']) + {{ $inventorie['stock_on_end']['rest_in_detail'] }} {{ $stock->inDetailMeasure->unit .'s' }} @endif
{{ number_format($inventorie['stock_on_end']['in_detail_quantity'], 0, ',', ' ') }} {!! $inDetailMeasure !!}

Créer le {{ $today->isoFormat('lll') }}