diff --git a/resources/views/admin/site_subscriptions/show.blade.php b/resources/views/admin/site_subscriptions/show.blade.php index f0daa3b..51ea8a0 100644 --- a/resources/views/admin/site_subscriptions/show.blade.php +++ b/resources/views/admin/site_subscriptions/show.blade.php @@ -237,10 +237,13 @@ @php $refundTol = (float) config('saasshop.amounts.tolerance', 0.01); @endphp
当前容差:¥{{ number_format($refundTol, 2) }}
@if(((int) ($summaryStats['refund_inconsistent_orders'] ?? 0)) > 0) -
- 提示:存在退款状态与退款总额不一致订单。 - 进入退款不一致订单列表 - (建议先逐单核对退款轨迹,再在订单详情页使用「退款状态治理」修正状态;仅修口径,不会自动生成回执/退款回执)。 +
+
退款不一致治理提示
+
+ 存在退款状态与退款总额不一致订单。 + 进入退款不一致订单列表 + (建议先逐单核对退款轨迹,再在订单详情页使用「退款状态治理」修正状态;仅修口径,不会自动生成回执/退款回执)。 +
@endif
@@ -258,13 +261,21 @@ @php $tol = (float) config('saasshop.amounts.tolerance', 0.01); @endphp @if(((int) ($summaryStats['reconcile_mismatch_orders'] ?? 0)) > 0) -
- 提示:存在「回执总额 vs 已付金额」不一致订单。 - 进入对账不一致订单列表 - (建议先逐单核对回执轨迹与订单金额,再决定是否补回执/修正订单金额口径)。 +
+
对账不一致治理提示
+
+ 存在「回执总额 vs 已付金额」不一致订单。 + 进入对账不一致订单列表 + (建议先逐单核对回执轨迹与订单金额,再决定是否补回执/修正订单金额口径)。 +
@elseif(abs($delta) >= $tol) -
提示:差额超过容差(tol={{ number_format($tol, 2) }}),可能存在回执金额与订单已付金额不一致。
+
+
对账差额提示
+
+ 差额超过容差(tol={{ number_format($tol, 2) }}),可能存在回执金额与订单已付金额不一致。 +
+
@else
差额在容差范围内(tol={{ number_format($tol, 2) }},当前订阅维度)
@endif diff --git a/tests/Feature/AdminSiteSubscriptionShowGovernanceBlocksUseCssComponentTest.php b/tests/Feature/AdminSiteSubscriptionShowGovernanceBlocksUseCssComponentTest.php new file mode 100644 index 0000000..944abcc --- /dev/null +++ b/tests/Feature/AdminSiteSubscriptionShowGovernanceBlocksUseCssComponentTest.php @@ -0,0 +1,100 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_show_should_render_governance_blocks_with_css_component_class_when_mismatch_present(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'sub_show_gov_block_plan', + 'name' => '订阅详情治理提示块测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $sub = SiteSubscription::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'status' => 'active', + 'source' => 'manual', + 'subscription_no' => 'SUB_SHOW_GOV_BLOCK_0001', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'amount' => 10, + 'starts_at' => now(), + 'ends_at' => now()->addMonth(), + ]); + + // 构造一条对账不一致订单(receipt_total=9, paid_amount=10) + PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'site_subscription_id' => $sub->id, + 'order_no' => 'PO_SUB_SHOW_GOV_RECON_0001', + 'order_type' => 'renewal', + 'status' => 'activated', + 'payment_status' => 'paid', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'quantity' => 1, + 'payable_amount' => 10, + 'paid_amount' => 10, + 'placed_at' => now(), + 'paid_at' => now(), + 'activated_at' => now(), + 'meta' => [ + 'payment_summary' => [ + 'count' => 1, + 'total_amount' => 9, + ], + 'payment_receipts' => [ + [ + 'type' => 'bank_transfer', + 'channel' => 'offline', + 'amount' => 9, + 'paid_at' => now()->toDateTimeString(), + 'created_at' => now()->toDateTimeString(), + 'admin_id' => 1, + ], + ], + ], + ]); + + $res = $this->get('/admin/site-subscriptions/' . $sub->id); + $res->assertOk(); + + $res->assertSee('governance-block', false); + $res->assertSee('governance-block-title', false); + $res->assertSee('governance-block-body', false); + $res->assertSee('对账不一致治理提示', false); + } +}