@php $somaLucro = 0; $somaVendas = 0; @endphp @foreach($data as $item) @foreach($item['itens'] as $i) @php $somaLucro += ($i['lucro'] * $i['quantidade']); @endphp @endforeach @php $somaVendas += $item['total']; @endphp
DATA CLIENTE NÂș 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, ',', '.')}}
@endforeach Soma Geral de Vendas R$ {{ number_format($somaVendas, 2, ',', '.') }}