1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-20 21:01:29 +01:00

Revert "[PM-16664] Fix annual pricing for billable providers (#12662)" (#12677)

This reverts commit b0f5971287.
This commit is contained in:
Jonas Hendrickx 2025-01-03 10:46:35 +01:00 committed by GitHub
parent b0f5971287
commit 27e3f72e04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 23 deletions

View File

@ -38,14 +38,12 @@
}}
</td>
<td bitCell class="tw-text-right tw-py-3">
{{
((100 - subscription.discountPercentage) / 100) * getMonthlyCost(i)
| currency: "$"
{{ ((100 - subscription.discountPercentage) / 100) * i.cost | currency: "$" }} /{{
"month" | i18n
}}
/ {{ "month" | i18n }}
<div *ngIf="subscription.discountPercentage">
<bit-hint class="tw-text-sm tw-line-through">
{{ getMonthlyCost(i) | currency: "$" }} / {{ "month" | i18n }}
{{ i.cost | currency: "$" }} /{{ "month" | i18n }}
</bit-hint>
</div>
</td>
@ -54,8 +52,9 @@
<tr bitRow>
<td bitCell class="tw-pl-0 tw-py-3"></td>
<td bitCell class="tw-text-right">
<span class="tw-font-bold">Total:</span>
{{ getTotalMonthlyCost() | currency: "$" }} / {{ "month" | i18n }}
<span class="tw-font-bold">Total:</span> {{ totalCost | currency: "$" }} /{{
"month" | i18n
}}
</td>
</tr>
</ng-container>

View File

@ -113,20 +113,4 @@ export class ProviderSubscriptionComponent implements OnInit, OnDestroy {
}
});
}
protected getMonthlyCost(plan: ProviderPlanResponse): number {
return plan.cadence === "Monthly" ? plan.cost : plan.cost / 12;
}
protected getDiscountedMonthlyCost(plan: ProviderPlanResponse): number {
return ((100 - this.subscription.discountPercentage) / 100) * this.getMonthlyCost(plan);
}
protected getTotalMonthlyCost(): number {
let totalCost: number = 0;
for (const plan of this.subscription.plans) {
totalCost += this.getDiscountedMonthlyCost(plan);
}
return totalCost;
}
}