@extends('default.layout') @section('content')
@if(sizeof($usuarios) > 0)
@endif @php $estado = $abertura == null ? false : true; @endphp

Estado: @if($estado) Caixa aberto {{\Carbon\Carbon::parse($abertura->created_at)->format('d/m/Y H:i')}} @else Caixa fechado @endif


@if($estado) @if(sizeof($caixa) > 0)

Total de vendas: {{sizeof($caixa['vendas'])}}

@endif @if($abertura != null)

Valor de abertura: {{number_format($abertura->valor, 2, ',', '.')}}

@endif @endif @php $somaDinheiro = 0; @endphp @if(sizeof($caixa) > 0)

Total por tipo de pagamento:

@foreach($caixa['somaTiposPagamento'] as $key => $tp) @if($tp > 0)

{{App\Models\VendaCaixa::getTipoPagamento($key)}}

@php if($key == '01') $somaDinheiro = $tp; @endphp

R$ {{number_format($tp, 2, ',', '.')}}

@endif @endforeach
@endif
@php $soma = 0; @endphp @if(sizeof($caixa) > 0) @foreach($caixa['vendas'] as $v) @if($v->tipo == 'PDV') @else @endif @if(!isset($v->cpf)) @else @endif @if($v->estado != 'CANCELADO') @php if(!isset($v->cpf)) $soma += $v->valor_total-$v->desconto+$v->acrescimo; else $soma += $v->valor_total; @endphp @endif @endforeach @endif
Cliente Data Tipo de pagamento Estado NFCe/NFe Tipo Valor
{{ $v->cliente->razao_social ?? 'NAO IDENTIFCADO' }} {{ \Carbon\Carbon::parse($v->created_at)->format('d/m/Y H:i:s')}} @if($v->tipo_pagamento == '99') Outros @else {{$v->getTipoPagamento($v->tipo_pagamento)}} @endif {{ $v->estado }} {{ $v->NFcNumero > 0 ? $v->NFcNumero : '--' }} {{ $v->NfNumero > 0 ? $v->NfNumero : '--' }} {{ $v->tipo }} {{ number_format($v->valor_total-$v->desconto+$v->acrescimo, 2, ',', '.') }} {{ number_format($v->valor_total, 2, ',', '.') }}

@php $somaSuprimento = 0; $somaSangria = 0; @endphp @if(sizeof($caixa) > 0)

Suprimentos:

@if(sizeof($caixa['suprimentos']) > 0) @foreach($caixa['suprimentos'] as $s)

Valor: R$ {{number_format($s->valor, 2, ',', '.')}}

@php $somaSuprimento += $s->valor; @endphp @endforeach @else

R$ 0,00

@endif

Sangrias:

@if(sizeof($caixa['sangrias']) > 0) @foreach($caixa['sangrias'] as $s)

Valor: R$ {{number_format($s->valor, 2, ',', '.')}}

@php $somaSangria += $s->valor; @endphp @endforeach @else

R$ 0,00

@endif
@endif @if(sizeof($caixa) == 0)

NÃO É POSSÍVEL FECHAR SEM NENHUMA VENDA

@else @if($abertura != null)

Soma de vendas: {{number_format($soma, 2, ',', '.')}}

Total caixa dinheiro: {{number_format(($somaDinheiro + $somaSuprimento + $abertura->valor) - $somaSangria, 2, ',', '.')}}

Total Geral: {{number_format(($soma + $somaSuprimento + $abertura->valor) - $somaSangria, 2, ',', '.')}}

@endif @endif
@section('javascript') @endsection @endsection