@extends('app.shell') @section('body') @php /** @var \App\Models\SharedList $list */ @endphp

{{ __('Who’s in it') }}

+
@foreach ($list->members as $m)
{{ $m->avatar }}
{{ $m->name }}
@endforeach

{{ __('List') }}

@if ($list->items->count() === 0)

{{ __('No items yet.') }}

@else @foreach ($list->items as $item)
@csrf

{{ $item->item_text }}

@csrf
@endforeach @endif
@csrf

{{ __('Receipt') }}

@php /** @var \App\Models\Expense|null $latestCheckout */ $checkout = $latestCheckout ?? null; $paidBy = $checkout?->paidBy; $locale = app()->getLocale(); $displayCurrency = request()->user()?->profile?->currency ?: ($checkout?->currency ?: 'USD'); $members = $list->members->values(); $n = max(1, $members->count()); $amount = $checkout ? (float) $checkout->amount : null; $cents = $amount !== null ? (int) round($amount * 100) : 0; $base = $n > 0 ? intdiv($cents, $n) : 0; $rem = $n > 0 ? ($cents - ($base * $n)) : 0; @endphp
{{-- Perforated top edge (cut-outs) --}}
@for ($i = 0; $i < 12; $i++)
@endfor

RECEIPT

{{ $list->emoji }} {{ $list->name }}

@if ($checkout) {{ \Illuminate\Support\Carbon::parse($checkout->expense_date)->format('m-d-Y') }} @else — @endif

@if (! $checkout)
@csrf

{{ __('WHO PAID') }}

{{ __('AMOUNT') }}

{{ __('DESCRIPTION') }}

{{ __('ATTACH RECEIPT') }}

@if ($list->receipt_path) {{ __('View current receipt') }} @endif
@else
{{ __('PAID BY') }} {{ $paidBy?->avatar }} {{ $paidBy?->name ?? '—' }}
{{ __('SPLIT EQUALLY') }}
@foreach ($members as $i => $m) @php $share = ($base + ($i < $rem ? 1 : 0)) / 100; $isPayer = $checkout->paid_by_person_id === $m->id; @endphp
{{ $m->avatar }} {{ $m->name }} @if ($isPayer) {{ __('(payer)') }} @endif
@php $fmtShare = \App\Support\Money::formatConvertedWithOriginal((float) $share, $checkout->currency ?: 'USD', $displayCurrency, $locale); @endphp {{ $fmtShare['primary'] }} @if (! $isPayer && $share > 0)
@csrf
@endif
@endforeach
{{ __('TOTAL') }} @php $fmtTotal = \App\Support\Money::formatConvertedWithOriginal((float) $checkout->amount, $checkout->currency ?: 'USD', $displayCurrency, $locale); @endphp {{ $fmtTotal['primary'] }}
@if ($fmtTotal['secondary'])

{{ $fmtTotal['secondary'] }}

@endif
@csrf
{{ __('Open settle view') }}
@if ($list->receipt_path) {{ __('View attached receipt') }} @endif @endif
{{-- Perforated bottom edge (cut-outs) --}}
@for ($i = 0; $i < 12; $i++)
@endfor

{{ __('Notes') }}

@csrf {{ __('Save notes') }}
{{-- Replaced by contextual bottom action bar on this screen --}} @endsection @section('bottom_nav') @endsection