@extends('layouts.admin') @section('title', 'Profit Report') @section('subtitle', 'Profit analysis') @section('actions')
to
@endsection @section('content')
{{-- Summary Cards --}}

Net Revenue

LKR {{ number_format($summary['total_revenue'], 0) }}

Net Cost

LKR {{ number_format($summary['total_cost'], 0) }}

Net Profit

LKR {{ number_format($summary['total_profit'], 0) }}

Margin

{{ number_format($summary['margin'], 1) }}%

Refund Rev

LKR {{ number_format($summary['refunds_revenue'] ?? 0, 0) }}

Refund Cost

LKR {{ number_format($summary['refunds_cost'] ?? 0, 0) }}

{{-- Profit Table --}}

Daily Profit Breakdown

@if($profitData->count() > 0)
@foreach($profitData as $day) @php $margin = $day->revenue > 0 ? ($day->profit / $day->revenue) * 100 : 0; @endphp @endforeach
Date Revenue Cost Profit Margin
{{ \Carbon\Carbon::parse($day->date)->format('D, M d, Y') }} LKR {{ number_format($day->revenue, 2) }} LKR {{ number_format($day->cost, 2) }} LKR {{ number_format($day->profit, 2) }} {{ number_format($margin, 1) }}%
@else

💰

No profit data for this period

@endif
@endsection