@php $total_employee = count($salary_info); $i = 1; $grand_total_gross = 0; $grand_total_basic = 0; $total_leave_amount = 0; $grand_net_payable = 0; $grand_total_salary = 0; $grand_advance_total = 0; $grand_bank_total = 0; $total_add_deduct_amount = 0; $grand_total_deduction = 0; $grand_total_ot_amount = 0; $grand_total_earned_salary = 0; $grand_total_ot_day_amount = 0; $grand_loan_total = 0; $grand_total_present_amount = 0; $grand_total_absent_amount = 0; $grand_total_missing_salary = 0; $total_salary_to_pay = 0; $grand_total_other_allowance_amount = 0; $grand_total_late_amount = 0; $grand_total_early_amount = 0; $grand_rocket_paid = 0; $grand_cash_total = 0; $total_per_year_gross = 0; $total_per_day_gross = 0; $salary_allowance = []; $salary_other_allowance = []; @endphp @foreach (collect($salary_info)->chunk($report_format->per_page_employee) as $chunked_salary) @php $total_employee -= count($chunked_salary); @endphp

{{ $report_format->is_show_store_name == 1 ? store_info()->name_eng : null }}

@if (!empty($emp_department)) {{ $emp_department->name }} @endif
{{ __('obs.salary_sheet_for_the_month_of') }} @if (!empty($end_date)) {{ date('F\'Y', strtotime($end_date)) }} @endif
{{-- cl-table --}} @php $total_col_span = '35'; if (!empty($all_other_allowance)) { $total_col_span += count($all_other_allowance); } @endphp @if($report_format->card_no==1) @endif @if($report_format->emp_no==1) @endif @if($report_format->department==1) @endif @if($report_format->joining_date==1) @endif @if($report_format->gross == 1) @endif @if($report_format->basic==1) @endif {{-- Gross Allowance --}} @if($report_format->gross_allowance==1) @foreach ($allowances as $allowance) @endforeach @endif @if($report_format->per_day_gross==1) @endif @if($report_format->ot_hour ==1) @endif @if($report_format->earned_salary==1) @endif @foreach($other_deduct_allowances as $data) @endforeach {{-- @dd($salary_info)--}} @if(!empty($salary_info)) @php $k = 0; $other_allowance_count = 0; $allowance_amount = 0; //Page Total $page_total_basic = 0; $page_total_gross = 0; $page_total_ot_amount = 0; $page_total_ot_day_amount = 0; $page_total_absent_amount = 0; $page_total_present_amount = 0; $page_total_leave_amount = 0; $page_total_late_early_amount = 0; $page_total_salary = 0; $page_total_loan_amount = 0; $page_total_advance_amount = 0; $page_total_bank_amount = 0; $page_total_net_payable = 0; @endphp @foreach($chunked_salary as $val) @php $gross_salary = 0;$basic_salary = 0; $ot_hour = 0;$ot_day = 0; $per_day_salary = 0;$per_hour_salary = 0; $ot_hour_amount = 0;$ot_day_amount = 0; $total_joining_absent = 0;$total_resign_absent=0;$total_absent = 0;$total_present = 0; $ot_hour_salary = 0;$ot_day_salary = 0; $joining_deduction = 0;$resign_deduction=0; $absent_amount = 0;$present_amount = 0;$late_amount = 0; $early_amount = 0; $leave_amount = 0;$add_allowance = 0; $advance_amount=0; $deduct_allowance = 0; $other_allowance_amount = 0; $total_other_allowance_amount = 0; @endphp @if($report_format->card_no==1) @endif @if($report_format->emp_no==1) @endif @if($report_format->department==1) @endif @if($report_format->joining_date==1) @endif @php $total_per_year_gross += $val['per_year_gross']; @endphp @if($report_format->gross==1) @endif @php $gross_salary = $val['gross']; $page_total_gross += $gross_salary; $grand_total_gross += $gross_salary; @endphp @if($report_format->basic==1) @endif @php $basic_salary = $val['basic']; $page_total_basic += $basic_salary; $grand_total_basic += $basic_salary; @endphp {{-- Gross Allowance --}} @php $total_allowance_amount = 0; @endphp @foreach($allowances as $allowance) @php $k++; $allowance_amount = calculate_allowance($allowance,$val['schedule_id'],$val['allowance'],$total_absent,$val['present'],$val['total_night_shift']); $salary_allowance[$k][$allowance->id] = $allowance_amount; $total_allowance_amount += $allowance_amount; @endphp @if($report_format->gross_allowance==1) @endif @endforeach @if($report_format->per_day_gross==1) @php $total_per_day_gross += $val['per_day_gross']; @endphp @endif @php $total_ot_hour_amount = $val['ot_hour_amount']; $page_total_ot_amount += $total_ot_hour_amount; $grand_total_ot_amount += $total_ot_hour_amount; @endphp @if($report_format->ot_hour ==1) @endif @php $total_ot_day_amount = $val['total_ot_day_amount'] ; $page_total_ot_day_amount += $total_ot_day_amount; $grand_total_ot_day_amount += $total_ot_day_amount; @endphp @if($report_format->earned_salary==1) @php $earned_salary = $val['salary_to_pay'] + $total_ot_hour_amount; $grand_total_earned_salary += $earned_salary; @endphp @endif @php $absent = $val['absent']; @endphp @php $total_present = $val['present']; @endphp @php $present_amount = $val['present_amount']; $page_total_present_amount += $present_amount; $grand_total_present_amount += $present_amount; @endphp {{-- Loan --}} @foreach($loan_info as $loan_val) @endforeach {{-- Advance --}} @if($report_format->advance == 1) @foreach($advance_info as $advance) @endforeach @endif @if(!empty($other_deduct_allowances)) @foreach($other_deduct_allowances as $data) @php $other_allowance_count++; $other_allowance_amount = calculate_other_allowance($data,$val['schedule_id'],$val['other_allowance'],$total_absent,$val['present'],$val['leave'],$val['total_night_shift']); @endphp @php $salary_other_allowance[$data->id][] = $other_allowance_amount; @endphp @endforeach @endif {{-- Add/Deduct --}} @php $total_deduction = ($late_amount + $absent_amount + $early_amount + $leave_amount + $advance_amount + $loan_amount + abs($total_other_allowance_amount) + abs($add_deduct_amount)); $grand_total_deduction += $total_deduction; @endphp @endforeach {{-- Page Total Start--}} {{-- @include('payroll.salary.salary_page_total') --}} {{-- Page Total End--}} @endif {{-- Grand Total Salary Start--}} @if($total_employee == 0 ) @php $total_salary_allowance = collect($salary_allowance); $total_other_allowance = collect($salary_other_allowance); @endphp @include('payroll.salary.report_layouts.grand_total_layout4') @endif {{-- Grand Total Salary End--}}
{{__('obs.sl')}}{{__('obs.card')}}{{__('obs.employee')}} {{__('obs.id')}}{{__('obs.name')}} {{__('obs.designation')}}{{__('obs.department')}}{{__('obs.joining')}}{{__('obs.per')}} {{__('obs.year')}} {{__('obs.salary')}}{{__('obs.gross_salary')}}{{__('obs.basic')}}{{$allowance->name}}{{__('obs.per')}} {{__('obs.day')}} {{__('obs.salary')}}{{__('obs.missing')}} {{__('obs.days')}} {{__('obs.missing')}} {{__('obs.salary')}} {{__('obs.pay')}} {{__('obs.to')}} {{__('obs.salary')}}{{__('obs.ot')}}{{__('obs.total')}} {{__('obs.earnings')}} {{__('obs.late')}} {{__('obs.absent')}} {{__('obs.loan')}} {{__('obs.advance')}}{{$data->name}}{{__('obs.other')}} {{__('obs.deduction')}} {{__('obs.total')}} {{__('obs.deduction')}} {{__('obs.net')}} {{__('obs.payable')}} {{__('obs.signature')}}
{{ $i++ }}{{$val['emp_card']}}{{$val['code']}}{{ $val['name'] }} {{$val['designation']}}{{$val['department_name']}}{{$val['joining_date']}}{{number_format($val['per_year_gross'])}} {{number_format($val['gross'])}} {{number_format($val['basic'])}} {{number_format($allowance_amount)}} {{number_format($val['per_day_gross'])}} @php $total_missing_days = $val['missing_days']; @endphp {{$total_missing_days}} @php $missing_salary = $val['missing_salary']; $grand_total_missing_salary += $missing_salary; @endphp {{number_format($missing_salary)}} @php $total_salary_to_pay += $val['salary_to_pay']; @endphp {{number_format($val['salary_to_pay'])}} {{number_format($total_ot_hour_amount)}} {{$earned_salary}} @php $late_amount = $val['late_amount']; $early_amount = $val['early_leave_amount']; $page_total_late_early_amount += $late_amount ; $grand_total_late_amount += $late_amount; $grand_total_early_amount += $late_amount; @endphp {{number_format($late_amount)}} @php $absent_amount = $val['absent_amount']; $page_total_absent_amount += $absent_amount; $grand_total_absent_amount += $absent_amount; @endphp {{number_format( $absent_amount)}} @php $loan_info = $val['loan_amount']; $loan_amount = array_sum(array_column($loan_info, 'amount')); $page_total_loan_amount += $loan_amount; $grand_loan_total += $loan_amount; @endphp {{number_format($loan_amount)}} @php $advance_info = $val['advance_amount']; $advance_amount = array_sum(array_column($advance_info, 'amount')); $page_total_advance_amount += $advance_amount; $grand_advance_total += $advance_amount; @endphp {{number_format($advance_amount)}} @php $total_other_allowance_amount += $other_allowance_amount; @endphp {{abs($other_allowance_amount)}} @php $add_deduct_amount=$val['add_deduct_amount']; $total_add_deduct_amount += $add_deduct_amount; @endphp {{number_format(abs($add_deduct_amount))}} {{number_format($total_deduction)}} @php $net_payable = $earned_salary - $total_deduction; $page_total_net_payable += $net_payable; $grand_net_payable += $net_payable; @endphp {{number_format($net_payable)}}  
@include('payroll.signature')
@endforeach