| SL |
Changed Date |
Effective Month/Date |
Change Type |
Calculation Type |
Previous Salary |
Change Value |
New Salary |
Difference |
Note |
Changed By |
@forelse($histories as $index => $history)
@php
$oldSalary = (float) ($history->old_salary ?? 0);
$newSalary = (float) ($history->new_salary ?? 0);
$difference = $newSalary - $oldSalary;
$changeType = strtolower((string) $history->change_type);
$changeLabel = $changeType === 'decrement' ? 'Decrease' : 'Increase';
$changeClass = $changeType === 'decrement' ? 'danger' : 'success';
$mode = strtolower((string) $history->change_mode);
$modeLabel = $mode === 'percent' ? 'Percentage' : 'Fixed Amount';
$changeValue = (float) $history->change_value;
$effectiveMonth = optional($history->effective_month)->format('F Y') ?? '-';
$note = $history->reason ?: '-';
$changedBy = optional($history->approvedBy)->name ?? '-';
$changedAt = optional($history->approved_at ?? $history->created_at)->format('d M Y, h:i A') ?? '-';
@endphp
| {{ $histories->firstItem() + $index }} |
{{ $changedAt }} |
{{ $effectiveMonth }} |
{{ $changeLabel }}
|
{{ $modeLabel }} |
{{ number_format($oldSalary, 2) }} BDT |
@if($mode === 'percent')
{{ number_format($changeValue, 2) }}%
@else
{{ number_format($changeValue, 2) }} BDT
@endif
|
{{ number_format($newSalary, 2) }} BDT |
{{ $difference >= 0 ? '+' : '-' }}{{ number_format(abs($difference), 2) }} BDT
|
{{ $note }} |
{{ $changedBy }} |
@empty
| No salary increase or decrease history found for this employee. |
@endforelse
@if($histories->hasPages())
{{ $histories->withQueryString()->links() }}
@endif