refactor: platform order list row uses model refundTotal/isRefundInconsistent
This commit is contained in:
@@ -630,25 +630,8 @@
|
||||
</td>
|
||||
<td>
|
||||
@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
|
||||
|
||||
Reference in New Issue
Block a user