@php $total_employee = count($salary_info); $i = 1; $conveyance_amount = 0; $total_conveyance_amount = 0; $total_income_tax = 0; $income_tax_amount = 0; $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_suspense_total = 0; $grand_bank_total = 0; $total_add_deduct_amount = 0; $total_deduction_amount = 0; $grand_total_ot_amount = 0; $grand_total_ot_day_amount = 0; $grand_loan_total = 0; $grand_total_present_amount = 0; $grand_total_absent_amount = 0; $grand_total_other_allowance_amount = 0; $grand_total_late_early_amount = 0; $grand_rocket_paid = 0; $grand_cash_total = 0; $salary_allowance = []; $salary_other_allowance = []; @endphp @foreach (collect($salary_info)->chunk($salary_report_design->per_page_employee) as $chunked_salary) @php $total_employee -= count($chunked_salary); @endphp

{{ $salary_report_design->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
@php $total_col_span = '35'; if (!empty($all_other_allowance)) { $total_col_span += count($all_other_allowance); } @endphp @if($salary_report_design->card_no==1) @endif @if($salary_report_design->emp_no==1) @endif @if($salary_report_design->joining_date==1) @endif {{-- Allowance --}} @if (!empty($allowances)) @foreach($allowances as $allowance) {{-- --}} @endforeach @endif @if($salary_report_design->ot_hour ==1) @endif @foreach($all_other_allowance as $data) @endforeach {{-- conveyance --}} {{-- --}} {{-- --}} @if($salary_report_design->mobile_no == 1) @endif @if($salary_report_design->payment_mode == 1) @endif @if($salary_report_design->ot_hour ==1) @endif {{-- Late --}} {{-- Absent --}} {{-- Leave --}} @foreach($all_leave_type as $leave_type_val) @endforeach @if($salary_report_design->loan_balance == 1) @endif @if($salary_report_design->advance == 1) @endif @if($salary_report_design->suspense == 1) @endif {{-- @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_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_suspense_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 Variable Initialize $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; $ot_hour_salary = 0;$ot_day_salary = 0; $joining_deduction = 0;$resign_deduction=0; $absent_amount = 0;$late_amount = 0;$leave_amount = 0;$add_allowance = 0; $advance_amount=0; $suspense_amount=0; $deduct_allowance = 0; $other_allowance_amount = 0; $total_other_allowance_amount = 0; @endphp @if($salary_report_design->card_no==1) @endif @if($salary_report_design->emp_no==1) @endif @if($salary_report_design->joining_date==1) @endif {{-- --}} {{-- Allowance --}} @if(!empty($allowances)) @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 {{-- --}} @endforeach @php $gross_salary = round($val['basic'] + $total_allowance_amount); $page_total_gross += $gross_salary; $grand_total_gross += $gross_salary; @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($salary_report_design->ot_hour ==1) @endif @foreach($all_leave_type as $leave_type_val) @php $total_leave = 0;$leave_val = 0 @endphp @endforeach @if(!empty($all_other_allowance)) @foreach($all_other_allowance 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 {{-- conveyance --}} {{-- --}} {{-- Tax --}} {{-- --}} @if($salary_report_design->loan_balance == 1) @endif @foreach($loan_info as $loan_val) @endforeach {{-- DN/PN --}} {{-- Suspense/Advance --}} @if($salary_report_design->advance == 1) @foreach($advance_info as $advance) @endforeach @endif @if($salary_report_design->suspense == 1) @foreach($suspense_info as $suspense) @endforeach @endif {{-- Suspense/Advance --}} {{----}} @if($salary_report_design->mobile_no == 1) @endif @if($salary_report_design->payment_mode == 1) @endif @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_layout3') @endif {{-- Grand Total Salary End--}}
#SLCardCodeName DesignationJoiningBasic{{$allowance->name}}Gross SalaryOT HourOT Day late|Early Absent Leave{{$data->name}}Total SalaryConv.TaxLoan Adjustment Net PayableMobile NoBank CashRocketSignature
Hour TkDay Adjst. TkDay TkDay Tk{{$leave_type_val->print_name ? $leave_type_val->print_name : $leave_type_val->name}}TkP.LoanAmount Add/Ded.Adva.Suspense
{{$i++}}{{$val['emp_card']}}{{$val['code']}} {{$val['name'] }} {{$val['designation']}}{{$val['joining_date']}}{{$val['station_vehicle_no']}}{{number_format($val['basic'])}} @php $basic_salary = $val['basic']; $page_total_basic += $basic_salary; $grand_total_basic += $basic_salary; $per_day_basic_salary = ($val['basic']) / 26; $per_hour_basic_salary = ($val['basic']) / 208; @endphp {{number_format($allowance_amount)}} {{number_format($gross_salary)}} @php $per_day_gross_salary = $gross_salary / 26; $per_hour_gross_salary = $gross_salary / 208; @endphp {{$val['total_ot_hour']}} {{number_format($total_ot_hour_amount)}} {{$val['total_ot_day']}} {{$val['total_ot_adjust']}} {{number_format($val['total_ot_day_amount'])}} @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 {{$val['late_count']}}|{{$val['early_leave_count']}} @php $late_amount = $val['late_amount']; $early_amount = $val['early_leave_amount']; $page_total_late_early_amount += $late_amount+$early_amount; $grand_total_late_early_amount += $late_amount+$early_amount; @endphp {{number_format($late_amount+$early_amount)}} @php $total_absent = $val['total_absent']; @endphp {{$total_absent}} @php $absent_amount = $val['total_absent_amount']; $page_total_absent_amount += $absent_amount; $grand_total_absent_amount += $absent_amount; @endphp {{number_format( $absent_amount)}} @if(array_key_exists($leave_type_val->id,$val['total_leave_info'])) {{$val['total_leave_info'][$leave_type_val->id]}} @else {{0}} @endif @php $leave_amount = 0;@endphp @foreach($all_leave_type as $leave_type_val) @if(!empty($val['total_leave_info']) && count($val['total_leave_info'])>0) @foreach($val['total_leave_info'] as $leave_key=>$leave_val) @if($leave_key==$leave_type_val['id']) @if($leave_type_val['pay_type']==2) @php $calculation_days = $leave_type_val->calculation_days ==1 ? get_date_difference($start_date,$end_date) : $leave_type_val->calculation_days; @endphp @if($leave_type_val['deduction_type']==1) @php $per_day_salary = ($gross_salary / $calculation_days); $leave_amount += round($per_day_salary * $leave_type_val['multiply_with'] * $leave_val); @endphp @else @php if($val['is_new_joining']==1){ $per_day_salary = ($gross_salary / $calculation_days); $leave_amount += round($per_day_salary * $leave_type_val['multiply_with'] * $leave_val); }else{ $per_day_salary = ($basic_salary / $calculation_days); $leave_amount += round($per_day_salary * $leave_type_val['multiply_with'] * $leave_val); } @endphp @endif @endif @endif @endforeach @endif @endforeach {{number_format($leave_amount)}} @php $page_total_leave_amount += $leave_amount; $total_leave_amount += $leave_amount; @endphp @php $total_other_allowance_amount += $other_allowance_amount; @endphp {{abs($other_allowance_amount)}} @php $total_salary = ($gross_salary + $total_ot_hour_amount + $total_ot_day_amount+ $add_allowance + $total_other_allowance_amount) - ($absent_amount + $late_amount + $leave_amount + $deduct_allowance); $page_total_salary += $total_salary; $grand_total_salary += $total_salary; @endphp {{number_format($total_salary)}} @php $conveyance_amount = intval($val['conveyance_amount']); $total_conveyance_amount += $conveyance_amount; @endphp {{ $conveyance_amount}} @php $income_tax_amount = intval($val['income_tax']); $total_income_tax += intval($income_tax_amount); @endphp {{$income_tax_amount}} {{number_format($val['loan_balance'])}} @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 $add_deduct_amount=$val['add_deduct_amount']; $total_add_deduct_amount += $add_deduct_amount; @endphp {{number_format(abs($add_deduct_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 $suspense_info = $val['suspense_amount']; $suspense_amount = array_sum(array_column($suspense_info, 'amount')); $page_total_suspense_amount += $suspense_amount; $grand_suspense_total += $suspense_amount; @endphp {{number_format($suspense_amount)}} 0 @php $net_payable = $total_salary + $conveyance_amount + $add_deduct_amount - ($loan_amount + $advance_amount + $suspense_amount + $income_tax_amount); $page_total_net_payable += $net_payable; $grand_net_payable += $net_payable; @endphp {{number_format($net_payable)}} @php $bank_amount = $val['bank_amount']; $page_total_bank_amount += $bank_amount; $grand_bank_total += $bank_amount; @endphp {{number_format($bank_amount)}} @php $cash = $net_payable - $bank_amount; $grand_cash_total += $cash > 0 ? $cash : 0; @endphp {{number_format($cash)}} {{$val['mobile_no']}} {{-- Rocket Paid --}} @if($val['payment_mode'] == 2) @php $grand_rocket_paid += $net_payable; @endphp {{number_format($net_payable)}} @endif  
@include('payroll.signature')
@endforeach