@if($index == 0)
| {{ $indexCounter }} |
{{ $salaryDeduction->employee->emp_id }} - {{ $salaryDeduction->employee->emp_name_english }} |
{{ $salaryDeduction->employee->organization->branch->name ?? ''}} |
@endif
{{ date('M Y',strtotime($salaryDeduction->effect_month_date)) ?? ''}} |
{{ number_format($salaryDeduction->total_amount,2) ?? ''}} |
@php
$openingBalance = $salaryDeduction->total_amount - $salaryDeduction->salaryDeductionReceives->filter(function($item) use($data) {
if($item->salary_target_month_date < $data['startDate']){
return true;
}
return false;
})->sum('installment_amount');
$totalOpenningBalance += $openingBalance;
@endphp
{{ number_format($openingBalance,'2') }}
|
@php
$currentBalance = $salaryDeduction->salaryDeductionReceives->filter(function($item) use($data) {
if($item->salary_target_month_date >= $data['startDate'] && $item->salary_target_month_date <= $data['endDate']){
return true;
}
return false;
})->sum('installment_amount');
$totalCurrentBalance += $currentBalance;
@endphp
{{ number_format($currentBalance, 2) }}
|
@php
$subTotalClosingBalance = $openingBalance - $currentBalance;
$totalClosingBalance += $subTotalClosingBalance;
@endphp
{{ number_format($subTotalClosingBalance, 2) }}
|
@endforeach
@endforeach