{!! trans('messages.user').' '.trans('messages.salary').' '.trans('messages.detail') !!} |
{!! trans('messages.salary').' '.trans('messages.head') !!} |
{!! trans('messages.amount') !!} |
{!! trans('messages.salary').' '.trans('messages.head') !!} |
{!! trans('messages.amount') !!} |
@foreach($earning_salary_heads->whereNotIn('slug',['rest_day_overtime_x20','public_holiday_overtime_x20'])->chunk(2) as $earning_salary_head)
@foreach($earning_salary_head as $salary_head)
@if($user_salary->type != 'daily' && $salary_head->slug != 'basic_pay_daily')
@if(env('COMPANY_ID') == 79 && $salary_head->slug == 'overtime')
{!! trans('messages.overtime').' '.trans('messages.per_hour') !!} |
@elseif(env('COMPANY_ID') == 79 && $salary_head->slug == 'public_holiday_allowance')
Public Holiday Extra Per Day |
@else
{!! $salary_head->name !!} |
@endif
@if ($salary_head->slug == 'overtime')
{!! currency($user_salary->overtimeHourlyRate,1,$user_salary->currency_id) !!} |
@elseif ($salary_head->slug == 'rest_day_work')
{!! currency($user_salary->restDayRate,1,$user_salary->currency_id) !!} |
@elseif ($salary_head->slug == 'public_holiday_allowance')
{!! currency($user_salary->publicDayRate,1,$user_salary->currency_id) !!} |
@elseif ($salary_head->slug == 'leave_pay')
{!! currency($user_salary->leaveDayRate,1,$user_salary->currency_id) !!} |
@else
{{-- {!! currency($user_salary->UserSalaryDetail->where('slug',$salary_head->slug)->first()->amount,1,$user_salary->currency_id) !!} | --}}
{!! currency(isset($user_salary->UserSalaryDetail->where('slug',$salary_head->slug)->first()->amount) ? $user_salary->UserSalaryDetail->where('slug',$salary_head->slug)->first()->amount : 0,1,$user_salary->currency_id) !!} | {{-- If the salary head has no amount, put it as 0 --}}
@endif
@elseif($user_salary->type == 'daily' && $salary_head->slug == 'basic_salary_daily')
{!! $salary_head->name !!} |
{!! currency(isset($user_salary->UserSalaryDetail->where('slug',$salary_head->slug)->first()->amount) ? $user_salary->UserSalaryDetail->where('slug',$salary_head->slug)->first()->amount : 0,1,$user_salary->currency_id) !!} |
@endif
@endforeach
@endforeach
|
{!! trans('messages.earning').' '.trans('messages.salary') !!} |
{!! trans('messages.amount') !!} |
@foreach($earning_salary_heads as $earning_salary_head)
@if (!in_array($earning_salary_head->slug,['rest_day_overtime_x20','public_holiday_overtime_x20']) && isset($payroll_details[$earning_salary_head->slug]))
@if ($earning_salary_head->slug == 'basic_salary')
{{-- @if(env('COMPANY_ID') != 172 && env('COMPANY_ID') != 101 && env('COMPANY_ID') != 205 && env('COMPANY_ID') != 123)
{!! $earning_salary_head->name.' (Days: '.($attendance['P'] + $attendance['H'] + $attendance['HB']).')' !!} |
@else --}}
{!! $earning_salary_head->name.' (Days: '.((isset($payroll_detail_quantities[$earning_salary_head->slug])) ? round($payroll_detail_quantities[$earning_salary_head->slug],2) : 0).')' !!}
@if(env('COMPANY_ID') != 77)
{!! 'Days Present (Days: '.((isset($attendance)) ? $attendance['P'] + $attendance['H'] : 0).')' !!}
@endif
{!! 'Leaves (Days: '.((isset($payroll_detail_quantities['leave_pay'])) ? round($payroll_detail_quantities['leave_pay'],2) : 0).')' !!}
@foreach($leave_heads as $leave_head)
{!! $leave_head->name.' (Days: '.round($leave_payroll_detail_quantities[$leave_head->name],2).')' !!}
@endforeach
@if(env('COMPANY_ID') != 77)
{!! 'Public Holidays (Days: '.((isset($attendance)) ? $attendance['HB'] : 0).')' !!}
@endif
|
{{-- @endif --}}
{!! array_key_exists($earning_salary_head->slug, $payroll_details) ? currency($payroll_details[$earning_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@elseif ($earning_salary_head->slug == 'basic_salary_fixed')
{!! $earning_salary_head->name !!}
{!! 'Leaves (Days: '.((isset($payroll_detail_quantities['leave_pay'])) ? round($payroll_detail_quantities['leave_pay'],2) : 0).')' !!}
@foreach($leave_heads as $leave_head)
{!! $leave_head->name.' (Days: '.round($leave_payroll_detail_quantities[$leave_head->name],2).')' !!}
@endforeach
@if(env('COMPANY_ID') != 77)
{!! 'Public Holidays (Days: '.((isset($attendance)) ? $attendance['H'] + $attendance['HB'] : 0).')' !!}
@endif
|
{!! array_key_exists($earning_salary_head->slug, $payroll_details) ? currency($payroll_details[$earning_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@elseif ($earning_salary_head->slug == 'overtime')
@if(env('COMPANY_ID') == 79)
@if(Carbon::parse($payroll->actual_work_from_date) != Carbon::parse($payroll->actual_work_from_date)->firstOfMonth() || Carbon::parse($payroll->actual_work_to_date) != Carbon::parse($payroll->actual_work_to_date)->firstOfMonth())
{!! $earning_salary_head->name.' ('.$payroll->actual_work_from_date.' to '.$payroll->actual_work_to_date.') ('.((isset($payroll_detail_quantities[$earning_salary_head->slug])) ? round($payroll_detail_quantities[$earning_salary_head->slug],2) : 0).'hrs)' !!} |
@else
{!! $earning_salary_head->name.' ('.((isset($payroll_detail_quantities[$earning_salary_head->slug])) ? round($payroll_detail_quantities[$earning_salary_head->slug],2) : 0).'hrs)' !!} |
@endif
@else
{!! $earning_salary_head->name.' ('.currency($user_salary->hourlyRate,1,$payroll->currency_id).' x 1.5 x '.((isset($payroll_detail_quantities[$earning_salary_head->slug])) ? round($payroll_detail_quantities[$earning_salary_head->slug],2) : 0).'hrs)' !!} |
@endif
{{-- @endif --}}
{!! array_key_exists($earning_salary_head->slug, $payroll_details) ? currency($payroll_details[$earning_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@elseif ($earning_salary_head->slug == 'public_holiday_allowance')
{{-- @if(env('COMPANY_ID') != 172 && env('COMPANY_ID') != 101 && env('COMPANY_ID') != 205 && env('COMPANY_ID') != 123)
{!! $earning_salary_head->name.' (Days: '.((env('COMPANY_ID') == 123) ? $attendance['H'] + $attendance['HB'] : $attendance['H']).')' !!} |
@else --}}
{!! $earning_salary_head->name.' (Days: '.((isset($payroll_detail_quantities[$earning_salary_head->slug])) ? round($payroll_detail_quantities[$earning_salary_head->slug],2) : 0).')' !!} |
{{-- @endif --}}
{!! array_key_exists($earning_salary_head->slug, $payroll_details) ? currency($payroll_details[$earning_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@elseif ($earning_salary_head->slug == 'leave_pay')
{{--
{!! $earning_salary_head->name.' (Days: '.((isset($payroll_detail_quantities[$earning_salary_head->slug])) ? round($payroll_detail_quantities[$earning_salary_head->slug]) : 0).')' !!} |
{!! array_key_exists($earning_salary_head->slug, $payroll_details) ? currency($payroll_details[$earning_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@foreach($leave_heads as $leave_head)
{!! $leave_head->name.' (Days: '.round($leave_payroll_detail_quantities[$leave_head->name]).')' !!} |
{!! array_key_exists($leave_head->name, $leave_payroll_details) ? currency($leave_payroll_details[$leave_head->name],1,$payroll->currency_id) : 0 !!} |
@endforeach
--}}
@else
{!! $earning_salary_head->name !!} |
@if(array_key_exists($earning_salary_head->slug, $payroll_details))
@if($payroll_details[$earning_salary_head->slug] >= 0)
{!! currency($payroll_details[$earning_salary_head->slug],1,$payroll->currency_id) !!} |
@else
{!! '('.currency(($payroll_details[$earning_salary_head->slug] * (-1)),1,$payroll->currency_id).')' !!} |
@endif
@else
0 |
@endif
@endif
@endif
@if($earning_salary_head->slug != 'leave_pay')
@endif
@endforeach
{{-- To show custom salary heads --}}
@if ($custom_earning_heads != null)
{!! trans('messages.custom').' '.trans('messages.earning').' '.trans('messages.head') !!} |
|
@foreach($custom_earning_heads as $custom_earning_head)
{!! $custom_earning_head->name !!} |
{!! array_key_exists($custom_earning_head->id, $earning_custom_payroll_details) ? currency($earning_custom_payroll_details[$custom_earning_head->id][$custom_earning_head->name],1,$payroll->currency_id) : 0 !!} |
@endforeach
@endif
|
{!! trans('messages.deduction').' '.trans('messages.salary') !!} |
{!! trans('messages.amount') !!} |
@foreach($deduction_salary_heads as $deduction_salary_head)
@if(isset($payroll_details[$deduction_salary_head->slug]))
@if($deduction_salary_head->slug == 'shg_fund_donation' || $deduction_salary_head->slug == 'employee_cpf' || $deduction_salary_head->slug == 'mbmf')
@if($user->Profile->nationality != "Foreigner")
@if ($deduction_salary_head->slug == 'shg_fund_donation')
{!! $deduction_salary_head->name.' ('.$user->Profile->shg_fund.')' !!} |
{!! array_key_exists($deduction_salary_head->slug, $payroll_details) ? currency($payroll_details[$deduction_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@else
@if($deduction_salary_head->slug != 'mbmf' || ($deduction_salary_head->slug == 'mbmf' && isset($payroll_details[$deduction_salary_head->slug]) && $payroll_details[$deduction_salary_head->slug] > 0))
{!! $deduction_salary_head->name !!} |
{!! array_key_exists($deduction_salary_head->slug, $payroll_details) ? currency($payroll_details[$deduction_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@endif
@endif
@endif
@else
@if($deduction_salary_head->slug == 'advance_payment')
{!! $deduction_salary_head->name !!} |
{!! array_key_exists($deduction_salary_head->slug, $payroll_details) ? currency($payroll_details[$deduction_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@if(isset($advance_payments))
@foreach($advance_payments as $advance_payment)
{!! trans('messages.advance').' '.trans('messages.payment').' ('.$advance_payment['date'].')' !!} |
{!! currency($advance_payment['amount'],1,$payroll->currency_id)!!} |
@endforeach
@endif
@else
{{-- @if(env('COMPANY_ID') != 172 && env('COMPANY_ID') != 101 && env('COMPANY_ID') != 205 && env('COMPANY_ID') != 123)
{!! ($deduction_salary_head->slug == 'incomplete_month_of_work' && env('COMPANY_ID') != 123) ? ((isset($attendance)) ? $deduction_salary_head->name.' (Days: '.$incomplete_days_amount.')' : $deduction_salary_head->name.' (Days: 0)') : $deduction_salary_head->name !!} |
@else --}}
{!! ($deduction_salary_head->slug == 'incomplete_month_of_work' && env('COMPANY_ID') != 123) ? ((isset($attendance)) ? $deduction_salary_head->name.' (Days: '.((isset($payroll_detail_quantities[$deduction_salary_head->slug])) ? round($payroll_detail_quantities[$deduction_salary_head->slug],2) : 0).')' : $deduction_salary_head->name.' (Days: 0)') : $deduction_salary_head->name !!}
@if(($user_salary->type == 'fixed' || $user_salary->type == 'monthly') && isset($unpaid_leave_used_this_month) && $unpaid_leave_used_this_month > 0 && $deduction_salary_head->slug == 'incomplete_month_of_work')
{!! 'Unpaid Leaves (Days: '.round($unpaid_leave_used_this_month).')' !!}
{!! 'Others (Days: '.round((isset($payroll_detail_quantities[$deduction_salary_head->slug]) && $payroll_detail_quantities[$deduction_salary_head->slug] - $unpaid_leave_used_this_month > 0) ? $payroll_detail_quantities[$deduction_salary_head->slug] - $unpaid_leave_used_this_month : 0).')' !!}
@endif
|
{{-- @endif --}}
{!! array_key_exists($deduction_salary_head->slug, $payroll_details) ? currency($payroll_details[$deduction_salary_head->slug],1,$payroll->currency_id) : 0 !!} |
@endif
@endif
@endif
@endforeach
{{-- To show custom salary heads --}}
@if ($custom_deduction_heads != null)
{!! trans('messages.custom').' '.trans('messages.deduction').' '.trans('messages.head') !!} |
|
@foreach($custom_deduction_heads as $custom_deduction_head)
{!! $custom_deduction_head->name !!} |
{!! array_key_exists($custom_deduction_head->id, $deduction_custom_payroll_details) ? currency($deduction_custom_payroll_details[$custom_deduction_head->id][$custom_deduction_head->name],1,$payroll->currency_id) : 0 !!} |
@endforeach
@endif
|
@if(env('COMPANY_ID') == 888 || env('COMPANY_ID') == 101 || $user->Profile->nationality == 'Foreigner')
{!! trans('messages.total').' '.trans('messages.earning') !!} |
{!! currency($total_earning,1,$payroll->currency_id) !!} |
@else
{!! trans('messages.total').' '.trans('messages.earning').' ('.trans('messages.cpf').' '.trans('messages.payable').' '.trans('messages.amount').')' !!} |
{!! currency($total_earning,1,$payroll->currency_id).' ('.currency(($ordinary_cpf_amount + $additional_cpf_amount),1,$payroll->currency_id).')' !!} |
@endif
|
{!! trans('messages.total').' '.trans('messages.deduction') !!} |
{!! currency($total_deduction,1,$payroll->currency_id) !!} |
|