@extends('layout.main') @section('content')

Capital Records

Add New Capital Record

Capital Records List

@if($capitalRecords->count() > 0)
@php $totalInjections = $capitalRecords->where('type', 'capital_injection')->sum('amount'); $totalWithdrawals = $capitalRecords->where('type', 'withdrawal')->sum('amount'); $netCapital = $totalInjections - $totalWithdrawals; $totalRecords = $capitalRecords->count(); @endphp

Total Injections

{{ formatCurrencyDecimals($totalInjections) }}

Total Withdrawals

{{ formatCurrencyDecimals($totalWithdrawals) }}

Net Capital Change

{{ $netCapital >= 0 ? '+' : '' }}{{ formatCurrencyDecimals($netCapital) }}

Total Records

{{ $totalRecords }}

@endif
Date Type Amount ({{getCurrencyCode()}}) Description Created By Action @forelse ($capitalRecords as $capitalRecord) {{ $capitalRecord->date ? \Carbon\Carbon::parse($capitalRecord->date)->format('d/m/Y') : 'N/A' }} @php $typeColors = [ 'capital_injection' => 'bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100', 'withdrawal' => 'bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100', ]; $typeIcons = [ 'capital_injection' => 'fa-plus-circle', 'withdrawal' => 'fa-minus-circle', ]; $typeLabels = [ 'capital_injection' => 'Capital Injection', 'withdrawal' => 'Capital Withdrawal', ]; @endphp {{ $typeLabels[$capitalRecord->type] ?? ucfirst($capitalRecord->type) }} {{ $capitalRecord->type === 'capital_injection' ? '+' : '-' }}{{ formatAmount($capitalRecord->amount) }} @if($capitalRecord->description) {{ Str::limit($capitalRecord->description, 40) }} @else No description @endif @if($capitalRecord->createdBy) {{ $capitalRecord->createdBy->name }} @else System @endif @empty

No capital records found

Start by adding your first capital injection or withdrawal record.

Add First Record
@endforelse
@if($capitalRecords->count() > 0)

Recent Activity Summary

@php $latestInjection = $capitalRecords->where('type', 'capital_injection')->sortByDesc('date')->first(); $latestWithdrawal = $capitalRecords->where('type', 'withdrawal')->sortByDesc('date')->first(); @endphp
Latest Capital Injection
@if($latestInjection)

{{ formatCurrencyDecimals($latestInjection->amount) }} on {{ \Carbon\Carbon::parse($latestInjection->date)->format('M d, Y') }}

@if($latestInjection->description)

{{ $latestInjection->description }}

@endif @else

No injections recorded yet

@endif
Latest Capital Withdrawal
@if($latestWithdrawal)

{{ formatCurrencyDecimals($latestWithdrawal->amount) }} on {{ \Carbon\Carbon::parse($latestWithdrawal->date)->format('M d, Y') }}

@if($latestWithdrawal->description)

{{ $latestWithdrawal->description }}

@endif @else

No withdrawals recorded yet

@endif
@endif
@endsection