@extends('default.layout') @section('content')


@isset($itens)
@php $somaValor = 0; $somaQuantidade = 0; @endphp @foreach($itens as $i) @php $somaValor += $i->total; $somaQuantidade += $i->quantidade; @endphp @endforeach
Produto Quantidade Unidade R$ Total
{{$i->produto->nome}} {{$i->produto->unidade_venda}} {{number_format($i->quantidade, 2, ',', '.')}} {{ number_format($i->total, 2, ',', '.') }}

Quantidade de registros: {{$somaQuantidade}}

Valor total de emissão: {{ number_format($somaValor, 2, ',', '.') }}

@php $percentual = $somaTotalVendas > 0 ? (100 - ((($somaValor-$somaTotalVendas)/$somaTotalVendas*100)*-1)) : 0; @endphp

Percentual: {{ number_format($percentual, 2, ',', '.') }}%

@endisset
@endsection