{{-- resources/views/reports/trial-balance.blade.php --}} @extends('layouts.app') @section('title','Trial Balance') @section('content')
@php $totDebit=0;$totCredit=0; @endphp @foreach($accounts as $a) @php $totDebit+=$a['debit'];$totCredit+=$a['credit']; @endphp @endforeach @if(abs($totDebit-$totCredit)>0.01) @else @endif
CodeAccount NameType DebitCredit
{{ $a['code'] }} {{ $a['name'] }} {{ ucfirst($a['type']) }} {{ $a['debit']>0?'৳'.number_format($a['debit'],2):'-' }} {{ $a['credit']>0?'৳'.number_format($a['credit'],2):'-' }}
TOTALS ৳{{ number_format($totDebit,2) }} ৳{{ number_format($totCredit,2) }}
⚠ Trial balance is out of balance by ৳{{ number_format(abs($totDebit-$totCredit),2) }}
✓ Trial balance is balanced
@endsection