@extends('admin.admin_dashboard') @section('admin')
{{-- Statistics Cards --}}

৳{{ number_format($totalRevenue, 0) }}

Total Revenue

৳{{ number_format($totalCost, 0) }}

Total Cost

৳{{ number_format($totalProfit, 0) }}

Total Profit

{{ number_format($avgMargin, 2) }}%

Avg Profit Margin

{{ $totalQuantity }}

Items Sold
{{-- Filters --}}

Filters

{{-- Profit Table --}}

Product-wise Profit Analysis

@forelse($productProfits as $item) @empty @endforelse @if($productProfits->count() > 0) @endif
# Product Name Category Qty Sold Revenue Cost Profit Margin %
{{ $loop->iteration }} {{ $item['product']->name }}
{{ $item['product']->code }}
{{ $item['product']->category->name ?? 'N/A' }} {{ $item['quantity'] }} ৳{{ number_format($item['revenue'], 2) }} ৳{{ number_format($item['cost'], 2) }} ৳{{ number_format($item['profit'], 2) }} {{ number_format($item['margin'], 2) }}%
No data found
Total: {{ $totalQuantity }} ৳{{ number_format($totalRevenue, 2) }} ৳{{ number_format($totalCost, 2) }} ৳{{ number_format($totalProfit, 2) }} {{ number_format($avgMargin, 2) }}%
@endsection @section('customjs') @endsection