@extends('hr.layouts.app') @section('title', 'Accountant Dashboard') @php use App\Models\Order; @endphp @section('content')

Accountant Dashboard

Comprehensive financial overview & reporting

Advanced Filters

Clear All

Financial Summary

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

Total Sales

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

Retail Profit

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

Total Commissions

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

Royalty (2%)

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

Dipo Commission (4%)

৳{{ number_format($totalCollectedPayments ?? 0, 2) }}

Total Collected Payments

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

Payouts Processed

Daily Sales (Last 30 Days)
Monthly Sales
Yearly Sales
Commission Distribution
Commission Trends
Top Performers (This Month)
User Activation Rate

Retail Profit Details

Total: ৳{{ number_format($retailProfit, 2) }}
@foreach($retailData as $row) @php $profitPercent = $row->cost_price > 0 ? (($row->profit / ($row->cost_price * $row->quantity)) * 100) : 0; @endphp @endforeach
Order ID Product Qty Cost Price Sale Price Profit Profit % Date
{{ $row->order_id }} {{ $row->product }} {{ $row->quantity }} ৳{{ number_format($row->cost_price, 2) }} ৳{{ number_format($row->sale_price, 2) }} ৳{{ number_format($row->profit, 2) }} {{ number_format($profitPercent, 1) }}% {{ $row->date }}
Total Retail Profit: ৳{{ number_format($retailProfit, 2) }}

Matching Bonus Details

@foreach($matchingBonus as $bonus) @php $user = App\Models\User::find($bonus->user_id); @endphp @endforeach
User Code User Name Amount PV Matched Left Leg PV Right Leg PV Date
{{ $user->user_code ?? 'N/A' }} {{ $user->name ?? 'N/A' }} ৳{{ number_format($bonus->amount, 2) }} {{ number_format($bonus->pv_matched, 2) }} PV {{ number_format($user->left_leg_pv ?? 0, 2) }} PV {{ number_format($user->right_leg_pv ?? 0, 2) }} PV {{ $bonus->calculation_date }}

Generation Bonus Details

@foreach($generationBonus as $bonus) @php $user = App\Models\User::find($bonus->user_id); $fromUser = $bonus->from_user_id ? App\Models\User::find($bonus->from_user_id) : null; @endphp @endforeach
User Code User Name Amount Generation Level From User Date
{{ $user->user_code ?? 'N/A' }} {{ $user->name ?? 'N/A' }} ৳{{ number_format($bonus->amount, 2) }} Generation {{ $bonus->generation_level }} {{ $fromUser->name ?? 'System' }} {{ $bonus->calculation_date }}

Diler Financial Reports

{{ $allDilers->count() }}

Total Dilers

{{ $allDilers->where('is_active', true)->count() }}

Active Dilers

{{ $allDilers->where('is_active', false)->count() }}

Inactive Dilers

{{ $allDistributors->count() }}

Total Distributors

@foreach($dilerFinancialReport as $index => $diler) @endforeach
# Diler Info Sales Commissions Payouts Wallet Team Status Actions
{{ $index + 1 }} {{ $diler['name'] }}
Code: {{ $diler['user_code'] }}
Phone: {{ $diler['phone'] }}
Joined: {{ $diler['join_date'] }}
৳{{ number_format($diler['total_sales'], 2) }}
Personal: ৳{{ number_format($diler['personal_sales'], 2) }}
Team: ৳{{ number_format($diler['team_sales'], 2) }}
PV: {{ number_format($diler['total_pv'], 2) }}
৳{{ number_format($diler['total_commissions'], 2) }}
Sponsor: ৳{{ number_format($diler['sponsor_bonus'], 2) }}
Retail Profit: ৳{{ number_format($diler['retail_profit'], 2) }}
Dipo Share: ৳{{ number_format($diler['dipo_commission_share'], 2) }}
৳{{ number_format($diler['total_payouts'], 2) }}
Pending: ৳{{ number_format($diler['pending_payouts'], 2) }}
Net: ৳{{ number_format($diler['total_earnings'] - $diler['total_payouts'], 2) }}
৳{{ number_format($diler['wallet_balance'], 2) }}
Total Earned: ৳{{ number_format($diler['total_earnings'], 2) }}
{{ $diler['distributors_count'] }} Distributors
Active: {{ $diler['active_distributors'] }}
@if($diler['is_active']) Active @else Inactive @endif

Distributor Financial Reports

{{ $allDistributors->count() }}

Total Distributors

{{ $allDistributors->where('is_active', true)->count() }}

Active

{{ $allDistributors->where('is_active', false)->count() }}

Inactive

৳{{ number_format($distributorFinancialReport->sum('total_sales'), 2) }}

Total Sales

৳{{ number_format($distributorFinancialReport->sum('total_commissions'), 2) }}

Total Commissions

৳{{ number_format($distributorFinancialReport->sum('wallet_balance'), 2) }}

Total Wallet Balance

@foreach($distributorFinancialReport as $index => $dist) @endforeach
# Distributor Info Sales & PV Commissions Breakdown Earnings & Payouts Network Binary Legs Status Actions
{{ $index + 1 }} {{ $dist['name'] }}
Code: {{ $dist['user_code'] }}
Sponsor: {{ $dist['sponsor_code'] }}
Rank: {{ $dist['rank'] }}
Joined: {{ $dist['join_date'] }}
৳{{ number_format($dist['total_sales'], 2) }}
Team: ৳{{ number_format($dist['team_sales'], 2) }}
Total PV: {{ number_format($dist['total_pv'], 2) }}
Personal PV: {{ number_format($dist['personal_pv'], 2) }}
৳{{ number_format($dist['total_commissions'], 2) }}
Sponsor: ৳{{ number_format($dist['sponsor_bonus'], 2) }}
Matching: ৳{{ number_format($dist['matching_bonus'], 2) }}
Generation: ৳{{ number_format($dist['generation_bonus'], 2) }}
PV Bonus: ৳{{ number_format($dist['pv_bonus'], 2) }}
Total: ৳{{ number_format($dist['total_earnings'], 2) }}
Retail: ৳{{ number_format($dist['retail_profit'], 2) }}
Payouts: ৳{{ number_format($dist['total_payouts'], 2) }}
Pending: ৳{{ number_format($dist['pending_payouts'], 2) }}
Wallet: ৳{{ number_format($dist['wallet_balance'], 2) }}
{{ $dist['downline_count'] }} Downline
Active: {{ $dist['active_downline'] }}
Team Comm: ৳{{ number_format($dist['team_commission'], 2) }}
Left: {{ number_format($dist['left_leg_pv'], 2) }} PV Right: {{ number_format($dist['right_leg_pv'], 2) }} PV
@php $totalLegs = $dist['left_leg_pv'] + $dist['right_leg_pv']; $leftPercent = $totalLegs > 0 ? ($dist['left_leg_pv'] / $totalLegs) * 100 : 0; $rightPercent = $totalLegs > 0 ? ($dist['right_leg_pv'] / $totalLegs) * 100 : 0; @endphp
@if($dist['is_active']) Active @else Inactive @endif

Payout Requests Management

@if($pendingPayouts->count() > 0)
You have {{ $pendingPayouts->count() }} pending payout requests totaling ৳{{ number_format($pendingPayouts->sum('amount'), 2) }}
@endif
@foreach($pendingPayouts as $payout) @php $user = $payout->user; $walletBalance = $user->wallet ? $user->wallet->balance : 0; @endphp @endforeach
# User Details Amount Payment Method Wallet Balance Request Date Status Actions
{{ $loop->iteration }} {{ $user->name }}
Code: {{ $user->user_code }}
Role: {{ ucfirst($user->role) }}
৳{{ number_format($payout->amount, 2) }} {{ ucfirst($payout->payment_method) }} ৳{{ number_format($walletBalance, 2) }} @if($walletBalance < $payout->amount)
Insufficient balance! @endif
{{ $payout->request_date->format('Y-m-d H:i') }} Pending
@csrf

Credit Wallet

@csrf
Quick Info
  • Total Users: {{ $allUsers->count() }}
  • Total Wallet Balance: ৳{{ number_format($allUsers->sum(function($user) { return $user->wallet ? $user->wallet->balance : 0; }), 2) }}
  • Pending Payouts: ৳{{ number_format($pendingPayouts->sum('amount'), 2) }}
  • Today's Sales: ৳{{ number_format(Order::whereDate('created_at', today())->where('status', 'completed')->sum('total_amount'), 2) }}
  • This Month: ৳{{ number_format(Order::whereMonth('created_at', now()->month)->where('status', 'completed')->sum('total_amount'), 2) }}

Collect Payment

@if(session('success'))
{{ session('success') }} @if(session('receipt_number'))
Receipt Number: {{ session('receipt_number') }} View Receipt @endif
@endif
@csrf
Search by Order ID
Today's Collections
@php $todayCollections = \App\Models\PaymentReceipt::whereDate('created_at', today())->sum('amount'); $monthCollections = \App\Models\PaymentReceipt::whereMonth('created_at', now()->month)->sum('amount'); @endphp
  • Today: ৳{{ number_format($todayCollections, 2) }}
  • This Month: ৳{{ number_format($monthCollections, 2) }}
  • Total Users: {{ $allUsers->count() }}
  • Pending Payment Orders: {{ \App\Models\Order::where('status', 'pending_payment')->count() }}
@if(class_exists('App\Models\PaymentReceipt')) View All Receipts @endif

Payment Collection History

৳{{ number_format($totalCollectedPayments ?? 0, 2) }}

Total Collected Payments

৳{{ number_format($todayCollections ?? 0, 2) }}

Today's Collections

৳{{ number_format($monthCollections ?? 0, 2) }}

This Month's Collections

{{ $totalReceiptsCount ?? 0 }}

Total Receipts
@if($paymentReceipts->isNotEmpty()) @foreach($paymentReceipts as $receipt) @endforeach @else @endif
# Receipt No. User Info Amount Method Purpose Transaction ID Received By Date & Time Actions
{{ $loop->iteration + ($paymentReceipts->currentPage() - 1) * $paymentReceipts->perPage() }} {{ $receipt->receipt_number ?? 'N/A' }} {{ $receipt->user?->name ?? 'Deleted/User Not Found' }}
Code: {{ $receipt->user?->user_code ?? 'N/A' }}
৳{{ number_format($receipt->amount ?? 0, 2) }} {{ $receipt->payment_method ?? '-' }} {{ str_replace('_', ' ', $receipt->purpose ?? '-') }} {{ $receipt->transaction_id ?: '-' }} {{ $receipt->receiver?->name ?? ($receipt->received_by ? 'Admin ID: ' . $receipt->received_by : 'System') }} {{ $receipt->created_at?->format('d M Y') }}
{{ $receipt->created_at?->format('h:i A') }}
@if($receipt->id) @else No Action @endif

No collection records found.
If you expect data, check your database or filters.
Grand Total: ৳{{ number_format($totalCollectedPayments ?? 0, 2) }}
{{ $paymentReceipts->links('vendor.pagination.bootstrap-5') }}

Export Data

Export to Excel

Export all financial data to Excel format

Generate PDF Report

Create detailed PDF report

Print Report

Print the current dashboard view

Custom Export Options
@endsection