退款治理:支持标记部分退款/已支付以回退退款状态

This commit is contained in:
萝卜
2026-03-11 05:12:53 +00:00
parent 857ed4e424
commit fa085980b4
4 changed files with 167 additions and 0 deletions

View File

@@ -85,6 +85,11 @@
$canMarkRefunded = $paidAmountFloat > 0
&& $order->payment_status !== 'refunded'
&& round($refundTotal * 100) >= round($paidAmountFloat * 100);
// - refunded 但退款总额不足 => 提供降级动作:标记为部分退款/已支付(仍不自动写回执)
$canFixRefundedButNotEnough = $paidAmountFloat > 0
&& $order->payment_status === 'refunded'
&& (round($refundTotal * 100) + 1) < round($paidAmountFloat * 100);
@endphp
@if($canMarkRefunded)
<div class="muted" style="margin-top:10px;">
@@ -94,6 +99,18 @@
<button type="submit">标记为已退款</button>
</form>
</div>
@elseif($canFixRefundedButNotEnough)
<div class="muted" style="margin-top:10px;">
提示:当前支付状态为「已退款」,但退款总额不足。如确认无误,可将状态修正为「部分退款」或「已支付」。
<form method="post" action="/admin/platform-orders/{{ $order->id }}/mark-partially-refunded" style="display:inline; margin-left:8px;" onsubmit="return confirm('确认将该订单支付状态标记为部分退款?该操作不会自动写入退款回执,仅修正状态');">
@csrf
<button type="submit">标记为部分退款</button>
</form>
<form method="post" action="/admin/platform-orders/{{ $order->id }}/mark-paid-status" style="display:inline; margin-left:8px;" onsubmit="return confirm('确认将该订单支付状态标记为已支付?该操作不会自动写入回执/退款回执,仅修正状态');">
@csrf
<button type="submit">标记为已支付</button>
</form>
</div>
@endif
@if($order->payment_status === 'refunded' && ($refundTotal + 0.01) < $paidAmountFloat)
@@ -393,6 +410,8 @@
'batch_mark_activated' => '批量仅标记为已生效',
'activate_subscription' => '同步订阅',
'mark_refunded' => '手动标记为已退款',
'mark_partially_refunded' => '手动标记为部分退款',
'mark_paid_status' => '手动标记为已支付',
];
@endphp
<table>