mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
This reverts commit b0f5971287.
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user