@extends('layouts.admin')
@section('title', 'Donation '.($d->receipt_no ?: '#'.$d->id))
@section('heading', 'Donation')
@php
$address = collect([$d->donor_address, $d->donor_city, $d->donor_state, $d->donor_pincode])->filter()->implode(', ');
$method = $d->payment_method ? (strtoupper($d->payment_method) === 'UPI' ? 'UPI' : ucfirst($d->payment_method)) : null;
$timeline = collect([
['Started', $d->created_at, 'plus', 'is-done'],
['Paid', $d->paid_at, 'check', $d->paid_at ? 'is-done' : ''],
['Receipt emailed', $d->receipt_sent_at, 'mail', $d->receipt_sent_at ? 'is-done' : ''],
['Refunded', $d->refunded_at, 'logout', $d->refunded_at ? 'is-bad' : ''],
])->filter(fn ($s) => $s[1] || $s[0] !== 'Refunded');
@endphp
@section('content')
Back to donations
@error('refund')@enderror
{{ $d->frequency === 'monthly' ? 'Monthly donation' : 'One-time donation' }}@if ($d->receipt_no) · Receipt {{ $d->receipt_no }}@endif
{{ \App\Support\Fmt::rupees($d->amount) }}
From {{ $d->donor_name }} · {{ $d->purpose }}
$d->status === 'paid', 'pill--off' => $d->status === 'refunded', 'pill--warn' => $d->status === 'pending', 'pill--bad' => $d->status === 'failed'])>{{ ucfirst($d->status) }}
{{-- DONOR --}}
Donor
{{ mb_strtoupper(mb_substr((string) $d->donor_name, 0, 1)) }}
{{ $d->donor_name }}
@if ($d->is_anonymous)Anonymous on site@endif
$d->whatsapp_optin, 'pill--off' => ! $d->whatsapp_optin])>WhatsApp updates: {{ $d->whatsapp_optin ? 'Yes' : 'No' }}
@if ($d->message)
Message from the donor
{{ $d->message }}
@endif
{{-- ITEMS --}}
@if ($d->items->isNotEmpty())
Items
| Item | Qty | Price | Total |
@foreach ($d->items as $line)
| {{ $line->name }} | {{ $line->qty }} | {{ \App\Support\Fmt::rupees($line->unit_price) }} | {{ \App\Support\Fmt::rupees($line->line_total) }} |
@endforeach
@endif
{{-- PAYMENT --}}
Payment
@foreach ($timeline as [$label, $when, $icon, $state])
-
{{ $label }}
{{ $when ? $when->format('j M Y, g:i a') : 'Waiting' }}
@endforeach
@if ($d->failure_reason)Last problem: {{ $d->failure_reason }}
@endif
- Provider
- {{ ucfirst($d->gateway) }}@if ($d->gateway === 'fake') (local test)@endif
@if ($method)- Method
- {{ $method }}
@endif
@if ($d->gateway_order_id)- Order id
- {{ $d->gateway_order_id }}
@endif
@if ($d->gateway_payment_id && $d->gateway !== 'offline')- Payment id
- {{ $d->gateway_payment_id }}
@endif
@if ($d->subscription)- Subscription
- {{ $d->subscription->gateway_subscription_id }} ({{ $d->subscription->status }})
@endif
@if ($d->ip)- IP address
- {{ $d->ip }}
@endif
@endsection