平台订单详情 BMPA 治理:续费单未绑订阅时禁用按钮并提示(含测试)
This commit is contained in:
@@ -205,6 +205,10 @@
|
||||
$expectedCents = (int) round($expectedPaid * 100);
|
||||
$markPaidBlockedByRefund = $refundTotal > 0;
|
||||
|
||||
// 安全阀:续费单必须绑定订阅(后端已阻断,这里做前端提示/禁用)
|
||||
$markPaidBlockedByMissingSubscriptionOnRenewal = ((string) ($order->order_type ?? '') === 'renewal')
|
||||
&& ((int) ($order->site_subscription_id ?? 0) <= 0);
|
||||
|
||||
$tol = (float) config('saasshop.amounts.tolerance', 0.01);
|
||||
$tolCents = (int) round($tol * 100);
|
||||
$tolCents = max(1, $tolCents);
|
||||
@@ -215,10 +219,10 @@
|
||||
<div class="actions mt-16 gap-12">
|
||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/mark-paid-and-activate" onsubmit="return confirm('确认将该订单标记为已支付并生效?此操作会推进状态并尝试同步订阅');">
|
||||
@csrf
|
||||
<button class="btn btn-sm" type="submit" @disabled(! $canMarkPaid || $markPaidBlockedByRefund || $markPaidBlockedByReceiptMismatch)>标记支付并生效</button>
|
||||
<button class="btn btn-sm" type="submit" @disabled(! $canMarkPaid || $markPaidBlockedByRefund || $markPaidBlockedByReceiptMismatch || $markPaidBlockedByMissingSubscriptionOnRenewal)>标记支付并生效</button>
|
||||
</form>
|
||||
|
||||
@if($markPaidBlockedByRefund || $markPaidBlockedByReceiptMismatch)
|
||||
@if($markPaidBlockedByRefund || $markPaidBlockedByReceiptMismatch || $markPaidBlockedByMissingSubscriptionOnRenewal)
|
||||
<div class="card governance-block">
|
||||
<div class="muted text-danger governance-block-title"><strong>BMPA 治理提示</strong>(当前不建议/不可直接标记支付并生效)</div>
|
||||
<div class="muted governance-block-body">
|
||||
@@ -229,6 +233,13 @@
|
||||
<a class="btn btn-secondary btn-sm" href="#refund-receipts">去核对退款</a>
|
||||
</div>
|
||||
@endif
|
||||
@if($markPaidBlockedByMissingSubscriptionOnRenewal)
|
||||
<div>
|
||||
原因:当前订单类型为「续费」,但未绑定订阅(site_subscription_id 为空)。
|
||||
<span class="muted">|</span>
|
||||
<span class="muted">请先补齐订阅关联后再处理。</span>
|
||||
</div>
|
||||
@endif
|
||||
@if($markPaidBlockedByReceiptMismatch)
|
||||
<div>
|
||||
原因:当前订单已存在支付回执,但回执总额与订单金额不一致。
|
||||
|
||||
Reference in New Issue
Block a user