@if($booking->payments->count()) @component('mail::table') | Paid | | | | :------------- | :-------------- | :-------------- | @foreach($booking->payments as $payment) | {{ $payment->paid_at->format(config('formats.datetime.short-date')) }} | {{ \App\Enums\PaymentType::getDescription($payment->type) }} | {{ $payment->formatAsMoney() }} | @endforeach | | | Total paid: {{ formatCurrency($booking->amountPaid() / 100) }} | @endcomponent @endif @if($booking->instalments->count()) @component('mail::table') | Outstanding | | | | :------------- | :-------------- | :-------------- | @foreach($booking->instalments()->notPaid()->get() as $instalment) | due <= now()) style="color:#dc2626"@endif>Due {{ $instalment->due->format(config('formats.datetime.short-date')) }} | due <= now()) style="color:#dc2626"@endif>@if($instalment->type == \App\Enums\InstalmentType::Deposit){{ \App\Enums\InstalmentType::getDescription($instalment->type) }}@endif | due <= now()) style="color:#dc2626"@endif>{{ $instalment->formatAsMoney() }} | @endforeach | | | Total outstanding: {{ formatCurrency($booking->amountOutstanding() / 100) }} | @php $overdueInstalments = $booking->instalments()->overdue()->get(); $firstOverdueInstalment = $overdueInstalments->first(); $overdueInstalmentCount = $overdueInstalments->count(); @endphp @if($overdueInstalmentCount === 1) **Balance issue:** We have missed a payment of {{ $firstOverdueInstalment->formatAsMoney() }}, that was due on {{ $firstOverdueInstalment->due->format(config('formats.datetime.short-date-without-year')) }} @endif @if($overdueInstalmentCount > 1) **Balance issue:** We are missing a total of {{ $overdueInstalmentCount }}, which is now due @endif @endcomponent @component('mail::table') | How to pay | | :------------- | :-------------- | | When making your bank transfer please add your reference: **{{ $booking->getPaymentReference() }}**| |{!! \Illuminate\Support\Str::markdown($booking->eventOption->event->campGroup->payment_description ?? '') !!} @endcomponent @endif