From cdc82f13b0147202f1e8dd71a5c9870bc60efece Mon Sep 17 00:00:00 2001 From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:36:40 +0100 Subject: [PATCH] Resolve the seat adjustment issue (#10265) --- .../organizations/adjust-subscription.component.html | 8 +++++--- .../organizations/adjust-subscription.component.ts | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) 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 9fe8d20540..61197e86d2 100644 --- a/apps/web/src/app/billing/organizations/adjust-subscription.component.html +++ b/apps/web/src/app/billing/organizations/adjust-subscription.component.html @@ -5,8 +5,9 @@ {{ "subscriptionSeats" | i18n }} - {{ "total" | i18n }}: {{ additionalSeatCount || 0 }} × - {{ seatPrice | currency: "$" }} = {{ adjustedSeatTotal | currency: "$" }} / + {{ "total" | i18n }}: + {{ adjustSubscriptionForm.value.newSeatCount || 0 }} × + {{ seatPrice | currency: "$" }} = {{ seatTotalCost | currency: "$" }} / {{ interval | i18n }} @@ -43,7 +44,8 @@ step="1" /> - {{ "maxSeatCost" | i18n }}: {{ additionalMaxSeatCount || 0 }} × + {{ "maxSeatCost" | i18n }}: + {{ adjustSubscriptionForm.value.newMaxSeats || 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 b843c79cb9..c98a6b97c4 100644 --- a/apps/web/src/app/billing/organizations/adjust-subscription.component.ts +++ b/apps/web/src/app/billing/organizations/adjust-subscription.component.ts @@ -99,11 +99,12 @@ export class AdjustSubscription implements OnInit, OnDestroy { : 0; } - get adjustedSeatTotal(): number { - return this.additionalSeatCount * this.seatPrice; + get maxSeatTotal(): number { + return Math.abs((this.adjustSubscriptionForm.value.newMaxSeats ?? 0) * this.seatPrice); } - get maxSeatTotal(): number { - return this.additionalMaxSeatCount * this.seatPrice; + get seatTotalCost(): number { + const totalSeat = Math.abs(this.adjustSubscriptionForm.value.newSeatCount * this.seatPrice); + return totalSeat; } }