GENERAL LEDGERS

@foreach($accounts as $account) @if(sizeof($account->generalLedgers)>0)
{{$account->name}}
{{--*/ $dr_total = 0 /*--}} {{--*/ $cr_total = 0 /*--}} {{--*/ $balance = 0 /*--}} @foreach($account->generalLedgers()->orderBy('date','ASC')->orderBy('account_group','ASC')->get() as $index=>$general_ledger) @if($general_ledger->type=='DEBITED') @endif @if($general_ledger->type=='CREDITED') @endif @endforeach
Date Particulars L.F Debit Credit Balance
{{\Carbon\Carbon::parse($general_ledger->date)->toFormattedDateString()}} {{$general_ledger->document}} {{$general_ledger->amount}}-{{$general_ledger->currency_id}} -{{$account->currency_id}}-{{$general_ledger->exchange_rate}} @if($account->balance =='DEBITED') {{number_format(\App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate),2)}} {{--*/ $dr_total += \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} {{--*/ $balance -= \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} @else {{number_format(\App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate),2)}} {{--*/ $dr_total += \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} {{--*/ $balance += \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} @endif @if($account->balance =='DEBITED') {{number_format(\App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate),2)}} {{--*/ $cr_total += \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} {{--*/ $balance += \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} @else {{number_format(\App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate),2)}} {{--*/ $cr_total += \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} {{--*/ $balance -= \App\Logistics\Facades\Logistics::currencyConvertor($general_ledger->amount, $general_ledger->currency_id, $account->currency_id,$general_ledger->exchange_rate) /*--}} @endif {{number_format($balance,2)}} {{--*/ $balance /*--}}
@endif @endforeach