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

Salary Deduction Details

{{ $firstName }} {{ $middleName }} {{ $lastName }} (Check: {{ $checkNumber }})
Deduction History & Balance Summary
{{ count($deductionTypes) }} Types
@foreach($deductionTypes as $type) @endforeach @php $columnTotals = array_fill_keys($deductionTypes, 0); $balanceTotals = array_fill_keys($deductionTypes, 0); @endphp @foreach($formattedData as $year => $months) @foreach($months as $month => $deductions) @foreach($deductionTypes as $type) @php $amount = $deductions[$type] ?? 0; $balance = $deductions[$type . '_balance'] ?? 0; $columnTotals[$type] += $amount; $balanceTotals[$type] += $balance; @endphp @endforeach @endforeach @endforeach @foreach($deductionTypes as $type) @endforeach
Date{{ strtoupper($type) }} DEDUCTION {{ strtoupper($type) }} BALANCE
{{ $year }}
{{ $month }}{{ number_format($amount, 2) }} {{ number_format($balance, 2) }}
TOTALTZS {{ number_format($columnTotals[$type], 2) }} N/A
@endsection