@extends('admin.master') @section('title', 'Customer Ledger Statement') @section('content')
Back
Ledger: {{ $customer->name }}

Customer Details

Name: {{ $customer->name }}

Mobile: {{ $customer->mobile }}

Address: {{ $customer->address ?? 'N/A' }}

Statement Summary

Total Due: {{ number_format( ($opening_balance + $ledger->sum('debit')) - $ledger->sum('credit') , 2) }}

{{-- ওপেনিং ব্যালেন্স লাইন --}} @php $running_balance = $opening_balance; @endphp @foreach($ledger as $item) @php // ব্যালেন্স হিসেব করা হচ্ছে $running_balance += $item->debit; $running_balance -= $item->credit; @endphp @endforeach
Date Description Bill Amount (Debit) Paid Amount (Credit) Balance
- Opening Balance / Previous Due {{ number_format($opening_balance, 2) }} 0.00 {{ number_format($opening_balance, 2) }}
{{ $item->date ? date('d-M-Y', strtotime($item->date)) : '-' }} {{ $item->description }} {{ $item->debit > 0 ? number_format($item->debit, 2) : '-' }} {{ $item->credit > 0 ? number_format($item->credit, 2) : '-' }} {{ number_format($running_balance, 2) }}
@endsection