@extends('layouts.master') @section('title', 'General Ledger') @section('content')

General Ledger



{{-- @php $priority = ''; $priorityRow = 0; $mainSccName=""; @endphp --}} @foreach ($doubleEntryArray as $doubleEntry) {{-- @php dd($doubleEntry['arr']); @endphp @if ($priority == '' || $priority != $doubleEntry['arr'][0]->priority) @php $priority = $doubleEntry['arr'][0]->priority; $priorityRow = 1; if ($priorityRow == 1) { $priorityRow = 0; $mainAccName=$doubleEntry['arr'][0]->account_type; echo "

$mainAccName

"; } @endphp @endif --}}

{{ $doubleEntry['acc_code'] }}

{{ $doubleEntry['account_name'] }}


@php $count = 1; $debitTotal = 0; $creatidTotal = 0; $priority = ''; $priorityRow = 0; @endphp @foreach ($doubleEntry['arr'] as $value) @php $debitTotal += is_numeric($value->debit) && $value->debit != 0 ? $value->debit : 0; $creatidTotal += is_numeric($value->credit) && $value->credit != 0 ? $value->credit : 0; @endphp @endforeach
# Date Voucher No Description Debit Credit
Beginning Balance for period - -
{{ $count++ }} {{ $value->date }} {{ $value->voucher_no }} {{ $value->description }} {{ is_numeric($value->debit) && $value->debit != 0 ? number_format($value->debit, 2, '.', ',') : '' }} {{ is_numeric($value->credit) && $value->credit != 0 ? number_format($value->credit, 2, '.', ',') : '' }}
Total for Period {{ number_format($debitTotal, 2, '.', ',') }} {{ number_format($creatidTotal, 2, '.', ',') }}
Ending Balance for period {{ $debitTotal - $creatidTotal > 0 ? number_format($debitTotal - $creatidTotal, 2, '.', ',') : '' }} {{ $creatidTotal - $debitTotal > 0 ? number_format($creatidTotal - $debitTotal, 2, '.', ',') : ($creatidTotal - $debitTotal == 0 ?'0.00':'') }}


@endforeach
@endsection