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

Contribution Differences Analysis

Comprehensive analysis of deduction code 667 differences across multiple periods

@if(count($differences) > 0)
{{ count($differences) }}

Total Records

{{ collect($differences)->where('change_comment', 'Increase')->count() }}

Increased Contributions

{{ collect($differences)->where('change_comment', 'Decrease')->count() }}

Decreased Contributions

{{ collect($differences)->unique('deptName')->count() }}

Departments Affected

@endif
Advanced Analysis Filters
Must select two consecutive months
@if(count($differences) > 0) Export CSV @endif
@if(count($differences) > 0)
Contribution Differences Analysis Results
{{ count($differences) }} Records Found
@php $monthYears = collect($differences)->flatMap(fn($diff) => array_keys($diff['details']))->unique()->sort()->values()->toArray(); @endphp @foreach($monthYears as $my) @endforeach @foreach ($differences as $key => $difference) @foreach($monthYears as $my) @endforeach @endforeach
SN Employee Name Monthly Salary Vote Code Department Change Type{{ \Carbon\Carbon::parse($my . '-01')->format('M Y') }}Actions
{{ $key + 1 }}
{{ trim("{$difference['firstName']} {$difference['middleName']} {$difference['lastName']}") }}
TZS {{ number_format($difference['monthlySalary'], 2) }} {{ $difference['voteCode'] }} {{ $difference['deptName'] }} @if ($difference['change_comment'] === 'Increase') Increase @elseif ($difference['change_comment'] === 'Decrease') Decrease @endif TZS {{ number_format($difference['details'][$my] ?? 0, 2) }} View Details
@elseif(request()->filled('start_date') && request()->filled('end_date'))
No Differences Found
No differences in deduction amounts found for Deduction Code 667 within the selected date range and department (if specified).
@endif
@endsection