refactor: platform order list row uses model refundTotal/isRefundInconsistent
This commit is contained in:
@@ -630,25 +630,8 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@php
|
@php
|
||||||
$refundSummaryTotal = data_get($order->meta, 'refund_summary.total_amount');
|
$refundTotal = (float) $order->refundTotal();
|
||||||
if ($refundSummaryTotal !== null) {
|
$isRefundInconsistent = (bool) $order->isRefundInconsistent();
|
||||||
$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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$refundShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts';
|
$refundShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts';
|
||||||
@endphp
|
@endphp
|
||||||
|
|||||||
Reference in New Issue
Block a user