From fe0ef5aad74a6f64309aadb1d22b5d46388d98fe Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:57:50 -0400 Subject: [PATCH] Clear VAT/GST info when box is unchecked (#6338) --- .../billing/settings/tax-info.component.ts | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/web/src/app/billing/settings/tax-info.component.ts b/apps/web/src/app/billing/settings/tax-info.component.ts index df5ddfa0a0..af47a6821e 100644 --- a/apps/web/src/app/billing/settings/tax-info.component.ts +++ b/apps/web/src/app/billing/settings/tax-info.component.ts @@ -125,14 +125,22 @@ export class TaxInfoComponent { getTaxInfoRequest(): TaxInfoUpdateRequest { if (this.organizationId) { const request = new OrganizationTaxInfoUpdateRequest(); - request.taxId = this.taxInfo.taxId; - request.state = this.taxInfo.state; - request.line1 = this.taxInfo.line1; - request.line2 = this.taxInfo.line2; - request.city = this.taxInfo.city; - request.state = this.taxInfo.state; - request.postalCode = this.taxInfo.postalCode; request.country = this.taxInfo.country; + request.postalCode = this.taxInfo.postalCode; + + if (this.taxInfo.includeTaxId) { + request.taxId = this.taxInfo.taxId; + request.line1 = this.taxInfo.line1; + request.line2 = this.taxInfo.line2; + request.city = this.taxInfo.city; + request.state = this.taxInfo.state; + } else { + request.taxId = null; + request.line1 = null; + request.line2 = null; + request.city = null; + request.state = null; + } return request; } else { const request = new TaxInfoUpdateRequest();