@extends('layouts.finance') @section('title', 'Business Total Detail') @section('subtitle', 'Verification breakdown before net worth') @section('content') @php $currency = $verification['currency'] ?? 'PKR'; $settings = $metrics->settings(); $lockedInvestment = (float) ($settings['business_investment'] ?? 40063400.59); $businessTotal = (float) ($verification['business_total'] ?? 0); $businessGross = (float) ($verification['business_total_before_liabilities'] ?? $businessTotal); $investmentTrend = $metrics->businessInvestmentTrend(14, $businessTotal); $latestPosition = $businessTotal; $latestDailyNet = (float) (collect($investmentTrend['daily_net'] ?? [])->last() ?? 0); $profitLoss = $latestPosition - $lockedInvestment; $profitLossPercent = $lockedInvestment > 0 ? ($profitLoss / $lockedInvestment) * 100 : 0; $profitColor = $profitLoss >= 0 ? '#10b981' : '#ef4444'; $profitLabel = $profitLoss >= 0 ? 'Profit' : 'Loss'; $profitDirection = $profitLoss >= 0 ? 'above investment' : 'below investment'; $componentCards = [ ['label' => 'Bank Balance', 'amount' => $verification['bank_balance'] ?? 0, 'route' => route('dashboard.cards.bank'), 'type' => 'Asset', 'color' => '#7c3aed', 'icon' => 'bank'], ['label' => 'Inventory Amount', 'amount' => $verification['inventory_amount'] ?? 0, 'route' => route('dashboard.cards.inventory'), 'type' => 'Asset', 'color' => '#06b6d4', 'icon' => 'box'], ['label' => 'Lent Amount', 'amount' => $verification['lent_amount'] ?? 0, 'route' => route('dashboard.cards.collectible'), 'type' => 'Receivable', 'color' => '#0d9488', 'icon' => 'file'], ['label' => 'In Transit Amount', 'amount' => $verification['transit_amount'] ?? 0, 'route' => route('dashboard.cards.transit'), 'type' => 'Asset', 'color' => '#d97706', 'icon' => 'clock'], ['label' => 'KuickPay Today Net', 'amount' => $verification['kuickpay_today_net'] ?? 0, 'route' => route('dashboard.cards.kuickpay', ['mode' => 'date', 'from' => now()->toDateString(), 'to' => now()->toDateString()]), 'type' => 'Collection', 'color' => '#10b981', 'icon' => 'card'], ['label' => 'KuickPay Pending Balance', 'amount' => $verification['kuickpay_pending_balance'] ?? 0, 'route' => route('dashboard.cards.kuickpay-pending'), 'type' => 'Collection', 'color' => '#e11d48', 'icon' => 'clock'], ['label' => 'Credit Card Debt', 'amount' => $verification['credit_card_debt'] ?? 0, 'route' => route('dashboard.cards.debt'), 'type' => 'Liability', 'color' => '#ef4444', 'icon' => 'card', 'negative' => true], ['label' => 'Loans & Debts', 'amount' => $verification['loan_debt'] ?? 0, 'route' => route('dashboard.cards.debt'), 'type' => 'Liability', 'color' => '#dc2626', 'icon' => 'debt', 'negative' => true], ['label' => 'Store Credit', 'amount' => $verification['store_credit_amount'] ?? 0, 'route' => route('dashboard.cards.store-credit'), 'type' => 'Shown separately', 'color' => '#db2777', 'icon' => 'wallet', 'muted' => true], ]; @endphp
Back to Dashboard
Total Amount in Business
{{ $metrics->money($businessTotal, $currency) }}
Before liabilities {{ $metrics->money($businessGross, $currency) }}
Liabilities deducted ยท store credit excluded
Total Investment
{{ $metrics->money($lockedInvestment, $currency) }}
Fixed baseline
{{ $profitLabel }}
{{ $profitLoss < 0 ? '-' : '' }}{{ $metrics->money(abs($profitLoss), $currency) }}
{{ number_format(abs($profitLossPercent), 2) }}% {{ $profitDirection }}
Total Liabilities
{{ $metrics->money($verification['liabilities_total'] ?? 0, $currency) }}
Credit cards + loans

Business Components

Click any card to open its detail page

{{ $currency }}
@foreach($componentCards as $card) @php $isNegative = (bool) ($card['negative'] ?? false); $isMuted = (bool) ($card['muted'] ?? false); $amountColor = $isNegative ? '#ef4444' : ($isMuted ? 'var(--muted)' : ($card['color'] ?? 'var(--text)')); $signedPrefix = $isNegative ? '-' : ''; $iconColor = $card['color'] ?? '#6366f1'; @endphp
@if($card['icon'] === 'bank') @elseif($card['icon'] === 'box') @elseif($card['icon'] === 'file') @elseif($card['icon'] === 'clock') @elseif($card['icon'] === 'wallet') @elseif($card['icon'] === 'debt') @else @endif
{{ $card['label'] }}
{{ $signedPrefix }}{{ $metrics->money($card['amount'], $currency) }}
{{ $card['type'] }}
@endforeach

Investment Position

Day-wise movement: profit adds, expenses subtract, investment stays fixed

{{ $profitLabel }}
Total Investment
{{ $metrics->money($lockedInvestment, $currency) }}
Current Business Total
{{ $metrics->money($latestPosition, $currency) }}
{{ $profitLabel }} vs Investment
{{ $profitLoss < 0 ? '-' : '' }}{{ $metrics->money(abs($profitLoss), $currency) }}
{{ number_format(abs($profitLossPercent), 2) }}% {{ $profitDirection }}
Today Net Movement
{{ $latestDailyNet < 0 ? '-' : '' }}{{ $metrics->money(abs($latestDailyNet), $currency) }}
Profit minus expenses
@push('scripts') @endpush @endsection