@extends('app.shell') @section('body') @php /** @var \App\Models\Group $group */ /** @var \Illuminate\Support\Collection $expenses */ $myAmount = $myAmount ?? 0.0; $progress = min((abs($myAmount) / 200.0) * 100.0, 100.0); $locale = app()->getLocale(); $displayCurrency = request()->user()?->profile?->currency ?: ($group->currency ?? 'USD'); @endphp

{{ $myAmount >= 0 ? __('You’re owed') : __('You owe') }}

{{ \App\Support\Money::formatConvertedWithOriginal((float) abs($myAmount), $group->currency ?? 'USD', $displayCurrency, $locale)['primary'] }}

@php $fmt = \App\Support\Money::formatConvertedWithOriginal((float) abs($myAmount), $group->currency ?? 'USD', $displayCurrency, $locale); @endphp @if ($fmt['secondary'])

{{ $fmt['secondary'] }}

@endif

{{ __('Members') }}

{{ __('Add people') }}
@foreach ($group->members as $m) @php $b = collect($balances ?? [])->firstWhere('userId', $m->id); $amt = (float) ($b['amount'] ?? 0); @endphp
{{ $m->avatar }}
{{ $m->name }} @php $fmt2 = \App\Support\Money::formatConvertedWithOriginal((float) abs($amt), $group->currency ?? 'USD', $displayCurrency, $locale); @endphp {{ $amt >= 0 ? '+' : '-' }}{{ $fmt2['primary'] }}
@endforeach
@if ($group->members->count() > 1)

{{ __('Settle up') }}

{{ __('Open') }}
{{ __('Pay / settle') }}
@endif

{{ __('Expenses') }}

@forelse ($expenses as $i => $exp)
{{ $exp->emoji }}

{{ $exp->description }}

{{ $exp->paidBy?->name ?? __('Someone') }} {{ __('paid') }} · {{ optional($exp->expense_date)->format('M j') }} @if ($exp->is_recurring) · 🔄 @endif

@php $fmt3 = \App\Support\Money::formatConvertedWithOriginal((float) $exp->amount, $exp->currency ?: ($group->currency ?? 'USD'), $displayCurrency, $locale); @endphp {{ $fmt3['primary'] }}

@if ($fmt3['secondary'])

{{ $fmt3['secondary'] }}

@endif
@if ($i < $expenses->count() - 1)
@endif
@empty
{{ __('No expenses yet.') }}
@endforelse
@endsection