diff --git a/apps/web/src/app/billing/organizations/adjust-subscription.component.html b/apps/web/src/app/billing/organizations/adjust-subscription.component.html index 148d507a6a8..6f0da673758 100644 --- a/apps/web/src/app/billing/organizations/adjust-subscription.component.html +++ b/apps/web/src/app/billing/organizations/adjust-subscription.component.html @@ -14,7 +14,7 @@ required /> - {{ "total" | i18n }}: {{ newSeatCount || 0 }} × + {{ "total" | i18n }}: {{ additionalSeatCount || 0 }} × {{ seatPrice | currency : "$" }} = {{ adjustedSeatTotal | currency : "$" }} / {{ interval | i18n }} @@ -50,7 +50,7 @@ [required]="limitSubscription" /> - {{ "maxSeatCost" | i18n }}: {{ newMaxSeats || 0 }} × + {{ "maxSeatCost" | i18n }}: {{ additionalMaxSeatCount || 0 }} × {{ seatPrice | currency : "$" }} = {{ maxSeatTotal | currency : "$" }} / {{ interval | i18n }} diff --git a/apps/web/src/app/billing/organizations/adjust-subscription.component.ts b/apps/web/src/app/billing/organizations/adjust-subscription.component.ts index c82f30665d6..a6f67e0138a 100644 --- a/apps/web/src/app/billing/organizations/adjust-subscription.component.ts +++ b/apps/web/src/app/billing/organizations/adjust-subscription.component.ts @@ -38,8 +38,10 @@ export class AdjustSubscription { async submit() { try { - const seatAdjustment = this.newSeatCount - this.currentSeatCount; - const request = new OrganizationSubscriptionUpdateRequest(seatAdjustment, this.newMaxSeats); + const request = new OrganizationSubscriptionUpdateRequest( + this.additionalSeatCount, + this.newMaxSeats + ); this.formPromise = this.organizationApiService.updatePasswordManagerSeats( this.organizationId, request @@ -64,11 +66,19 @@ export class AdjustSubscription { } } + get additionalSeatCount(): number { + return this.newSeatCount ? this.newSeatCount - this.currentSeatCount : 0; + } + + get additionalMaxSeatCount(): number { + return this.newMaxSeats ? this.newMaxSeats - this.currentSeatCount : 0; + } + get adjustedSeatTotal(): number { - return this.newSeatCount * this.seatPrice; + return this.additionalSeatCount * this.seatPrice; } get maxSeatTotal(): number { - return this.newMaxSeats * this.seatPrice; + return this.additionalMaxSeatCount * this.seatPrice; } }