diff --git a/src/lib/components/billing/estimatedTotal.svelte b/src/lib/components/billing/estimatedTotal.svelte index fa7a3b34e..fef543608 100644 --- a/src/lib/components/billing/estimatedTotal.svelte +++ b/src/lib/components/billing/estimatedTotal.svelte @@ -1,9 +1,11 @@ -{#if estimation} +{#if isDowngrade} +
+ +

+ Your change will take effect once your current billing cycle ends on {toLocaleDate($organization.billingNextInvoiceDate)}. +

+
+ +{:else if estimation}
{ if ($page.url.searchParams.has('coupon')) { - const coupon = $page.url.searchParams.get('coupon'); - try { - const response = await sdk.forConsole.billing.getCoupon(coupon); - couponData = response; - } catch (e) { - couponData = { - code: null, - status: null, - credits: null - }; - } + couponId = $page.url.searchParams.get('coupon'); } if ($page.url.searchParams.has('name')) { name = $page.url.searchParams.get('name'); @@ -152,7 +142,7 @@ billingPlan, paymentMethodId, null, - couponData?.code, + couponId, collaborators, billingBudget, taxId diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index 025d73986..35c358b60 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -360,12 +360,22 @@ {#if billingPlan !== BillingPlan.FREE && $organization.billingPlan !== billingPlan && $organization.billingPlan !== BillingPlan.CUSTOM && isUpgrade} {:else if $organization.billingPlan !== BillingPlan.CUSTOM} + {#if isDowngrade} + + {/if} {/if}