Skip to content

Commit

Permalink
Revert "[PM-16664] Fix annual pricing for billable providers (#12662)" (
Browse files Browse the repository at this point in the history
#12677)

This reverts commit b0f5971.
  • Loading branch information
jonashendrickx authored Jan 3, 2025
1 parent b0f5971 commit 27e3f72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 27e3f72

Please sign in to comment.