File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/routes/(console)/organization-[organization]/billing Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 146
146
id: ' base-plan' ,
147
147
expandable: false ,
148
148
cells: {
149
- item: currentPlan ?. price === 0 ? ' Free plan ' : ' Base plan' ,
149
+ item: ' Base plan' ,
150
150
usage: ' ' ,
151
- price: formatCurrency (currentPlan ?.price || 0 )
151
+ price: formatCurrency (
152
+ Math .max (
153
+ (currentAggregation ?.amount ?? currentPlan ?.price ?? 0 ) - availableCredit ,
154
+ 0
155
+ )
156
+ )
152
157
},
153
158
children: []
154
159
};
300
305
$ : billingData = getBillingData (currentPlan , currentAggregation , $isSmallViewport );
301
306
302
307
$ : totalAmount = Math .max (
303
- (currentAggregation ?.amount || currentPlan ?.price || 0 ) - availableCredit ,
308
+ (currentAggregation ?.amount ?? currentPlan ?.price ?? 0 ) - availableCredit ,
304
309
0
305
310
);
306
311
307
312
$ : creditsApplied = Math .min (
308
- currentAggregation ?.amount || currentPlan ?.price || 0 ,
313
+ currentAggregation ?.amount ?? currentPlan ?.price ?? 0 ,
309
314
availableCredit
310
315
);
311
316
</script >
314
319
<EstimatedCard >
315
320
<Typography .Title size ="s" gap ="s" >{currentPlan .name } plan</Typography .Title >
316
321
317
- {#if currentPlan ?. price > 0 }
322
+ {#if totalAmount > 0 }
318
323
<Typography .Text color =" --fgcolor-neutral-secondary" >
319
324
Next payment of <span class =" text --fgcolor-neutral-primary u-bold"
320
325
>{formatCurrency (totalAmount )}</span >
You can’t perform that action at this time.
0 commit comments