@extends('layouts.master') @section('content')

Bank Opening Report

Export PDF Export Excel
Bank: {{ $bank->Account_Title }}

Opening Balance: {{ number_format(session('openingbalance'), 0) }}

@php $balance = $bank->openingbalance ?? 0; @endphp @php $balance = $openingbalance ?? 0; // ensure openingbalance is set properly @endphp @foreach($data as $entry) @php $debit = ''; $credit = ''; if ($entry->entryType == 'D') { $debit = $entry->Amount; $balance += $entry->Amount; } elseif ($entry->entryType == 'C') { $credit = $entry->Amount; $balance -= $entry->Amount; } @endphp @endforeach
Date Narration Debit Credit Cl.Balane
{{ $entry->VoucherDate }} {{ $entry->Entry_Narration }} {{ $debit ? number_format($debit, 0) : '' }} {{ $credit ? number_format($credit, 0) : '' }} {{ number_format($balance, 0) }}
@endsection