@extends('admin.layout.master') @section('content')

{{__('obs.loan_report')}}

@if(count($loans) >0)
@include('payroll.includes.printAndExcel')
@endif
@if(count($loans) >0) @php $total_employee = count($loans); $grand_total_net_payable = 0; $i=1; @endphp
@foreach (collect($loans)->chunk(25) as $chunk_data) @php $total_employee -=count($chunk_data); @endphp

{{__('obs.loan_report')}} ({{carbon()->create(request()->get('date'))->format('F-Y')}})

{{$department ? $department->name : null}}

@php $grand_total_balance = 0; $grand_total_deduction_amount = 0; @endphp @foreach ($chunk_data as $data) {{-- @dd($data) --}} @php $grand_total_balance += $data['balance']; $grand_total_deduction_amount += $data['deduction_amount']; @endphp @endforeach @if($total_employee == 0) @endif
{{__('obs.sl')}} {{__('obs.code')}} {{__('obs.name')}} {{__('obs.designation')}} {{__('obs.balance')}} {{__('obs.deduction_amount')}}
{{$i++}} {{$data['employee_info']->emp_code}} {{$data['employee_info']->emp_name}} {{$data['employee_info']->fetch_designation->name}} {{number_format($data['balance']) }} {{number_format($data['deduction_amount']) }}
{{__('obs.grand_total')}} {{number_format($grand_total_balance) }} {{number_format($grand_total_deduction_amount) }}
@endforeach
@else @if(request()->get('search') !=null)

{{__('obs.no_data_found')}}

@endif @endif @include('payroll.hrm_script') @endsection