diff --git a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html index 72067253011..8a22e964d43 100644 --- a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html +++ b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html @@ -7,7 +7,9 @@

{{ "createNewClientToManageAsProvider" | i18n }}

{{ "selectAPlan" | i18n }} - {{ "thirtyFivePercentDiscount" | i18n }} + {{ + "providerDiscount" | i18n: this.discountPercentage + }}
diff --git a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts index 8c013674bdb..987b7cc6982 100644 --- a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts +++ b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts @@ -42,6 +42,7 @@ type PlanCard = { templateUrl: "./create-client-dialog.component.html", }) export class CreateClientDialogComponent implements OnInit { + protected discountPercentage: number; protected formGroup = new FormGroup({ clientOwnerEmail: new FormControl("", [Validators.required, Validators.email]), organizationName: new FormControl("", [Validators.required]), @@ -96,27 +97,31 @@ export class CreateClientDialogComponent implements OnInit { } async ngOnInit(): Promise { - const subscription = await this.billingApiService.getProviderSubscription( + const response = await this.billingApiService.getProviderSubscription( this.dialogParams.providerId, ); - this.providerPlans = subscription?.plans ?? []; + + this.providerPlans = response?.plans ?? []; const teamsPlan = this.dialogParams.plans.find((plan) => plan.type === PlanType.TeamsMonthly); const enterprisePlan = this.dialogParams.plans.find( (plan) => plan.type === PlanType.EnterpriseMonthly, ); + this.discountPercentage = response.discountPercentage; + const discountFactor = this.discountPercentage ? (100 - this.discountPercentage) / 100 : 1; + this.planCards = [ { name: this.i18nService.t("planNameTeams"), - cost: teamsPlan.PasswordManager.providerPortalSeatPrice * 0.65, // 35% off for MSPs, + cost: teamsPlan.PasswordManager.providerPortalSeatPrice * discountFactor, type: teamsPlan.type, plan: teamsPlan, selected: true, }, { name: this.i18nService.t("planNameEnterprise"), - cost: enterprisePlan.PasswordManager.providerPortalSeatPrice * 0.65, // 35% off for MSPs, + cost: enterprisePlan.PasswordManager.providerPortalSeatPrice * discountFactor, type: enterprisePlan.type, plan: enterprisePlan, selected: false, diff --git a/bitwarden_license/bit-web/src/app/billing/providers/subscription/provider-subscription.component.html b/bitwarden_license/bit-web/src/app/billing/providers/subscription/provider-subscription.component.html index d4474953872..0aaa3cc03ae 100644 --- a/bitwarden_license/bit-web/src/app/billing/providers/subscription/provider-subscription.component.html +++ b/bitwarden_license/bit-web/src/app/billing/providers/subscription/provider-subscription.component.html @@ -41,7 +41,7 @@ {{ ((100 - subscription.discountPercentage) / 100) * i.cost | currency: "$" }} /{{ "month" | i18n }} -
+
{{ i.cost | currency: "$" }} /{{ "month" | i18n }}