@extends('layouts.app') @section('title','Expenses') @section('page_title','Expenses') @section('content') @php $canManage = in_array(auth()->user()->role,['owner','manager'],true); @endphp

{{ auth()->user()->isCashier() ? 'My Expenses' : 'All Expenses' }}

{{ number_format($expenses->total()) }} records
@if($canManage)@endif+ Add Expense
@if(session('status'))
{{ session('status') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif
@forelse($expenses as $expense) @empty@endforelse
Expense NameCategoryAmountPayment MethodDateAdded ByActions
{{ $expense->name }}@if($expense->note){{ $expense->note }}@endif{{ $expense->categoryLabel() }}TZS {{ tzs_amount($expense->amount) }}{{ $expense->paymentMethodLabel() }}{{ $expense->expense_date->format('d M Y') }}{{ $expense->user?->displayName() ?? '-' }}@if($canManage)
@if(!$expense->isArchived())Edit
•••
@csrf
@else
@csrf @method('DELETE')
@endif
@elseRecorded@endif
No expenses match the selected filters.
@forelse($expenses as $expense)
{{ strtoupper(substr($expense->categoryLabel(),0,1)) }}

{{ $expense->name }}

{{ $expense->expense_date->format('d M Y') }} · {{ $expense->categoryLabel() }}
@if($expense->isArchived())Archived@endif
TZS {{ tzs_amount($expense->amount) }}
{{ $expense->paymentMethodLabel() }}By {{ $expense->user?->displayName() ?? '-' }}@if($expense->note){{ $expense->note }}@endif
@if($canManage && !$expense->isArchived())Edit@elseif(!$canManage)Recorded@endif @if($canManage)
•••
@if(!$expense->isArchived())
@csrf
@else
@csrf @method('DELETE')
@endif
@endif
@empty
E

No expenses found

Try another date range or record the first expense.

Add Expense
@endforelse
@endsection