@extends('layouts.app') @section('title', 'Profit by Product') @section('breadcrumb')
{{ $from->format('d M Y') }} — {{ $to->format('d M Y') }}
| # | Product | Qty Sold | Revenue | COGS | Profit | Margin | Bar |
|---|---|---|---|---|---|---|---|
| {{ ($items->currentPage()-1)*$items->perPage()+$i+1 }} |
{{ $item->productVariant?->product?->name ?? '—' }}
{{ $item->productVariant?->variant_name }}
|
{{ number_format($item->total_qty) }} | ৳{{ number_format($item->revenue,0) }} | ৳{{ number_format($item->cogs,0) }} | ৳{{ number_format($item->profit,0) }} | @php $margin = $item->revenue > 0 ? ($item->profit/$item->revenue)*100 : 0; @endphp {{ number_format($margin,1) }}% | @php $barW = $maxProfit > 0 ? min(100, ($item->profit/$maxProfit)*100) : 0; @endphp |
| Totals: | ৳{{ number_format($summary->revenue,0) }} | ৳{{ number_format($summary->cogs,0) }} | ৳{{ number_format($summary->profit,0) }} | ||||