@php $printData['start_date']=Request()->start_date?date('d-M-Y',strtotime(Request()->start_date)):date('d-M-Y'); $printData['ledger_name']=$searchedLedger?$searchedLedger->name:''; $printData['end_date']=Request()->end_date?date('d-M-Y',strtotime(Request()->end_date)):date('d-M-Y'); $routeName=str_replace('_api','',Route::currentRouteName()); $printData=getPrintData($routeName,[]); @endphp {!!$printData['head']!!}
@php $lk=1; $grand_total_b_dr_amount=0; $grand_total_b_cr_amount=0; $grand_total_dr_amount=0; $grand_total_cr_amount=0; $grand_total_e_dr_amount=0; $grand_total_e_cr_amount=0; @endphp @forelse ($searchedLedger->child as $childledger) @php $total_b_dr_amount=0; $total_b_cr_amount=0; $total_dr_amount=0; $total_cr_amount=0; $total_e_dr_amount=0; $total_e_cr_amount=0; @endphp @php $pattern = "/".$childledger->auto_code."/i"; $searchedLedgers=collect($searchedLedgersChild)->filter(function ($item) use ($pattern) { return preg_match($pattern, $item->auto_code); }); @endphp @forelse ($searchedLedgers as $k=>$ledger) @if(array_key_exists($ledger->id,$ledgerWiseBeginningBalanced) || array_key_exists($ledger->id,$ledgerWiseBalance) || array_key_exists($ledger->id,$ledgerWiseEndingBalance)) @php $b_dr_amount=0; $b_cr_amount=0; $dr_amount=0; $cr_amount=0; $e_dr_amount=0; $e_cr_amount=0; if(array_key_exists($ledger->id,$ledgerWiseBeginningBalanced)){ $name=$ledgerWiseBeginningBalanced[$ledger->id]['name']; if($ledgerWiseBeginningBalanced[$ledger->id]['amount']>0){ $b_dr_amount=$ledgerWiseBeginningBalanced[$ledger->id]['amount']; }else{ $b_cr_amount=abs($ledgerWiseBeginningBalanced[$ledger->id]['amount']); } } if(array_key_exists($ledger->id,$ledgerWiseBalance)){ $name=$ledgerWiseBalance[$ledger->id]['name']; if($ledgerWiseBalance[$ledger->id]['amount']>0){ $dr_amount=$ledgerWiseBalance[$ledger->id]['amount']; }else{ $cr_amount=abs($ledgerWiseBalance[$ledger->id]['amount']); } } if(array_key_exists($ledger->id,$ledgerWiseEndingBalance)){ $name=$ledgerWiseEndingBalance[$ledger->id]['name']; if($ledgerWiseEndingBalance[$ledger->id]['amount']>0){ $e_dr_amount=$ledgerWiseEndingBalance[$ledger->id]['amount']; }else{ $e_cr_amount=abs($ledgerWiseEndingBalance[$ledger->id]['amount']); } } $total_b_dr_amount+=$b_dr_amount; $total_b_cr_amount+=$b_cr_amount; $total_dr_amount+=$dr_amount; $total_cr_amount+=$cr_amount; $total_e_dr_amount+=$e_dr_amount; $total_e_cr_amount+=$e_cr_amount; $grand_total_b_dr_amount+=$b_dr_amount; $grand_total_b_cr_amount+=$b_cr_amount; $grand_total_dr_amount+=$dr_amount; $grand_total_cr_amount+=$cr_amount; $grand_total_e_dr_amount+=$e_dr_amount; $grand_total_e_cr_amount+=$e_cr_amount; @endphp @endif @empty @endforelse @empty @endforelse
{{__('obs.particulars')}} {{__('obs.opening')}} {{__('obs.balance')}}
{{ date('d-m-y',strtotime(Request()->start_date))}}
{{__('obs.transaction')}}
{{ date('d-m-y',strtotime(Request()->start_date)).' To '.date('d-m-y',strtotime(Request()->end_date))}}
{{__('obs.balance')}}
{{ 'AT '.date('d-m-y',strtotime(Request()->end_date))}}
{{__('obs.sl')}} {{__('obs.accounts')}} {{__('obs.no')}} {{__('obs.accounts')}} {{__('obs.name')}} {{__('obs.debit')}} {{__('obs.credit')}} {{__('obs.debit')}} {{__('obs.credit')}} {{__('obs.debit')}} {{__('obs.credit')}}
{{$lk++}} {{$childledger->auto_code}} {{$childledger->name}} {{ number_format($total_b_dr_amount??0,2) }} {{ number_format($total_b_cr_amount??0,2) }} {{ number_format($total_dr_amount??0,2) }} {{ number_format($total_cr_amount??0,2) }} {{ number_format($total_e_dr_amount??0,2) }} {{ number_format($total_e_cr_amount??0,2) }}
{{__('obs.total')}} {{__('obs.transaction')}} {{ number_format($grand_total_b_dr_amount??0,2) }} {{ number_format($grand_total_b_cr_amount??0,2) }} {{ number_format($grand_total_dr_amount??0,2) }} {{ number_format($grand_total_cr_amount??0,2) }} {{ number_format($grand_total_e_dr_amount??0,2) }} {{ number_format($grand_total_e_cr_amount??0,2) }}