@extends('pdf.layout') @section('title', 'Supplier Balances Report') @section('meta-info') @if (isset($start_date) && isset($end_date))

Period: {{ $start_date }} to {{ $end_date }}

@else

Period: All Time

@endif

Total Suppliers: {{ count($balances) }}

@endsection @section('content') @forelse($balances as $index => $balance) @empty @endforelse @if (count($balances) > 0) @endif
# Supplier Code Supplier Name Collections Payments Balance
{{ $index + 1 }} {{ $balance['supplier_code'] }} {{ $balance['supplier_name'] }} {{ number_format($balance['total_collections'], 2) }} {{ number_format($balance['total_payments'], 2) }} {{ number_format(abs($balance['balance']), 2) }}
No supplier data available
TOTAL: {{ number_format(array_sum(array_column($balances, 'total_collections')), 2) }} {{ number_format(array_sum(array_column($balances, 'total_payments')), 2) }} {{ number_format(abs(array_sum(array_column($balances, 'balance'))), 2) }}
@endsection