@extends('layouts.finance') @section('title', 'Charity Set-Aside') @section('subtitle', '2% voluntary contribution from monthly net profit') @section('content') @php $displayCurrency = 'PKR'; $fmt = fn($usd) => $metrics->moneyIn($usd, 'USD', $displayCurrency); $hasProfit = $profitUsd > 0; $palette = ['#ec4899','#10b981','#6366f1','#f59e0b','#06b6d4']; @endphp {{-- Back link --}}
Back to Dashboard
{{-- Status banner --}} @if($hasProfit)
Profitable this month
Set aside {{ number_format($charityRate * 100, 1) }}% of net profit for charitable giving.
@else
No profit this month
Charity set-aside is calculated on positive monthly net profit. Currently nothing to set aside.
@endif {{-- Hero KPIs --}}
Charity Due
{{ $fmt($charityDue) }}
{{ number_format($charityRate * 100, 1) }}% of monthly net profit
Net Profit (Mo.)
{{ $fmt($profitUsd) }}
Revenue − Expenses − COGS
Revenue (Mo.)
{{ $fmt($revenueUsd) }}
Current month
Expenses (Mo.)
{{ $fmt($expensesUsd) }}
All running costs
{{-- Charts + calculation --}}

Charity Trend

6 months
{{-- Calculation card --}}

Charity Calculation

Step by step
Monthly Revenue {{ $fmt($revenueUsd) }}
− Monthly Expenses -{{ $fmt($expensesUsd) }}
− COGS -{{ $fmt($cogsUsd) }}
Net Profit {{ $fmt($profitUsd) }}
× Charity rate {{ number_format($charityRate * 100, 1) }}%
Charity set-aside {{ $fmt($charityDue) }}
{{-- Monthly breakdown table --}}

Monthly Charity Breakdown (last 6 months)

@foreach($trend['labels'] as $i => $label) @php $rev = $trend['revenue'][$i] ?? 0; $exp = $trend['expenses'][$i] ?? 0; $prof = $profitTrend[$i] ?? 0; $char = $charityTrend[$i] ?? 0; @endphp @endforeach
Month Revenue (USD) Expenses (USD) Net Profit (USD) Charity 2% (USD) Charity 2% (PKR)
{{ $label }} {{ $metrics->money($rev) }} {{ $metrics->money($exp) }} {{ $metrics->money($prof) }} {{ $metrics->money($char) }} {{ $fmt($char) }}
6-month total {{ $metrics->money(array_sum($trend['revenue'])) }} {{ $metrics->money(array_sum($trend['expenses'])) }} {{ $metrics->money(array_sum($profitTrend)) }} {{ $metrics->money(array_sum($charityTrend)) }} {{ $fmt(array_sum($charityTrend)) }}
{{-- Notes --}}

Notes

@push('scripts') @endpush @endsection