Profitability Analysis by Customer
@if($selectedPeriod)
Total Revenue
{{ number_format($totalRevenue, 2) }}
From {{ $customers->count() }} customers
Total Cost
{{ number_format($totalCost, 2) }}
Including direct and indirect costs
Total Profit
{{ number_format($totalProfit, 2) }}
Profit Margin: {{ number_format($profitMargin, 2) }}%
Customer Performance
@foreach($customerPerformance as $customer) @endforeach
Customer Revenue Direct Cost Indirect Cost Total Cost Profit Profit Margin Trend
{{ $customer->name }} {{ number_format($customer->revenue, 2) }} {{ number_format($customer->direct_cost, 2) }} {{ number_format($customer->indirect_cost, 2) }} {{ number_format($customer->total_cost, 2) }} {{ number_format($customer->profit, 2) }} {{ number_format($customer->profit_margin, 2) }}% @if($customer->trend > 0) ↑ {{ number_format($customer->trend, 2) }}% @elseif($customer->trend < 0) ↓ {{ number_format(abs($customer->trend), 2) }}% @else → 0% @endif
Customer Transactions
@foreach($customerTransactions as $transaction) @endforeach
Date Customer Type Reference Description Amount Status
{{ $transaction->date->format('Y-m-d') }} {{ $transaction->customer->name }} {{ ucfirst($transaction->type) }} {{ $transaction->reference }} {{ $transaction->description }} {{ number_format($transaction->amount, 2) }} {{ ucfirst($transaction->status) }}
Top Customers by Revenue
@foreach($topCustomersByRevenue as $customer)
{{ $customer->name }} {{ number_format($customer->revenue, 2) }}
@endforeach
Top Customers by Profit
@foreach($topCustomersByProfit as $customer)
{{ $customer->name }} {{ number_format($customer->profit, 2) }}
@endforeach
@endif