@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
Click any card to open its detail page
Day-wise movement: profit adds, expenses subtract, investment stays fixed