1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00: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
2 changed files with 6 additions and 23 deletions

View File

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