@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

{{ $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->donor_phone)
  • @endif @if ($d->donor_pan)
  • PAN{{ $d->donor_pan }}
  • @endif @if ($address)
  • Address{{ $address }}
  • @endif @if ($d->dedication_label)
  • Dedication{{ $d->dedication_label }}
  • @endif
@if ($d->message)

Message from the donor

{{ $d->message }}
@endif
{{-- ITEMS --}} @if ($d->items->isNotEmpty())

Items

@foreach ($d->items as $line) @endforeach
ItemQtyPriceTotal
{{ $line->name }}{{ $line->qty }}{{ \App\Support\Fmt::rupees($line->unit_price) }}{{ \App\Support\Fmt::rupees($line->line_total) }}
@endif {{-- PAYMENT --}}

Payment

    @foreach ($timeline as [$label, $when, $icon, $state])
  1. {{ $label }} {{ $when ? $when->format('j M Y, g:i a') : 'Waiting' }}
  2. @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