diff --git a/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.mjs b/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.mjs index 15f5257a99..a78486d15f 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.mjs +++ b/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.mjs @@ -320,30 +320,18 @@ async function buildUsersSubscriptionViewModel(user, locale = 'en') { throw new Error(`No plan found for planCode '${pendingPlanCode}'`) } let pendingAdditionalLicenses = 0 - let pendingAddOnTax = 0 - let pendingAddOnPrice = 0 + if (paymentRecord.subscription.pendingChange.nextAddOns) { const pendingAddOns = paymentRecord.subscription.pendingChange.nextAddOns pendingAddOns.forEach(addOn => { - pendingAddOnPrice += addOn.quantity * addOn.unitPrice if (addOn.code === pendingPlan.membersLimitAddOn) { pendingAdditionalLicenses += addOn.quantity } }) - // Need to calculate tax ourselves as we don't get tax amounts for pending subs - pendingAddOnTax = - personalSubscription.payment.taxRate * pendingAddOnPrice - pendingPlan.addOns = pendingAddOns } - const pendingSubscriptionTax = - personalSubscription.payment.taxRate * - paymentRecord.subscription.pendingChange.nextPlanPrice - const totalPrice = - paymentRecord.subscription.pendingChange.nextPlanPrice + - pendingAddOnPrice + - pendingAddOnTax + - pendingSubscriptionTax + + const totalPrice = paymentRecord.subscription.planPrice + addOnPrice + tax personalSubscription.payment.displayPrice = formatCurrency( totalPrice, diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 114e10c144..a840372212 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1299,6 +1299,7 @@ "pending_additional_licenses": "", "pending_addon_cancellation": "", "pending_invite": "", + "pending_subscription_message": "", "per_license": "", "per_month": "", "per_month_x_annually": "", diff --git a/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx b/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx index 034162d368..c4b5acb5ff 100644 --- a/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx +++ b/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx @@ -186,10 +186,6 @@ export function ActiveSubscription({

{t('plan')}

{planName}

- {subscription.pendingPlan && - subscription.pendingPlan.name !== subscription.plan.name && ( -

{t('want_change_to_apply_before_plan_end')}

- )} {isInFreeTrial(subscription.payment.trialEndsAt) && subscription.payment.trialEndsAtFormatted && ( )} + + {subscription.pendingPlan && + subscription.pendingPlan.name !== subscription.plan.name && ( +

{t('want_change_to_apply_before_plan_end')}

+ )} + {!recurlyLoadError && ( + {hasPendingPlan && ( + + , + ]} + /> + + } + type="success" + /> + )} {fromPlansPage && ( __pendingAdditionalLicenses__ additional license(s) for a total of <1>__pendingTotalLicenses__ licenses.", "pending_addon_cancellation": "Your subscription will change to remove the __addOnName__ add-on at the end of the current billing period.", "pending_invite": "Pending invite", + "pending_subscription_message": "You’ve switched to <0>__planName__. This change will come into effect on <0>__activationDate__ at the end of your current billing cycle. When your plan switches, your billing and subscription information will be updated.", "per_license": "per license", "per_month": "per month", "per_month_billed_annually": "per month, billed annually", diff --git a/services/web/test/unit/src/Subscription/SubscriptionViewModelBuilder.test.mjs b/services/web/test/unit/src/Subscription/SubscriptionViewModelBuilder.test.mjs index a464f5e2ca..da4a536899 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionViewModelBuilder.test.mjs +++ b/services/web/test/unit/src/Subscription/SubscriptionViewModelBuilder.test.mjs @@ -999,13 +999,10 @@ describe('SubscriptionViewModelBuilder', function () { await ctx.SubscriptionViewModelBuilder.promises.buildUsersSubscriptionViewModel( ctx.user ) - assert.equal( - result.personalSubscription.payment.displayPrice, - '€1,756.92' - ) + assert.equal(result.personalSubscription.payment.displayPrice, '€16.50') assert.equal( result.personalSubscription.payment.planOnlyDisplayPrice, - '€1,754.72' + '€14.30' ) assert.deepEqual( result.personalSubscription.payment