@extends('default.layout') @section('content')
@isset($agendamentos) @if($arrAgrupado == null)
@foreach($agendamentos as $a) @endforeach
# Cliente Atendente Data Horário Valor do agendamento Valor de comissão
{{$a->id}} {{$a->cliente->razao_social}} {{$a->funcionario->nome}} {{ \Carbon\Carbon::parse($a->data)->format('d/m/Y')}} {{ \Carbon\Carbon::parse($a->inicio)->format('H:i')}}/{{ \Carbon\Carbon::parse($a->termino)->format('H:i')}} R$ {{$a->total}} R$ {{$a->valor_comissao}}

Valor total em agendamento: R$ {{number_format($somaValor, 2)}}

Valor total em comissão: R$ {{number_format($somaComissao, 2)}}

@else
@foreach($arrAgrupado as $arr)

{{$arr['id']}} - {{$arr['nome']}}

Total de agendamentos: R$ {{number_format($arr['valor_agendamento'], 2)}}
Total de comissão: R$ {{number_format($arr['valor_comissao'], 2)}}
Total de servicos: {{number_format($arr['total_de_servicos'])}}
@endforeach
@endif @endisset
@endsection