Ledger Details: {{ $partner->full_name }}

Total Allocated

KWD {{ number_format($totalAllocated, 2) }}

Total Withdrawn (Debit)

KWD {{ number_format($totalWithdrawn, 2) }}

Withdrawal Transaction Details

@php $runningBalance = $openingBalance ?? 0; $counter = 1; @endphp @forelse($withdrawals as $withdrawal) @php // Subtract withdrawal amount from running balance $runningBalance = $runningBalance - $withdrawal->amount; @endphp @empty @endforelse
# Date Payment Method Amount (Withdrawal)
{{ $counter++ }} {{ date('d-m-Y', strtotime($withdrawal->withdrawal_date)) }} @if($withdrawal->payment_method == 'Cash') Cash @elseif($withdrawal->payment_method == 'Bank Transfer') Bank Transfer @elseif($withdrawal->payment_method == 'Cheque') Cheque @else {{ $withdrawal->payment_method }} @endif KWD {{ number_format($withdrawal->amount, 2) }}
No withdrawals found for the selected period.
@php $runningBalance = 0; $counter = 1; @endphp @forelse($transactions as $transaction) @php // Calculate running balance properly if ($loop->first) { // For first transaction, opening balance is running_balance - (credit - debit) $openingBalance = $transaction->running_balance - ($transaction->credit_amount - $transaction->debit_amount); $runningBalance = $openingBalance; } // Add current transaction effect $runningBalance = $runningBalance + $transaction->credit_amount - $transaction->debit_amount; @endphp @empty @endforelse

Transaction Summary

Total Transactions

{{ $transactions->count() }}

Withdrawals

{{ $transactions->where('transaction_type', 'Withdrawal')->count() }}