@php $si=0; $Closing=0;@endphp @foreach($LedgerPostings as $LedgerPosting) {{++$si}} {{\App\Models\AccountLedger::find($LedgerPosting->ledger_id)->title}} {{\App\Models\AccountLedger::find($LedgerPosting->ledger_id)->openingbalance}} {{$LedgerPosting->DEBIT}} {{$LedgerPosting->CREDIT}} @php $Closing= $LedgerPosting->DEBIT-$LedgerPosting->CREDIT; @endphp @if ($Closing<0) {{$Final=$Closing*-1}}CR @else {{$Closing}}DR @endif @endforeach