@extends('layouts.admin') @section('title', 'Expenses ยท Aromaniacs ERP') @section('overline', 'Finance') @section('heading', 'Expenses') @section('content')

Total spend (filtered range)

{{ number_format($grandTotal, 2) }}

By type

@if ($totalsByType->isEmpty())

No expenses in this range yet.

@else
@foreach ($totalsByType as $typeKey => $total) @php $enum = \App\Enums\ExpenseType::tryFrom($typeKey); @endphp {{ $enum?->label() ?? $typeKey }}: {{ number_format((float) $total, 2) }} @endforeach
@endif
@if ($expenses->isEmpty())

No expenses yet.

Bottle purchases auto-log here, or add a manual entry.

@else @foreach ($expenses as $expense) @endforeach
Date Type Amount Spent by Linked bottle Description Actions
{{ optional($expense->spent_at)->format('d M Y') }} @if ($expense->type === \App\Enums\ExpenseType::BottlePurchase) Bottle purchase @else {{ $expense->type->label() }} @endif {{ number_format((float) $expense->amount, 2) }} {{ $expense->spentBy?->name ?? 'โ€”' }} @if ($expense->bottleIntake) {{ $expense->bottleIntake->fragrance?->name }} #{{ $expense->bottleIntake->id }} @else โ€” @endif {{ \Illuminate\Support\Str::limit($expense->description ?? 'โ€”', 60) }}
@if ($expense->bottle_intake_id) @else
@csrf @method('DELETE')
@endif
{{ $expenses->links() }}
@endif
@if ($filters['user_id'] && isset($selectedUser))

Total spent by {{ $selectedUser->name }} (filtered range)

{{ number_format($totalSpentByUser, 2) }}

@endif @endsection