@extends('adminlte.app') @section('content')

Registo de Controlo Bancário - Relatório Contabilístico
Participação por Forma de Pagamento

@if ($message = Session::get('success'))

{!! $message !!}

@endif @if ($message = Session::get('error'))

{{ $message }}

@endif
Lista Folha de Caixa
Distribuição por forma de pagamento
{{-- --}} @foreach ($folhas as $folha) @php $numerario = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Numerário')->sum('total_bruto'); $liquidoMB = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Multibanco')->sum('total_liquido'); $brutoMB = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Multibanco')->sum('total_bruto'); $taxas = $brutoMB - $liquidoMB; $credito = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Crédito Local')->sum('total_bruto'); $cheques = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Cheques')->sum('total_bruto'); $valesBP = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Vales BP')->sum('total_bruto'); $ccPoupaMais = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Poupa+')->sum('total_bruto'); $routex = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Routex')->sum('total_bruto'); $outros = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Outros')->sum('total_bruto'); $raspadinhas = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Prémios Raspadinhas')->sum('total_bruto'); $prePago = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Pré-Pago')->sum('total_bruto'); $hiqi = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'HIQi')->sum('total_bruto'); $sobrasFaltas = $folha->formas_pagamento_folha_contabilizadas->sum('total_bruto') - $folha->total_vendas; $validadosPagamentos = $folha->formas_pagamento_folha_contabilizadas->where('correto_validacao', 'Validado com Falhas')->count(); $validadosContadores = $folha->bombas_combustivel_folha->where('correto_validacao', 'Validado com Falhas')->count(); $gavStatus = ''; if($folha->validacao_litros_vendidos == 'nao' || $folha->validacao_contribuinte_talao == 'nao' || $folha->validacao_numeradores_total_descontado == 'nao'){ $gavStatus = 'Não'; } else if($folha->validacao_litros_vendidos == 'sim' && $folha->validacao_contribuinte_talao == 'sim' && $folha->validacao_numeradores_total_descontado == 'sim'){ $gavStatus = 'Sim'; } else { $gavStatus = ''; } $folhaCamposValidados = $folha->camposValidados->where('correto_validacao', 'Validado com Falhas')->count(); if($validadosPagamentos > 0 || $validadosContadores > 0 || $folhaCamposValidados > 0 && ($folha->validado == 1)){ $statusValidacao = 'Validado com Falhas'; }else if($folha->validado == 1){ $statusValidacao = 'Validado sem Falhas'; } else { $statusValidacao = ''; } @endphp {{-- --}} @endforeach
Ações Nª Controle Posto Data Turno Operador Total Vendas Total Declarado Numerário Líquido MB Taxas Multibanco Crédito Cheques Vales BP CC Poupa+ RoutexOutrosRaspadinhas Pré-Pago HIQi Sobras/Faltas GA-V Validação Data Programada Depósito
@if(!$validar) Ver Anexos @if($permissao->alterar_folha_caixa && $folha->validado != 1) Editar @else Visualizar @endif @if($permissao->excluir_folha_caixa)
@csrf @method('DELETE')
@endif @else @if($permissao->validar_folha_caixa && $folha->validado != 1) Validar @else Visualizar Validação @endif @endif
{{ $folha->id }} {{ $folha->posto->nome_posto }} {{ date('d/m/Y', strtotime($folha->data_folha_caixa)) }} {{ $folha->turno }} {{ $folha->operadores_postos->nome_operador ?? '' }} {{ number_format($folha->total_vendas, 2, ",", " ") }} {{ number_format($folha->formas_pagamento_folha_contabilizadas->sum('total_bruto'), 2, ",", " ") }} {{ $numerario ? number_format($numerario, 2, ",", " ") : '0,00' }} {{ $liquidoMB ? number_format($liquidoMB, 2, ",", " ") : '0,00' }} {{ $taxas ? number_format($taxas, 2, ",", " ") : '0,00' }} {{ $credito ? number_format($credito, 2, ",", " ") : '0,00' }} {{ $cheques ? number_format($cheques, 2, ",", " ") : '0,00' }} {{ $valesBP ? number_format($valesBP, 2, ",", " ") : '0,00' }} {{ $ccPoupaMais ? number_format($ccPoupaMais, 2, ",", " ") : '0,00' }} {{ $routex ? number_format($routex, 2, ",", " ") : '0,00' }}{{ $outros ? number_format($outros, 2, ",", " ") : '0,00' }}{{ $raspadinhas ? number_format($raspadinhas, 2, ",", " ") : '0,00' }} {{ $prePago ? number_format($prePago, 2, ",", " ") : '0,00' }} {{ $hiqi ? number_format($hiqi, 2, ",", " ") : '0,00' }} 0) class="bg-success" @endif>{{ number_format($sobrasFaltas, 2, ",", " ") }} {{$gavStatus}} {{$statusValidacao}} @php $dataDeposito = $folha->formas_pagamento_folha->where('formaPagamento.nome_forma_pagamento', 'Numerário')->first(); @endphp {{ $dataDeposito && $dataDeposito->data_programada_deposito ? date('d/m/Y', strtotime($dataDeposito->data_programada_deposito)) : '' }}
@endsection