diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index af6d1b2..efba819 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -1639,7 +1639,7 @@ @endphp @if($refundTotal > 0) @if($isRefundInconsistent) - @php $refundFixUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'refund-receipts'); @endphp + @php $refundFixUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'add-refund-receipt'); @endphp ¥{{ number_format($refundTotal, 2) }}
疑似不一致 @@ -1672,7 +1672,7 @@ $needReconcileFix = (bool) $order->isReconcileMismatch(); $needRefundFix = (bool) $order->isRefundInconsistent(); $reconcileFixUrlCompact = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'add-payment-receipt'); - $refundFixUrlCompact = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'refund-receipts'); + $refundFixUrlCompact = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'add-refund-receipt'); @endphp @if($needReconcileFix || $needRefundFix) diff --git a/tests/Feature/AdminPlatformOrderIndexRefundInconsistentFixLinkShouldPointToAddRefundReceiptPanelTest.php b/tests/Feature/AdminPlatformOrderIndexRefundInconsistentFixLinkShouldPointToAddRefundReceiptPanelTest.php new file mode 100644 index 0000000..ef67569 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexRefundInconsistentFixLinkShouldPointToAddRefundReceiptPanelTest.php @@ -0,0 +1,60 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_index_refund_inconsistent_fix_link_should_point_to_add_refund_receipt_panel(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + + // 构造:非 refunded,但 refund_total >= paid + tol(默认 tol=0.01) => isRefundInconsistent=true(注意要大于 paid) + $order = PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => null, + 'site_subscription_id' => null, + 'order_no' => 'PO_INDEX_REFUND_INCONSISTENT_FIX_LINK', + 'order_type' => 'new_purchase', + 'status' => 'pending', + 'payment_status' => 'paid', + 'payable_amount' => 10, + 'paid_amount' => 10, + 'paid_at' => now(), + 'meta' => [ + 'refund_summary' => [ + 'total_amount' => 10.02, + 'count' => 1, + ], + ], + ]); + + $res = $this->get('/admin/platform-orders?refund_inconsistent=1'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + // 退款不一致集合里,行内“去核对退款”应直达追加退款回执面板(#add-refund-receipt)。 + $this->assertStringContainsString('疑似不一致', $html); + $this->assertStringContainsString('/admin/platform-orders/' . $order->id, $html); + $this->assertStringContainsString('#add-refund-receipt', $html); + } +}