diff --git a/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx b/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx index 6574b865a4..2fb1514e82 100644 --- a/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx +++ b/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx @@ -76,6 +76,8 @@ export const BillingPlan: FC = ({ instanceStatus }) => { const expired = trialHasExpired(instanceStatus); const { uiConfig } = useUiConfig(); + const eligibleUsers = users.filter((user: any) => user.email); + const price = { [InstancePlan.PRO]: 80, [InstancePlan.COMPANY]: 0, @@ -86,8 +88,8 @@ export const BillingPlan: FC = ({ instanceStatus }) => { const planPrice = price[instanceStatus.plan]; const seats = instanceStatus.seats ?? 5; - const freeAssigned = Math.min(users.length, seats); - const paidAssigned = users.length - freeAssigned; + const freeAssigned = Math.min(eligibleUsers.length, seats); + const paidAssigned = eligibleUsers.length - freeAssigned; const paidAssignedPrice = price.user * paidAssigned; const finalPrice = planPrice + paidAssignedPrice; const inactive = instanceStatus.state !== InstanceState.ACTIVE;