@extends('layouts.app') @section('title', 'Sales by Product') @include('inventory.accounting.partials.styles') @section('content')
{{ \Carbon\Carbon::parse($from)->format('M j') }} – {{ \Carbon\Carbon::parse($to)->format('M j, Y') }}
| # | Product | Qty Sold | Revenue | COGS | Profit | Margin | Share |
|---|---|---|---|---|---|---|---|
| {{ $i + 1 }} | {{ $row['product_name'] }} | {{ number_format($row['qty']) }} | {{ number_format($row['revenue'], 2) }} | {{ number_format($row['cogs'], 2) }} | {{ number_format($row['profit'], 2) }} | {{ $row['margin_pct'] }}% | {{ $totalRev > 0 ? round(($row['revenue'] / $totalRev) * 100, 1) : 0 }}% |
| No sales in this period. | |||||||
| Total | {{ number_format($totalRev, 2) }} | {{ number_format($totalCogs, 2) }} | {{ number_format($totalProfit, 2) }} | {{ $totalMargin }}% | |||
Profit columns only populate for products that have a Cost Price set. Add cost prices on your products to unlock per-product profitability tracking.
@endif