Invoicing status badges

Outside the canon

The status wrappers the Invoicing pages put on Badge, one per production helper: payment status (with the refund override), a refund's own state, a transaction's sync badge, payout status, credit memo availability and the composite accounting status. Feature components, not canon units: each is a Badge with a status → (status, icon, label) map, so the canon unit is Badge and these are its mappings. Every enum value is rendered here, so this is the visual proof of the status → Badge mapping in HANDOFF.md. RefundStatusBadge (2026-10-13) is a refund's state on the Transactions list's refund rows and the transaction page's Refunds table; a failed one says why in a Tooltip. Production has no refund pill of its own — Orders::HistoryTimelineComponent maps refund.status onto payment_status_badge (refund_pending, refunded, refund_failed). SyncRecordsBadge (2026-10-13) is what the pages render for sync: on the Transactions list's Sync Status column, the transaction page's rail and a credit memo's Transactions rows. It names the record — INV, PMT or CM, then the state ("INV Synced", "PMT Queued", "CM Reconnect") — because one transaction can sync several: a credit applied to an order is a payment in QuickBooks linking the memo to the invoice. A record that is not synced wins (failed, then the setup states, then waiting, then queued, then skipped), so a failure never hides behind an older success; when all are synced it names the latest. One state vocabulary and one colour each: the credit memo's accounting states plus a payment's skipped (sync_failed reads as failed), with in progress (Queued) blue and waiting (Syncable) orange everywhere — the two old badges had them swapped. Hover or focus opens the sync card (SyncDetails, the Lifecycle bar's step card): the state as a title, the latest sync or the problem as its line, a row per record with the badge's record first, and a footer for the one action. SyncStatusBadge (payment_transactions/_sync_status's pill, the old mapping) is retired: SyncRecordsBadge replaced it on every page on 2026-10-13, and it is kept here, last, only as the record of what production draws today.

App: payment_status_badge; payment_transactions/_sync_status with CreditMemos::AccountingStatusComponent's popover (SyncRecordsBadge, a row per synced record from /credit_memos/:id/accounting_status); payouts_helper; tool_credit_memo_availability_badge; CreditMemos::AccountingStatusComponent

Payment status

#payment

The seven statuses, then the two refund overrides (OrdersHelper#payment_status_badge).

PendingAuthorizedSucceededFailedCanceledRefundedDisputed
Partial RefundRefunded

Refund status

#refund

RefundStatusBadge (2026-10-13): a refund's own state, on the Transactions list's refund rows and the transaction page's Refunds table. The last pill is a failed refund with its failed_reason: hover or focus it for the Tooltip.

PendingSucceededFailedCancelledFailed

Sync: every state

#sync-records-states

SyncRecordsBadge on a single PMT record, once per SyncState, worst first — the order the badge ranks them in. One colour per state: Queued (in progress) is blue and Syncable (waiting) is orange, on every page. Hover or focus a pill for its sync card.

Sync: which record it names

#sync-records-cases

A transaction can sync several records, and the badge names one: a record that is not synced wins, so a failure never hides behind an older success; when all are synced it names the latest. The card lists every record, the badge's first, a synced one as a quiet check and date.

All synced: names the latest

The invoice is waiting, the payment queued behind it

A failure wins over an older success

Credit applied: INV, CM and the PMT QuickBooks records

Skipped is named over synced

Sync: the card's action

#sync-records-action

footer carries the one action for the badge's record when it is the payment: Retry sync after a failure (primary), Sync now while it is Syncable (tertiary), from SyncFooterAction. Mock behaviour: Retry sync queues the payment locally, so the badge turns to PMT Queued and the card has no action left; Reset puts the failure back.

Payout status

#payout

PayoutsHelper's seven statuses. Production uppercases the label; the canon keeps sentence case.

In TransitIn TransitPaidFailedCanceledForwardedScheduled

Credit memo availability and accounting status

#credit-memo

tool_credit_memo_availability_badge (three, derived from the balance) and CreditMemos::AccountingStatusComponent (eight).

AppliedPartially appliedAvailable
DisconnectedReconnectSetup incompleteMappableSyncableQueuedSyncedFailed

Payment sync status (retired)

#sync-retired

Retired 2026-10-13: SyncStatusBadge, production's payment_transactions/_sync_status pill, which no page renders any more — SyncRecordsBadge replaced it. Kept as the record of the old mapping; note Syncable blue and Queued orange, the pair the new vocabulary swapped so in progress is blue everywhere. failed carries the last error in a tooltip.

SyncableQueuedSyncedFailedSkipped

Props

NameTypeDefaultNotes
PaymentStatusBadge{ status: PaymentStatus; refund_status: RefundStatus }—A refund override (partially_refunded, fully_refunded) replaces the status pill
RefundStatusBadge{ status: RefundState; failed_reason?: string }—pending, succeeded, failed, cancelled. failed_reason puts the reason in a Tooltip on a failed refund
SyncRecordsBadge{ records: SyncRecord[]; accounting_connection_name: string; footer?: ReactNode }—SyncRecord is { kind: invoice | payment | credit_memo; name; status: SyncState; at?; detail? }. The badge names the worst record (orderSyncRecords); accounting_connection_name titles the all-synced card ("Synced to QuickBooks Online"). Build records with paymentSyncRecords or creditApplicationSyncRecords; footer is usually SyncFooterAction (Sync now, Retry sync)
SyncStatefailed | disconnected | reconnect | setup_incomplete | mappable | syncable | queued | skipped | synced—CreditMemoAccountingStatus plus skipped; paymentSyncState maps a payment's sync_failed to failed
PayoutStatusBadge{ status: PayoutStatus }—
CreditMemoAvailabilityBadge{ memo: { total_cents, remaining_amount_cents } }—
AccountingStatusBadge{ status: CreditMemoAccountingStatus; explain?: boolean }—
SyncStatusBadge{ status: PaymentSyncStatus; error_message?: string }—Retired 2026-10-13 (SyncRecordsBadge replaced it). Kept for this gallery only; its syncable/queued colours are the swapped pair