Skip to content

The open alternative to Salesforce, designed for AI.

Show the Stripe billing date in self-hosted enterprise settings (#25170)

Marie768cadd6c27e
diff --git a/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx b/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx
index 918713bcf4b..379abbeb8df 100644
--- a/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx
+++ b/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx
@@ -223,14 +223,15 @@ export const SettingsEnterprise = ({
stripeStatus === 'incomplete' || stripeStatus === 'incomplete_expired';
const licensee = subscriptionStatus?.licensee ?? null;
- const expiresAt = subscriptionStatus?.expiresAt
- ? new Date(subscriptionStatus.expiresAt)
- : null;
const cancelAt = isDefined(subscriptionStatus?.cancelAt)
? new Date(subscriptionStatus.cancelAt)
: null;
+ const currentPeriodEnd = isDefined(subscriptionStatus?.currentPeriodEnd)
+ ? new Date(subscriptionStatus.currentPeriodEnd)
+ : null;
+
const cancelAtDate =
isCancelScheduled && isDefined(cancelAt)
? cancelAt.toLocaleDateString()
@@ -241,6 +242,13 @@ export const SettingsEnterprise = ({
? t`Your enterprise features will remain active until ${cancelAtDate}.`
: null;
+ const cancellationOrPeriodEndDate = isCancelScheduled
+ ? cancelAt
+ : currentPeriodEnd;
+ const cancellationOrPeriodEndDateLabel = isCancelScheduled
+ ? t`Cancels on`
+ : t`Renews on`;
+
const handleActivate = useCallback(async () => {
if (!enterpriseKey.trim()) return;
@@ -694,11 +702,11 @@ export const SettingsEnterprise = ({
currentValue={licensee}
/>
)}
- {expiresAt && (
+ {isDefined(cancellationOrPeriodEndDate) && (
<SubscriptionInfoRowContainer
- label={t`Valid until`}
+ label={cancellationOrPeriodEndDateLabel}
Icon={IconCalendarRepeat}
- currentValue={new Date(expiresAt).toLocaleDateString()}
+ currentValue={cancellationOrPeriodEndDate.toLocaleDateString()}
/>
)}
</SubscriptionInfoContainer>
@@ -756,11 +764,11 @@ export const SettingsEnterprise = ({
currentValue={licensee}
/>
)}
- {expiresAt && (
+ {isDefined(cancellationOrPeriodEndDate) && (
<SubscriptionInfoRowContainer
- label={isCancelScheduled ? t`Cancels on` : t`Valid until`}
+ label={cancellationOrPeriodEndDateLabel}
Icon={IconCalendarRepeat}
- currentValue={new Date(expiresAt).toLocaleDateString()}
+ currentValue={cancellationOrPeriodEndDate.toLocaleDateString()}
/>
)}
</SubscriptionInfoContainer>