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

Contribution Differences Analysis

Compare deduction code 667 contributions across consecutive periods

@if(count($differences) > 0) Export CSV @endif
@if(count($differences) > 0)

{{ count($differences) }}

Total Records

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

Increased

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

Decreased

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

Departments

Contribution Differences Results
{{ count($differences) }} Records
@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']}") }} {{ number_format($difference['monthlySalary'], 2) }} {{ $difference['voteCode'] }} {{ $difference['deptName'] }} @if ($difference['change_comment'] === 'Increase') ↑ Increase @elseif ($difference['change_comment'] === 'Decrease') ↓ Decrease @endif {{ number_format($difference['details'][$my] ?? 0, 2) }} View
@elseif(request()->filled('start_date') && request()->filled('end_date'))
No Differences Found

No differences in deduction amounts found for the selected date range and department.

@endif
@endsection