diff --git a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte index dd2a0c734..51c39a931 100644 --- a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte +++ b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte @@ -146,9 +146,14 @@ id: 'base-plan', expandable: false, cells: { - item: currentPlan?.price === 0 ? 'Free plan' : 'Base plan', + item: 'Base plan', usage: '', - price: formatCurrency(currentPlan?.price || 0) + price: formatCurrency( + Math.max( + (currentAggregation?.amount ?? currentPlan?.price ?? 0) - availableCredit, + 0 + ) + ) }, children: [] }; @@ -300,12 +305,12 @@ $: billingData = getBillingData(currentPlan, currentAggregation, $isSmallViewport); $: totalAmount = Math.max( - (currentAggregation?.amount || currentPlan?.price || 0) - availableCredit, + (currentAggregation?.amount ?? currentPlan?.price ?? 0) - availableCredit, 0 ); $: creditsApplied = Math.min( - currentAggregation?.amount || currentPlan?.price || 0, + currentAggregation?.amount ?? currentPlan?.price ?? 0, availableCredit ); @@ -314,7 +319,7 @@ {currentPlan.name} plan - {#if currentPlan?.price > 0} + {#if totalAmount > 0} Next payment of {formatCurrency(totalAmount)}