@isset($informe) {!! $informe !!} @else Relatório de Vendas @endisset

Período: {{ isset($dataInicio) ? date('d/m/Y', strtotime($dataInicio)) : 'Todas' }} até {{ isset($dataFim) ? date('d/m/Y', strtotime($dataFim)) : 'Atual' }}
Gerado em: {{ date('d/m/Y H:i:s') }}
@if(isset($vendasFeitas) && count($vendasFeitas) > 0)
@php $totalFarmacosVendidos = 0; $totalCustoCompra = 0; $totalCustoVendas = 0; $totalLucro = 0; $contador = 1; @endphp @foreach($vendasFeitas as $key => $venda) @php $totalFarmacosVendidos += $venda['Qunatidade'] ?? 0; $totalCustoCompra += $venda['compra'] ?? 0; $totalCustoVendas += $venda['custo'] ?? 0; $totalLucro += $venda['Lucro'] ?? 0; @endphp @endforeach
# Produto Quantidade Preço Compra Preço Venda Lucro Unitário Lucro Total
{{ $contador++ }} {{ $venda['nome'] ?? 'N/A' }} @if(isset($venda['codigo']))
Cód: {{ $venda['codigo'] }} @endif
{{ number_format($venda['Qunatidade'] ?? 0, 0, ',', '.') }} {{ number_format($venda['compra'] ?? 0, 2, ',', '.') }} MT {{ number_format($venda['custo'] ?? 0, 2, ',', '.') }} MT @php $lucroUnitario = ($venda['custo'] ?? 0) - ($venda['compra'] ?? 0); @endphp {{ number_format($lucroUnitario, 2, ',', '.') }} MT {{ number_format($venda['Lucro'] ?? 0, 2, ',', '.') }} MT
TOTAIS: {{ number_format($totalFarmacosVendidos, 0, ',', '.') }} {{ number_format($totalCustoCompra, 2, ',', '.') }} MT {{ number_format($totalCustoVendas, 2, ',', '.') }} MT {{ number_format($totalLucro, 2, ',', '.') }} MT
Total de Produtos
{{ number_format($totalFarmacosVendidos, 0, ',', '.') }}
Total Compra
{{ number_format($totalCustoCompra, 2, ',', '.') }} MT
Total Vendas
{{ number_format($totalCustoVendas, 2, ',', '.') }} MT
Lucro Total
{{ number_format($totalLucro, 2, ',', '.') }} MT
Margem de Lucro
@php $margem = $totalCustoVendas > 0 ? ($totalLucro / $totalCustoVendas) * 100 : 0; @endphp {{ number_format($margem, 1, ',', '.') }}%
Resumo
  • Total de Itens: {{ number_format($totalFarmacosVendidos, 0, ',', '.') }}
  • Ticket Médio: {{ $totalFarmacosVendidos > 0 ? number_format($totalCustoVendas / $totalFarmacosVendidos, 2, ',', '.') : '0,00' }} MT
  • Lucro Médio por Item: {{ $totalFarmacosVendidos > 0 ? number_format($totalLucro / $totalFarmacosVendidos, 2, ',', '.') : '0,00' }} MT
Status

✓ Relatório gerado com sucesso

ℹ Total de produtos: {{ count($vendasFeitas) }}

@else

Nenhum dado encontrado

Não há vendas registradas para o período selecionado.

@endif

Assinatura

{{ auth()->user()->name ?? 'Não identificado' }}
{{ auth()->user()->email ?? '' }}

{{ date('d/m/Y H:i:s') }}