@extends('layouts.admin') @section('title', 'Profit split · Aromaniacs ERP') @section('overline', 'Equity') @section('heading', 'Partner profit allocation') @section('content')
Pool uses delivered + paid sales, net juice margin, and per-order box costs. Partner allocation follows time-weighted average employed capital for active partners in the selected range; if all are zero/non-positive, split is equal.

Orders

{{ $result['sales_snapshot']['order_count'] }}

Sold amount

৳ {{ number_format($result['sales_snapshot']['sold_amount'], 2) }}

Product revenue

৳ {{ number_format($result['sales_snapshot']['product_revenue'], 2) }}

Box costs

৳ {{ number_format($result['sales_snapshot']['box_costs'], 2) }}

Pool (net)

৳ {{ number_format($result['pool'], 2) }}

@if ($result['had_zero_capital_equal_split'])

Equal split mode: no partner had positive average employed capital — each active partner receives an equal share.

@endif

Preview

@csrf
@forelse ($result['lines'] as $line) @empty @endforelse
Partner Avg capital Weight Allocated
{{ $shareholderNames[$line['shareholder_id']] ?? 'Partner #'.$line['shareholder_id'] }} {{ number_format($line['avg_capital'], 4) }} {{ number_format($line['ratio'] * 100, 4) }}% ৳ {{ number_format($line['allocated'], 2) }}
No active partners. Add partners before allocating profit.

Method: {{ $methodLabel }} · Σ avg capital {{ number_format($result['total_avg_capital'], 4) }}

Saved reports

@if ($reports->isEmpty())

No snapshots yet.

@else
@foreach ($reports as $report)
{{ $report->period_start->format('d M Y') }} → {{ $report->period_end->format('d M Y') }} {{ $report->computed_at?->diffForHumans() }}
Pool ৳ {{ number_format((float) $report->profit_pool, 2) }}
@csrf @method('DELETE')
@foreach ($report->lines as $ln) @endforeach
Partner Avg capital Weight Allocated
{{ $ln->shareholder?->display_name }} {{ number_format((float) $ln->avg_capital_employed, 4) }} {{ number_format((float) $ln->capital_weight_ratio * 100, 4) }}% ৳ {{ number_format((float) $ln->allocated_profit, 2) }}
@endforeach
{{ $reports->links() }}
@endif
@endsection