@extends('admin.layout.master') @section('title','TRAIL BALANCE STATEMENT') @section('custom_style') @endsection @section ('content')
@include('admin.layout.title_header', ['title'=>'TRAIL BALANCE STATEMENT (DETAILS)'])
@include('accounts.reports.search_form',['ledger'=>0])
{{-- @if(Request()->ledger_id) --}}
@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?date('d-M-Y',strtotime(Request()->end_date)):date('d-M-Y'); $routeName=Route::currentRouteName(); $printData=getPrintData($routeName,$printData); @endphp {!!$printData['head']!!}
@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 ($ledgers 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']); } //$b_cr_amount=($ledgerWiseBeginningBalanced[$ledger->id]['amount']<0)?abs($ledgerWiseBeginningBalanced[$ledger->id]['amount']):0; } 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; @endphp @endif @empty @endforelse
Perticulars Balance Before
{{ date('d-m-y',strtotime(Request()->start_date))}}
Transaction
{{ date('d-m-y',strtotime(Request()->start_date)).' To '.date('d-m-y',strtotime(Request()->end_date))}}
Balance
{{ 'AT '.date('d-m-y',strtotime(Request()->end_date))}}
SL Account No Account Name Debit Credit Debit Credit Debit Credit
{{ $k++ }} {{$ledger->auto_code}} {{$name}} {{ number_format($b_dr_amount??0,2) }} {{ number_format($b_cr_amount??0,2) }} {{ 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) }}
Total Transaction {{ 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) }}
{{-- --}}
{{-- --}}
{{-- @endif --}}
@endsection @section('script') @stop