@extends('adminlte::page') @section('title', " $title ") @section('content')
FILTRO - RELATÓRIO FATURAMENTO
Filtro por período...
@include('app.includes.alerts')
@csrf
@if($hasFilters && $customers->isNotEmpty())
@if(isset($selectedInitialDate) && isset($selectedFinalDate))
Você selecionou o período: {{ $selectedInitialDate }} à {{ $selectedFinalDate }}
@endif

RELATÓRIO GERAL NO PERÍODO

@php $qtdTotal = 0; $valueInvoicing = 0; $mediaTotal = 0; $categoriesDisplayed = []; @endphp @foreach($customers as $customer) @php $qtdTotal += $customer->Quantidade; $valueInvoicing += $customer->Faturamento; $mediaTotal = $valueInvoicing / $qtdTotal; $categoriesDisplayed[] = $customer->Categoria; @endphp @endforeach
CATEGORIA QUANTIDADE FATURAMENTO MÉDIA
{{ $customer->Categoria }} {{ $customer->Quantidade }} R$ {{ number_format($customer->Faturamento, 2, ',', '.') }} R$ {{ number_format($customer->Media, 2, ',', '.') }}
Total Geral das categorias {{ number_format($qtdTotal, 3, '.', '.') }} R$ {{ number_format($valueInvoicing, 2, ',', '.') }} R$ {{ number_format($mediaTotal, 2, ',', '.') }}
@elseif($hasFilters)

Nenhum faturamento encontrado com o período aplicado.

@endif
@stop