@extends('layouts.app') @section('title', 'User Report') @push('styles') @endpush @section('content') @can('view_user_report') @php $currency = config('settings.currency_symbol', '$'); @endphp
View system users, roles, and activity metrics
{{ $selectedUser->email ?? '' }} {{ $selectedUser->phone ? '| ' . $selectedUser->phone : '' }}
{{ $userSales->count() }}
Sales
{{ $userPurchases->count() }}
Purchases
{{ $userExpenses->count() }}
Expenses
{{ $userProjectTransactions->count() }}
Project Txns
| Invoice | Customer | Branch | Amount | Paid | Status | Date |
|---|---|---|---|---|---|---|
| {{ $sale->invoice_no }} | {{ $sale->customer->name ?? 'Walk-in' }} | {{ $sale->branch->name ?? 'N/A' }} | {{ $currency }} {{ number_format($sale->total_amount, 2) }} | {{ $currency }} {{ number_format($sale->paid_amount, 2) }} | @php $statusClass = $sale->payment_status == 'paid' ? 'emerald' : ($sale->payment_status == 'partial' ? 'amber' : 'red'); @endphp {{ ucfirst($sale->payment_status) }} | {{ $sale->created_at->format('M d, Y') }} |
| Total | {{ $currency }} {{ number_format($userSales->sum('total_amount'), 2) }} | {{ $currency }} {{ number_format($userSales->sum('paid_amount'), 2) }} | ||||
| Purchase No | Supplier | Branch | Amount | Paid | Date |
|---|---|---|---|---|---|
| {{ $purchase->purchase_no }} | {{ $purchase->supplier->name ?? 'N/A' }} | {{ $purchase->branch->name ?? 'N/A' }} | {{ $currency }} {{ number_format($purchase->total_amount, 2) }} | {{ $currency }} {{ number_format($purchase->paid_amount, 2) }} | {{ $purchase->created_at->format('M d, Y') }} |
| Total | {{ $currency }} {{ number_format($userPurchases->sum('total_amount'), 2) }} | {{ $currency }} {{ number_format($userPurchases->sum('paid_amount'), 2) }} | |||
| Title | Category | Branch | Amount | Status | Date |
|---|---|---|---|---|---|
| {{ $expense->title }} | {{ $expense->category->name ?? 'N/A' }} | {{ $expense->branch->name ?? 'N/A' }} | {{ $currency }} {{ number_format($expense->amount, 2) }} | @php $cls = $expense->status == 'approved' ? 'emerald' : ($expense->status == 'pending' ? 'amber' : 'red'); @endphp {{ ucfirst($expense->status) }} | {{ $expense->expense_date->format('M d, Y') }} |
| Total | {{ $currency }} {{ number_format($userExpenses->sum('amount'), 2) }} | ||||
| Project | Type | Description | Amount | Date |
|---|---|---|---|---|
| {{ $txn->project->name ?? 'N/A' }} | {{ ucfirst($txn->type) }} | {{ $txn->description ?? '-' }} | {{ $currency }} {{ number_format($txn->amount, 2) }} | {{ $txn->date->format('M d, Y') }} |
| Income Total | {{ $currency }} {{ number_format($incomeTotal, 2) }} | |||
| Expense Total | {{ $currency }} {{ number_format($expenseTotal, 2) }} | |||
Total Users
{{ $totalUsers }}
Active
{{ $activeUsers }}
Inactive
{{ $inactiveUsers }}
Roles
{{ $roles->count() }}
| User | Email / Phone | Role | Status | Sales | Purchases | Expenses | Created |
|---|---|---|---|---|---|---|---|
|
{{ strtoupper(substr($user->name, 0, 1)) }}
{{ $user->name }} |
{{ $user->email ?? '-' }}
{{ $user->phone ?? '' }}
|
{{ $user->role->label ?? $user->role->name ?? 'N/A' }} | @if($user->is_active) Active @else Inactive @endif | {{ $user->sales_count }} | {{ $user->purchases_count }} | {{ $user->expenses_count }} | {{ $user->created_at->format('M d, Y') }} |
|
No users found Try adjusting your filters |
|||||||