File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
apps/sim/lib/billing/core Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ export async function getSimplifiedBillingSummary(
310310 const totalLastPeriodCopilotCost = toNumber ( totalLastPeriodCopilotCostDecimal )
311311
312312 // Calculate team-level overage: total usage beyond what was already paid to Stripe
313- const totalOverage = Math . max ( 0 , totalCurrentUsage - totalBasePrice )
313+ const totalOverage = toNumber ( Decimal . max ( 0 , totalCurrentUsageDecimal . minus ( totalBasePrice ) ) )
314314
315315 // Get user's personal limits for warnings
316316 const percentUsed =
@@ -435,7 +435,7 @@ export async function getSimplifiedBillingSummary(
435435 totalLastPeriodCopilotCost = toNumber ( totalTeamLastPeriodCopilotCostDecimal )
436436 }
437437
438- const overageAmount = Math . max ( 0 , currentUsage - basePrice )
438+ const overageAmount = toNumber ( Decimal . max ( 0 , toDecimal ( currentUsage ) . minus ( basePrice ) ) )
439439 const percentUsed = usageData . limit > 0 ? ( currentUsage / usageData . limit ) * 100 : 0
440440
441441 // Calculate days remaining in billing period
You can’t perform that action at this time.
0 commit comments