@php $itensCobranca = (isset($boleto->receivables) && method_exists($boleto, 'receivables')) ? $boleto->receivables : collect([$boleto]); @endphp
{{-- 1. DETALHAMENTO DA COBRANÇA --}}
1. DETALHAMENTO DA COBRANÇA
@foreach($itensCobranca as $item) @endforeach
Descrição do Item Valor (R$)
{{ $item->description ?? optional($item->accountPlan)->name ?? 'Cobrança' }} {{ number_format($item->pivot->amount_in_consolidated ?? $item->total_amount ?? $item->amount, 2, ',', '.') }}
TOTAL A PAGAR R$ {{ number_format($boleto->total_amount - $boleto->discount, 2, ',', '.') }}
{{-- 2. DEMONSTRATIVO FINANCEIRO --}} @if(isset($balancete))
2. DEMONSTRATIVO FINANCEIRO SINTÉTICO ({{ \Carbon\Carbon::parse($boleto->competence_month)->subMonth()->format('m/Y') }})
{{-- RECEITAS --}} {{-- DESPESAS --}}
@foreach($balancete['revenues_by_category'] ?? [] as $rec) @endforeach
RECEITAS VALOR
{{ \Str::limit($rec['category'], 35) }} {{ number_format($rec['total'], 2, ',', '.') }}
@foreach($balancete['expenses_by_category'] ?? [] as $desp) @endforeach
DESPESAS VALOR
{{ \Str::limit($desp['category'], 35) }} {{ number_format($desp['total'], 2, ',', '.') }}
{{-- RESUMO FINANCEIRO --}}
Saldo Anterior R$ {{ number_format($balancete['previous_balance'] ?? 0, 2, ',', '.') }} (+) Entradas R$ {{ number_format($balancete['revenues'] ?? 0, 2, ',', '.') }} (-) Saídas R$ {{ number_format($balancete['expenses'] ?? 0, 2, ',', '.') }} Saldo Atual R$ {{ number_format(($balancete['previous_balance'] ?? 0) + ($balancete['revenues'] ?? 0) - ($balancete['expenses'] ?? 0), 2, ',', '.') }}
@else
Demonstrativo financeiro não disponível para o período.
@endif