@if($key == "0" || $key=="created_at")
| |
@foreach ($itm as $elem)
{{ Carbon\Carbon::parse($elem)->format('d/m/y ') }} |
@endforeach
Diff |
@else
{{$key }} |
@foreach ($itm as $k=>$elem)
@php
// Converti array in valore scalare
if (is_array($elem)) {
$elem = !empty($elem) ? reset($elem) : null;
}
// Converti oggetti in stringa
if (is_object($elem)) {
$elem = (string) $elem;
}
@endphp
@if(is_numeric($elem))
{{round($elem,2)}}
@else
{{$elem ?? '-'}}
@endif
|
@endforeach
@php
$valore0 = is_array($itm[0] ?? null) ? (!empty($itm[0]) ? reset($itm[0]) : null) : ($itm[0] ?? null);
$valoreK = is_array($itm[$k] ?? null) ? (!empty($itm[$k]) ? reset($itm[$k]) : null) : ($itm[$k] ?? null);
if (is_object($valore0)) $valore0 = (string) $valore0;
if (is_object($valoreK)) $valoreK = (string) $valoreK;
@endphp
@if($k == 0 )
@if(is_numeric($valore0))
{{round($valore0,2)}}
@else
{{$valore0 ?? '-'}}
@endif
|
@else
@if(is_numeric($valore0) && is_numeric($valoreK))
{{-round($valore0-$valoreK,2)}}
@else
-
@endif
|
@endif
@endif
@endforeach