🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat(billing): show only Total in invoice history for ClickHouse Billing orgs (#17851)
Steffen Reuther8b92732820d1
diff --git a/web/src/ee/features/billing/components/BillingInvoiceTable.tsx b/web/src/ee/features/billing/components/BillingInvoiceTable.tsxindex a0cac6c8ed..adf6a40417 100644--- a/web/src/ee/features/billing/components/BillingInvoiceTable.tsx+++ b/web/src/ee/features/billing/components/BillingInvoiceTable.tsx@@ -32,8 +32,11 @@ type InvoiceRow = {};export function BillingInvoiceTable() {- const { organization } = useBillingInformation();+ const { organization, billingProvider } = useBillingInformation();const isCloudBillingAvailable = useIsCloudBillingAvailable();+ // ClickHouse Billing reports a single total per invoice, so the+ // Stripe-only breakdown columns would always read $0.00.+ const showBreakdownColumns = billingProvider !== "clickhouse";// Provider-agnostic: getInvoices dispatches to whichever provider bills the// org, so the gate is "does this org have a billing identity at all", not// "does it have a Stripe customer". A CHB org never populates@@ -151,34 +154,38 @@ export function BillingInvoiceTable() {return <Badge variant={variant}>{status}</Badge>;},},- createNumberTableColumn<InvoiceRow>({- accessorFn: (row) => (row.breakdown?.subscriptionCents ?? 0) / 100,- id: "subscription",- header: "Subscription",- size: 100,- formatter: costFormatter,- }),- createNumberTableColumn<InvoiceRow>({- accessorFn: (row) => (row.breakdown?.usageCents ?? 0) / 100,- id: "usage",- header: "Usage",- size: 90,- formatter: costFormatter,- }),- createNumberTableColumn<InvoiceRow>({- accessorFn: (row) => (row.breakdown?.discountCents ?? 0) / 100,- id: "discounts",- header: "Discounts",- size: 90,- formatter: costFormatter,- }),- createNumberTableColumn<InvoiceRow>({- accessorFn: (row) => (row.breakdown?.taxCents ?? 0) / 100,- id: "tax",- header: "Tax",- size: 90,- formatter: costFormatter,- }),+ ...(showBreakdownColumns+ ? [+ createNumberTableColumn<InvoiceRow>({+ accessorFn: (row) => (row.breakdown?.subscriptionCents ?? 0) / 100,+ id: "subscription",+ header: "Subscription",+ size: 100,+ formatter: costFormatter,+ }),+ createNumberTableColumn<InvoiceRow>({+ accessorFn: (row) => (row.breakdown?.usageCents ?? 0) / 100,+ id: "usage",+ header: "Usage",+ size: 90,+ formatter: costFormatter,+ }),+ createNumberTableColumn<InvoiceRow>({+ accessorFn: (row) => (row.breakdown?.discountCents ?? 0) / 100,+ id: "discounts",+ header: "Discounts",+ size: 90,+ formatter: costFormatter,+ }),+ createNumberTableColumn<InvoiceRow>({+ accessorFn: (row) => (row.breakdown?.taxCents ?? 0) / 100,+ id: "tax",+ header: "Tax",+ size: 90,+ formatter: costFormatter,+ }),+ ]+ : []),createNumberTableColumn<InvoiceRow>({accessorFn: (row) => (row.breakdown?.totalCents ?? 0) / 100,id: "total",