Account holder{{ $selectedBank->account_holder_name ?: '—' }}
Account No.{{ $selectedBank->account_number ?: '—' }}
Currency{{ $selectedBank->currency ?: '—' }}
@extends('layouts.app') @section('title', 'Purchase') @section('content') @php $badges = $delivery['badges'] ?? null; $suiteNumber = $payment->suite_number ?: $primary->suite_number; $money = $payment->selectedMoney(); $currencyMark = $money['mark']; $purchaseCount = max($lines->count(), 1); $statusLabel = optional($payment->tracking)->status ?: ($payment->status ?: 'Pending From Customer'); $statusClass = $statusLabel === 'Customer Paid' ? 'is-done' : 'is-pending'; $warehouseMarked = $pathway === 'c' && $payment->trackingHistory->contains(function ($row) { return $row->status === 'Customer Paid' && $row->wuser_id; }); if ($pathway === 'c' && $statusLabel === 'Customer Paid' && !$warehouseMarked) { $statusLabel = 'Transaction Successful'; $statusClass = 'is-done'; } $payStatus = strtolower((string) $payment->payment_status); $cardPaid = in_array($payStatus, ['success', 'completed'], true); $cardFailed = $pathway === 'a' && !$cardPaid && in_array($payStatus, ['failed', 'cancelled', 'canceled'], true); if ($cardFailed) { $statusLabel = 'Failed'; $statusClass = 'is-fail'; } elseif ($pathway === 'a' && $cardPaid) { $statusLabel = 'Customer Paid'; $statusClass = 'is-done'; } $pathwayNames = ['a' => 'Card Gateway', 'b' => 'Maldives Post Link', 'c' => 'Cash / Bank Transfer']; $methodLabel = isset($pathwayNames[$pathway]) ? 'Payment method - Pathway '.strtoupper($pathway).': '.$pathwayNames[$pathway] : 'Payment method'; $receiptDate = optional($payment->bank_transaction_date)->format('Y-m-d'); $storeIcons = $lines->map(function ($line) { $path = trim((string) $line->store_icon); if ($path === '') { $path = \App\Support\AssistedStoreIcon::match($line->url)['path']; } return [ 'store' => trim((string) $line->store) ?: 'Store', 'icon' => asset($path), ]; })->unique('store')->values(); $payCurrency = in_array(strtoupper((string) $payment->currency), ['USD', 'INR'], true) ? strtoupper((string) $payment->currency) : 'INR'; $currencyNames = ['INR' => 'INR (₹)', 'USD' => 'USD ($)', 'MVR' => 'MVR (Rf)', 'RF' => 'MVR (Rf)']; $currencyLabel = $currencyNames[$money['code']] ?? $money['code']; $formulaBits = $lines->map(function ($line) { $qty = max(1, (int) ($line->quantity ?? 1)); $unit = trim((string) $line->price_range); if ($unit !== '' && !preg_match('/[₹$]|Rf/u', $unit)) { $unit = '₹'.number_format((float) preg_replace('/[^\d.]/', '', $unit), 2); } return ($unit !== '' ? $unit : '—').' × '.$qty; }); $itemFormula = $formulaBits->isNotEmpty() ? $formulaBits->implode(', ') : ''; $feePercents = $lines->pluck('overhead_percentage')->filter(function ($value) { return $value !== null && $value !== ''; })->map(function ($value) { return rtrim(rtrim(number_format((float) $value, 2, '.', ''), '0'), '.'); })->unique()->values(); $convenienceAmount = null; if ($pathway === 'b') { if ($money['code'] === 'USD') { $convenienceAmount = $payment->convenience_charge_usd; } elseif (in_array($money['code'], ['MVR', 'RF'], true)) { $convenienceAmount = $payment->convenience_charge_rf; } else { $convenienceAmount = $payment->convenience_charge_inr; } } $lineSubtotal = ($money['subtotal'] !== null && $money['fee'] !== null) ? round((float) $money['subtotal'] + (float) $money['fee'], 2) : null; if ($pathway === 'a') { $summaryNote = $cardPaid ? 'Card payment is complete.' : 'Proceed to payment opens the card gateway.'; } elseif ($pathway === 'b') { $summaryNote = 'Maldives Post will send a payment link by WhatsApp or email for collecting the payment.'; } else { $summaryNote = $locked ? 'The warehouse confirms this transfer after the amount is received.' : 'Record the bank, date, transaction ID, and screenshot after you transfer the amount.'; } @endphp
{{ $badges['name'] }} - {{ $badges['phone'] ?? '—' }} ({{ $badges['label'] ?? '—' }})
@endif @if(!empty($delivery['address'])){{ $delivery['address'] }}
@endifAccount holder{{ $selectedBank->account_holder_name ?: '—' }}
Account No.{{ $selectedBank->account_number ?: '—' }}
Currency{{ $selectedBank->currency ?: '—' }}
Bank account is not available.
@endif{{ implode(', ', $shipmentFlow['numbers']) }}
@endif