1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-18 02:41:15 +02:00

Showed sales tax amount on Go Premium screen (#774)

This commit is contained in:
Addison Beck 2021-01-14 17:53:46 -05:00 committed by GitHub
parent 2e22ca9216
commit 023bf0474c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 5 deletions

View File

@ -69,13 +69,22 @@
<br> {{'additionalStorageGb' | i18n}}: {{additionalStorage || 0}} GB &times; {{storageGbPrice | currency:'$'}} = {{additionalStorageTotal
| currency:'$'}}
<hr class="my-3">
<div class="text-lg">
<strong>{{'total' | i18n}}:</strong> {{total | currency:'USD $'}} /{{'year' | i18n}}
</div>
<small class="text-muted font-italic">{{'paymentChargedAnnually' | i18n}}</small>
<h2 class="spaced-header mb-4">{{'paymentInformation' | i18n}}</h2>
<app-payment [hideBank]="true"></app-payment>
<app-tax-info></app-tax-info>
<div id="price" class="my-4">
<div class="text-muted text-sm">
{{ 'planPrice' | i18n }}: {{ subtotal | currency: 'USD $' }}
<br />
<ng-container>
{{ 'estimatedTax' | i18n }}: {{ taxCharges | currency: 'USD $' }}
</ng-container>
</div>
<hr class="my-1 col-3 ml-0">
<p class="text-lg"><strong>{{'total' | i18n}}:</strong>
{{total | currency:'USD $'}}/{{'year' | i18n}}</p>
</div>
<small class="text-muted font-italic">{{'paymentChargedAnnually' | i18n}}</small>
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
<span>{{'submit' | i18n}}</span>

View File

@ -114,7 +114,17 @@ export class PremiumComponent implements OnInit {
return this.storageGbPrice * Math.abs(this.additionalStorage || 0);
}
get subtotal(): number {
return this.premiumPrice + this.additionalStorageTotal;
}
get taxCharges(): number {
return this.taxInfoComponent != null && this.taxInfoComponent.taxRate != null ?
(this.taxInfoComponent.taxRate / 100) * this.subtotal :
0;
}
get total(): number {
return this.additionalStorageTotal + this.premiumPrice;
return (this.subtotal + this.taxCharges) || 0;
}
}