@extends('layouts.app') @section('title', 'Ledger: '.$customer->name) @section('breadcrumb') @endsection @section('content')
৳{{ number_format($ledger->sum('debit'), 2) }}
Total Debit
৳{{ number_format($ledger->sum('credit'), 2) }}
Total Credit
৳{{ number_format($customer->current_due, 2) }}
Current Due
Transaction Ledger
{{-- Opening Balance Row --}} @forelse($ledger as $row) @empty @endforelse
Date Type Reference Description Debit (৳) Credit (৳) Balance (৳)
Opening Balance ৳{{ number_format($customer->opening_balance, 2) }} ৳{{ number_format($customer->opening_balance, 2) }}
{{ \Carbon\Carbon::parse($row['date'])->format('d M Y') }} {{ ucfirst($row['type']) }} @if($row['link']) {{ $row['reference'] }} @else {{ $row['reference'] }} @endif {{ $row['description'] }} @if($row['debit'] > 0) ৳{{ number_format($row['debit'], 2) }} @else — @endif @if($row['credit'] > 0) ৳{{ number_format($row['credit'], 2) }} @else — @endif ৳{{ number_format($row['balance'], 2) }}
No transactions yet
Closing Balance: ৳{{ number_format($ledger->sum('debit'), 2) }} ৳{{ number_format($ledger->sum('credit'), 2) }} ৳{{ number_format($customer->current_due, 2) }}
@endsection