@extends('relatorios.default') @section('content') @if($data_inicial && $data_final) @endif @php $somaLucro = 0; $somaVendas = 0; @endphp @foreach($data as $item) @php $somaLucro = 0; @endphp @foreach($item['itens'] as $i) @php $somaLucro += ($i['lucro'] * $i['quantidade']); @endphp @endforeach @php $somaVendas += $item['total']; @endphp @endforeach
Período: {{$data_inicial}} - {{$data_final}}
Data Cliente Número da venda/pedido Total Tipo
{{ $item['data'] }} {{ $item['cliente'] }} {{ $item['numero']}} R$ {{ number_format($item['total'], $casasDecimais, ',', '.')}} {{ $item['tipo']}}
Produto Quantidade Valor unit. Custo Lucro Lucro %
{{$i['produto']}} {{ number_format($i['quantidade'], $casasDecimaisQtd, ',', '.') }} {{ number_format($i['valor'], $casasDecimais, ',', '.') }} {{ number_format($i['custo'], $casasDecimais, ',', '.') }} {{ number_format($i['lucro'], $casasDecimais, ',', '.') }} {{ number_format($i['lucro_perc'], 2, ',', '.') }}
Total de lucro: R$ {{ number_format($somaLucro, $casasDecimais, ',', '.')}}

Soma Geral de Vendas: R$ {{ number_format($somaVendas, 2, ',', '.') }}

@endsection