[AC-1404] incorrect pricing shows for 2019 teams customers (#6462)
* Refactor seat count calculation in subscription adjust component * Defaulting additionalSeatCount to 0 when falsy
This commit is contained in:
parent
462daab322
commit
c411e1f03b
|
@ -14,7 +14,7 @@
|
|||
required
|
||||
/>
|
||||
<small class="d-block text-muted mb-4">
|
||||
<strong>{{ "total" | i18n }}:</strong> {{ newSeatCount || 0 }} ×
|
||||
<strong>{{ "total" | i18n }}:</strong> {{ additionalSeatCount || 0 }} ×
|
||||
{{ seatPrice | currency : "$" }} = {{ adjustedSeatTotal | currency : "$" }} /
|
||||
{{ interval | i18n }}
|
||||
</small>
|
||||
|
@ -50,7 +50,7 @@
|
|||
[required]="limitSubscription"
|
||||
/>
|
||||
<small class="d-block text-muted">
|
||||
<strong>{{ "maxSeatCost" | i18n }}:</strong> {{ newMaxSeats || 0 }} ×
|
||||
<strong>{{ "maxSeatCost" | i18n }}:</strong> {{ additionalMaxSeatCount || 0 }} ×
|
||||
{{ seatPrice | currency : "$" }} = {{ maxSeatTotal | currency : "$" }} /
|
||||
{{ interval | i18n }}
|
||||
</small>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue