@extends('layouts.app') @section('title','Profit Report')@section('page-title','Profit & Margin Report') @section('content')
{{ \Carbon\Carbon::parse($from)->format('M j, Y') }} — {{ \Carbon\Carbon::parse($to)->format('M j, Y') }}{{ $selectedBranch ? ' · '.$selectedBranch->name : (auth()->user()->isAdmin()?' · All Branches':'') }}
| Product | Category | Qty | Revenue (USD) | COGS | Gross Profit | Margin |
|---|---|---|---|---|---|---|
| {{ $row['product'] }} | {{ $row['category'] }} | {{ number_format($row['qty']) }} | ${{ number_format($row['revenue'],2) }} | ${{ number_format($row['cost'],2) }} | {{ $row['profit']>=0?'+':'' }}${{ number_format($row['profit'],2) }} | {{ number_format($row['margin'],1) }}% |
No sales in this period. | ||||||
| TOTALS | {{ number_format($profitData->sum('qty')) }} | ${{ number_format($summary['total_revenue'],2) }} | ${{ number_format($summary['total_cost'],2) }} | ${{ number_format($summary['gross_profit'],2) }} | {{ number_format($summary['avg_margin'],1) }}% | |