{{-- resources/views/dashboard/user.blade.php --}} @extends('layouts.app') @section('page-title', 'User Dashboard') @push('styles') @endpush @section('content')
{{-- Filter Section - Super Admin Only --}} @if(auth()->user()->isSuperAdmin())
Reset @if(request()->query('month')) 📊 {{ \Carbon\Carbon::createFromFormat('Y-m', request()->query('month'))->format('F Y') }} @else 📊 Current Month @endif
@endif {{-- Stats Cards --}}
Today's Income

৳{{ number_format($todayIncome, 2) }}

Today's Expense

৳{{ number_format($todayExpense, 2) }}

Monthly Income

৳{{ number_format($monthlyIncome, 2) }}

Monthly Expense

৳{{ number_format($monthlyExpense, 2) }}

{{-- Account Balances & Quick Actions --}}
{{-- Account Balances --}}
💰 Account Balances
Cash Balance
৳{{ number_format($cashBalance, 2) }}
@if($bankAccounts->count() > 0)
🏦 Bank Accounts
@foreach($bankAccounts as $account)
{{ $account->account_name }}
{{ $account->bank_name }}
৳{{ number_format($account->balance, 2) }}
@endforeach
@endif @if($digitalAccounts->count() > 0)
📱 Digital Payments
@foreach($digitalAccounts as $account)
{{ $account->provider }}
{{ $account->account_number }}
৳{{ number_format($account->balance, 2) }}
@endforeach
@endif
{{-- Quick Actions --}}
{{-- Sales dashboard mini summaries and tables --}}
💼 Sales Summary

Sales: ৳{{ number_format($totalSales,2) }}

Payment: ৳{{ number_format($totalPayment,2) }}

Due: ৳{{ number_format($totalDue,2) }}

💰 Cash Received By
@foreach($cashBy as $method => $amt) @endforeach
Method Amount
{{ $method ?: 'Other' }} ৳{{ number_format($amt,2) }}
Total ৳{{ number_format($cashBy->sum(),2) }}
📅 Day Wise Sales
@foreach($dayGroups as $day => $rows) @endforeach
Date Qty Sales COGS
{{ $day }} {{ $rows->sum('qty') }} ৳{{ number_format($rows->sum('sales'),2) }} ৳{{ number_format($rows->sum('cogs'),2) }}
{{-- Segment wise summary --}}
📊 Segment Wise Sale
@foreach($segmentGroups as $seg => $rows) @endforeach
Segment Qty Amount KPI Revenue Achiv (%)
{{ $seg }} {{ $rows->sum('qty') }} ৳{{ number_format($rows->sum('amount'),2) }} {{ number_format($rows->sum('kpi'),2) }} ৳{{ number_format($rows->sum('revenue'),2) }} {{ number_format($rows->avg('achiv'),2) }}%
{{-- Income vs Expense Chart --}}
📈 Income vs Expense @if(request()->query('month')) - {{ \Carbon\Carbon::createFromFormat('Y-m', request()->query('month'))->format('F Y') }} @else (Last 30 Days) @endif
{{-- Recent Transactions & Low Stock --}}
{{-- Recent Transactions --}}
📋 Recent Transactions
View All →
@forelse($recentTransactions as $transaction) @empty @endforelse
Date Voucher Details Type Method Amount
{{ $transaction->date->format('d M') }} {{ $transaction->voucher_no }} {{ Str::limit($transaction->details, 25) }} @if($transaction->type == 'income') Income @elseif($transaction->type == 'expense') Expense @else Transfer @endif @if($transaction->payment_method == 'cash') 💵 Cash @elseif($transaction->payment_method == 'bank') 🏦 {{ $transaction->bankAccount?->bank_name ?? 'Bank' }} @else 📱 {{ $transaction->digitalPayment?->provider ?? 'Digital' }} @endif {{ $transaction->type == 'income' ? '+' : '-' }}৳{{ number_format($transaction->amount, 2) }}

No transactions found

+ Add First Transaction
{{-- Low Stock Alert --}}
⚠️ Low Stock Alert
Manage →
@if($lowStockProducts->count() > 0)
@foreach($lowStockProducts as $product)
{{ $product->name }} Code: {{ $product->product_code }}
📦 {{ $product->current_stock }}
Min: {{ $product->minimum_stock }}
@endforeach
@else

All products stocked!

No low stock alerts
@endif
@endsection @push('scripts') @endpush