diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index d36e15b..8ce9165 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -630,25 +630,8 @@ @php - $refundSummaryTotal = data_get($order->meta, 'refund_summary.total_amount'); - if ($refundSummaryTotal !== null) { - $refundTotal = (float) $refundSummaryTotal; - } else { - $refundTotal = 0.0; - foreach ($refunds as $r) { - $refundTotal += (float) (data_get($r, 'amount') ?? 0); - } - } - - $paidAmountFloat = (float) ($order->paid_amount ?? 0); - $isRefundInconsistent = false; - if ($paidAmountFloat > 0) { - if ((string) $order->payment_status === 'refunded') { - $isRefundInconsistent = (round($refundTotal * 100) + 1) < round($paidAmountFloat * 100); - } else { - $isRefundInconsistent = round($refundTotal * 100) >= round($paidAmountFloat * 100); - } - } + $refundTotal = (float) $order->refundTotal(); + $isRefundInconsistent = (bool) $order->isRefundInconsistent(); $refundShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; @endphp