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

Faturas

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

{{ $message }}

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

{{ $message }}

@endif
Faturas Cadastradas
{{-- @if($permissao->importar_faturas) @endif --}} {{--
@csrf
--}}
Filtros
@if($permissao->exibir_todas_faturas)
@endif
{{--
--}}
@foreach ($canais as $canal) @if ($origem == $canal->id || $origem == null) {{-- --}} @endif @endforeach
Canal Total Faturado Total Vencido % Incumprimento
{{ $canal->nome_canal }} {{ number_format($canal->totalfaturado, 2, ',', '.') }} {{ number_format($canal->totalvencido, 2, ',', '.') }} @if(isset($canal->totalvencido) && isset($canal->totalfaturado)) @if($canal->totalvencido != 0 && $canal->totalfaturado != 0) {{ number_format($canal->totalvencido / $canal->totalfaturado * 100,2) }}% @else 0% @endif @else 0% @endif {{-- {{ (isset($canal->totalvencido) && isset($canal->totalfaturado)) ? number_format($canal->totalvencido / $canal->totalfaturado * 100,2) : 0 }}% --}}
Total {{ number_format($totais['totalfaturado'], 2, ',', '.') }} {{ number_format($totais['totalvencido'], 2, ',', '.') }} @if((isset($totais['totalvencido']) && isset($totais['totalfaturado']))) @if($totais['totalvencido'] != 0 && $totais['totalfaturado'] != 0) {{ number_format($totais['totalvencido'] / $totais['totalfaturado'] * 100,2) }}% @else 0% @endif @else 0% @endif {{-- {{ (isset($totais['totalvencido']) && isset($totais['totalfaturado'])) ? number_format($totais['totalvencido'] / $totais['totalfaturado'] * 100,2) : 0 }}% --}}

{{ $clientes_faturas_query->onEachSide(5)->links() }}

{{--
{{ $grupo->onEachSide(5)->links() }}
--}}
{{-- --}} @if($permissao->exibir_todas_faturas) @endif @foreach($clientes_faturas as $key => $cliente) @if (is_array($cliente)) @if($permissao->exibir_todas_faturas) @endif @foreach ($cliente as $k => $cli) @if($k != 'total' && $k != 'id') @if($permissao->exibir_todas_faturas) @endif @endif @endforeach @else @if(!$cliente->grupo_cliente_id) @if($permissao->exibir_todas_faturas) @endif @endif @endif @endforeach
Ações
Nome Cliente
ValorMvalorVencidoGestor
{{ $key }} {{ number_format($cliente['total'], 2, ',','.') }}
@if($cli->email_cliente) {{--
@csrf
--}} @endif
@if($cli->nome_cliente=="") Cliente Não encontrado @else {{ $cli->nome_cliente }} @endif {{ number_format($cli->total, 2, ',', '.') }} {{ $cli->vencido }}
{{-- --}} @if($permissao->exibir_todas_faturas) @endif {{-- @foreach ($faturas->sortByDesc('dt_vencimento') as $item) --}} @foreach ($faturas->sortBy('dt_vencimento') as $item) @if($item->nome == $cli->nome ) @if($item->origem == "IM" and isset($item->cliente_im->nome)) @elseif($item->origem =="TFUEL" and isset($item->cliente_tfuel->nome)) @else @endif {{----}} @if ($item->status == "Pendente") @if($item->dt_vencimento < \Carbon\Carbon::now()) @else @endif @else @endif @if ($cli->sinistro == "Sim") @else @endif @if($permissao->exibir_todas_faturas) @if($item->origem == "IM" and isset($item->cliente_im->gestor_user->name)) @elseif($item->origem =="TFUEL" and isset($item->cliente_tfuel->gestor_user->name)) @else @endif @endif @endif @endforeach
Ações Canal
Nome Cliente
Fatura ValorMvalorEmissão Vencimento Idade Vencido Atraso StatusGestorComprovativo Promessa de Pagamento Anexo Promessa Fase Sinistrado
{{ $item->canal->nome_canal }}{{ $item->cliente_im->nome }}{{ $item->cliente_tfuel->nome }}Cliente Não encontrado{{ $item->num_documento }} {{ number_format($item->valor_total, 2, ',', '.') }} Perguntar o que é mvalor, se é calculado {{ date('d/m/Y', strtotime($item->dt_emissao)) }} {{ date('d/m/Y', strtotime($item->dt_vencimento)) }} {{ \Carbon\Carbon::now()->diffInDays($item->dt_emissao) }} Sim Não @if ($item->status == "Pendente") @if(\Carbon\Carbon::parse($item->dt_vencimento)->diffInDays(null, false) < 1) @elseif(\Carbon\Carbon::parse($item->dt_vencimento)->diffInDays(null, false) < 30) @else @endif {{ \Carbon\Carbon::parse($item->dt_vencimento)->diffInDays(null, false) }} {{-- @if(\Carbon\Carbon::now()->diffInDays($item->dt_vencimento) < 1) --}} {{-- {{ \Carbon\Carbon::now()->diffInDays($item->dt_vencimento) }} --}} @else @endif Sinistrado status == "Paga") class="bg-success" @elseif ($item->status == "PPago") style="background-color: #ffc000;" @elseif($item->status == "Promessa de PagamentoV") class="bg-danger" @endif> {{ $item->status }} {{ $item->cliente_im->gestor_user->name }}{{ $item->cliente_tfuel->gestor_user->name }} @if($item->comprovante_pagamento and $item->comprovante_pagamento != "noimage.png" ) @endif @if($item->comprovante_extra1 or $item->comprovante_extra2 or $item->comprovante_extra3)
@if ($item->comprovante_extra1) @endif @if ($item->comprovante_extra2) @endif @if ($item->comprovante_extra3) @endif
@endif
{{ date('d/m/Y', strtotime($item->data_promessa_pagamento)) }} {{ $item->cheque_transferencia }} {{ $item->fase_sinistrado }}
@if($cliente->email_cliente) {{--
@csrf
--}} @endif
@if($cliente->nome_cliente=="") Cliente Não encontrado @else {{ $cliente->nome_cliente }} @endif {{ number_format($cliente->total, 2, ',', '.') }} {{ $cliente->vencido }}
{{-- --}} @if($permissao->exibir_todas_faturas) @endif @foreach ($faturas as $item) @if($item->nome == $cliente->nome ) @if($item->origem == "IM" and isset($item->cliente_im->nome)) @elseif($item->origem =="TFUEL" and isset($item->cliente_tfuel->nome)) @else @endif {{----}} @if ($item->status == "Pendente") @if($item->dt_vencimento < \Carbon\Carbon::now()) @else @endif @else @endif @if ($cliente->sinistro == "Sim") @else @endif @if($permissao->exibir_todas_faturas) @if($item->origem == "IM" and isset($item->cliente_im->gestor_user->name)) @elseif($item->origem =="TFUEL" and isset($item->cliente_tfuel->gestor_user->name)) @else @endif @endif @endif @endforeach
Ações Canal
Nome Cliente
Fatura ValorMvalorEmissão Vencimento Idade Vencido Atraso StatusGestorComprovativo Promessa de Pagamento Anexo Promessa Fase Sinistrado
{{--
@csrf @method('DELETE')
--}}
{{ $item->canal->nome_canal }}{{ $item->cliente_im->nome }}{{ $item->cliente_tfuel->nome }}Cliente Não encontrado{{ $item->num_documento }} {{ number_format($item->valor_total, 2, ',', '.') }} Perguntar o que é mvalor, se é calculado {{ date('d/m/Y', strtotime($item->dt_emissao)) }} {{ date('d/m/Y', strtotime($item->dt_vencimento)) }} {{ \Carbon\Carbon::now()->diffInDays($item->dt_emissao) }} Sim Não @if ($item->status == "Pendente") @if(\Carbon\Carbon::parse($item->dt_vencimento)->diffInDays(null, false) < 1) @elseif(\Carbon\Carbon::parse($item->dt_vencimento)->diffInDays(null, false) < 30) @else @endif {{ \Carbon\Carbon::parse($item->dt_vencimento)->diffInDays(null, false) }} {{-- @if(\Carbon\Carbon::now()->diffInDays($item->dt_vencimento) < 1) --}} {{-- {{ \Carbon\Carbon::now()->diffInDays($item->dt_vencimento) }} --}} @else @endif Sinistrado status == "Paga") class="bg-success" @elseif ($item->status == "PPago") style="background-color: #ffc000;" @elseif($item->status == "Promessa de PagamentoV") class="bg-danger" @endif> {{ $item->status }} {{ $item->cliente_im->gestor_user->name }}{{ $item->cliente_tfuel->gestor_user->name }} @if($item->comprovante_pagamento and $item->comprovante_pagamento != "noimage.png" ) @endif @if($item->comprovante_extra1 or $item->comprovante_extra2 or $item->comprovante_extra3)
@if ($item->comprovante_extra1) @endif @if ($item->comprovante_extra2) @endif @if ($item->comprovante_extra3) @endif
@endif
@if($item->data_promessa_pagamento) {{ date('d/m/Y', strtotime($item->data_promessa_pagamento)) }} @endif {{ $item->cheque_transferencia }} {{ $item->fase_sinistrado }}
{{--
{{ $grupo->onEachSide(5)->links() }}
--}}
{{ $clientes_faturas_query->onEachSide(5)->links() }}
{{-- fim modal --}} @endsection