@extends('admin.layout.master') @section('title','TRAIL BALANCE STATEMENT') @section('custom_style') @endsection @section ('content')
@include('admin.layout.title_header', ['title'=>'TRAIL BALANCE STATEMENT'])
@include('accounts.reports.search_form',['ledger'=>1]) {{--
Search
--}}
@if(Request()->ledger_id)
{{--

{{ 'From '.date('d-M-Y',strtotime(Request()->start_date)).' To '.date('d-M-Y',strtotime(Request()->end_date))}}
--}}
{{-- --}} {{-- --}} @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 @forelse ($searchedLedgersChild->groupBy('parent_id') as $parent_id=>$searchedLedgers) @php $lk=1; @endphp {{-- --}} @forelse ($searchedLedgers as $k=>$ledger) @if(array_key_exists($ledger->id,$ledgerWiseBeginningBalanced) || array_key_exists($ledger->id,$ledgerWiseBalance['dr']) || array_key_exists($ledger->id,$ledgerWiseBalance['cr']) || array_key_exists($ledger->id,$ledgerWiseEndingBalance)) @if($lk==1) @php $lk=0; @endphp @endif @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']); } //$b_cr_amount=($ledgerWiseBeginningBalanced[$ledger->id]['amount']<0)?abs($ledgerWiseBeginningBalanced[$ledger->id]['amount']):0; } if(array_key_exists($ledger->id,$ledgerWiseBalance['dr'])){ $name=$ledgerWiseBalance['dr'][$ledger->id]['name']; if($ledgerWiseBalance['dr'][$ledger->id]['amount']>0){ $dr_amount=$ledgerWiseBalance['dr'][$ledger->id]['amount']; } } if(array_key_exists($ledger->id,$ledgerWiseBalance['cr'])){ $name=$ledgerWiseBalance['cr'][$ledger->id]['name']; if($ledgerWiseBalance['cr'][$ledger->id]['amount']>0){ $cr_amount=($ledgerWiseBalance['cr'][$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; @endphp {{-- --}} {{-- --}} @endif @empty @endforelse @empty @endforelse {{-- --}} {{-- --}}
@php $printData['start_date']=Request()->start_date?date('d-M-Y',strtotime(Request()->start_date)):date('d-M-Y'); $printData['end_date']=(Request()->end_date && Request()->end_date!=null)?date('d-M-Y',strtotime(Request()->end_date)):date('d-M-Y'); // $printData['ledger_name']=count($ledgers->where('id',Request()->ledger_id))>0?$ledgers->where('id',Request()->ledger_id)->first()->name:'ledger not found'; $routeName=Route::currentRouteName(); $printData=getPrintData($routeName,$printData); @endphp {!!$printData['head']!!}
Perticulars Balance Before
{{ Request()->start_date?date('d-M-Y',strtotime(Request()->start_date)):date('d-M-Y') }}
Transaction
{{ (Request()->start_date?date('d-M-Y',strtotime(Request()->start_date)):date('d-M-Y')).' To '.(Request()->end_date?date('d-M-Y',strtotime(Request()->end_date)):date('d-M-Y')) }}
Balance
{{ 'AT '.(Request()->end_date?date('d-M-Y',strtotime(Request()->end_date)):date('d-M-Y'))}}
SL Account No Account NameDebit CreditDebit CreditDebit Credit
@if(count($ledgers->where('id', $parent_id))>0) {{$ledgers->where('id', $parent_id)->first()->name}} @else {{'ledger not found'}} @endif
@if(count($ledgers->where('id', $parent_id))>0) {{$ledgers->where('id', $parent_id)->first()->name}} @else {{'ledger not found'}} @endif
{{ ($k+1) }} {{$ledger->auto_code}} {{$name}} {{ number_format($b_dr_amount??0,2) }} {{ number_format($b_cr_amount??0,2) }}{{( number_format(abs($b_dr_amount-$b_cr_amount)??0,2).(($b_dr_amount-$b_cr_amount)>0?' (dr)':' (cr)') )}} {{ number_format($dr_amount??0,2) }} {{ number_format($cr_amount??0,2) }}{{ number_format($e_dr_amount??0,2) }} {{ number_format($e_cr_amount??0,2) }}{{ ( number_format(abs($e_dr_amount-$e_cr_amount)??0,2).(($e_dr_amount-$e_cr_amount)>0?' (dr)':' (cr)') ) }}
Total Transaction{{ number_format($total_b_dr_amount??0,2) }} {{ number_format($total_b_cr_amount??0,2) }}{{ ( number_format(abs($total_b_dr_amount-$total_b_cr_amount)??0,2).(($total_b_dr_amount-$total_b_cr_amount)>0?' (dr)':' (cr)') ) }} {{ 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) }}{{ ( number_format(abs($total_e_dr_amount-$total_e_cr_amount)??0,2).(($total_e_dr_amount-$total_e_cr_amount)>0?' (dr)':' (cr)') ) }}
{{-- --}}
{{-- --}}
@endif
@endsection @section('script') @stop