Dashboard scanline: treat partially_refunded as refundable for refund trace

This commit is contained in:
萝卜
2026-03-18 01:13:07 +08:00
parent 6abfbd7d9d
commit c78ae01558
2 changed files with 74 additions and 3 deletions

View File

@@ -858,8 +858,11 @@
// 运营扫描用的“治理状态摘要”(不替代下方的治理提示入口,只用于快速判断)
// 注意:为避免对“未支付订单”造成误导,回执/对账/退款在非 paid/refunded 时显示 "-"。
$isPaid = ((string) $po->payment_status === 'paid');
$isRefunded = ((string) $po->payment_status === 'refunded');
$paymentStatus = (string) ($po->payment_status ?? '');
$isPaid = ($paymentStatus === 'paid');
$isRefunded = ($paymentStatus === 'refunded');
// partially_refunded 属于“已支付但发生退款”的治理集合:扫描行应展示退款轨迹(避免显示 "-" 造成误判)。
$isPartiallyRefunded = ($paymentStatus === 'partially_refunded');
$receiptStatusText = $isPaid ? ($hasReceiptEvidence ? '有' : '无') : '-';
$reconcileStatusText = ($isPaid && $hasReceiptEvidence)
@@ -872,7 +875,7 @@
// - 有退款且一致:"有"(直达 #add-refund-receipt便于核对退款轨迹
// - 无退款:"无"
$hasRefundTrace = ((float) $po->refundTotal()) > 0;
$refundStatusText = ($isPaid || $isRefunded)
$refundStatusText = ($isPaid || $isRefunded || $isPartiallyRefunded)
? ($po->isRefundInconsistent() ? '异常' : ($hasRefundTrace ? '有' : '无'))
: '-';