Skip to content

Commit

Permalink
fix(TaxForms): use residency country for chapter 3 (#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree authored Dec 13, 2024
1 parent 29552e6 commit 84515da
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions lib/tax-forms/w8-ben.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@ import { getCountryName } from '../i18n';

const W8BenFieldsDefinition: Partial<Record<keyof W8BenTaxFormValues, PDFFieldDefinition>> = {
beneficialOwner: { formPath: 'topmostSubform[0].Page1[0].f_1[0]', transform: getFullName },
countryOfCitizenship: {
type: 'multi',
fields: [
{ formPath: 'topmostSubform[0].Page1[0].f_2[0]', transform: getCountryName },
{
formPath: 'topmostSubform[0].Page1[0].f_13[0]',
transform: getCountryName,
if: (value, values) => values.claimsSpecialRatesAndConditions && values.certifiesResidentCountry,
},
],
},
countryOfCitizenship: { formPath: 'topmostSubform[0].Page1[0].f_2[0]', transform: getCountryName },
residenceAddress: {
type: 'multi',
fields: [
Expand All @@ -35,6 +25,11 @@ const W8BenFieldsDefinition: Partial<Record<keyof W8BenTaxFormValues, PDFFieldDe
transform: (value: W8BenTaxFormValues['residenceAddress']) =>
[value?.structured?.city, value?.structured?.zone, value?.structured?.postalCode].filter(Boolean).join(', '),
},
{
formPath: 'topmostSubform[0].Page1[0].f_13[0]',
transform: (value) => getCountryName(value?.country),
if: (value, values) => values.claimsSpecialRatesAndConditions && values.certifiesResidentCountry,
},
],
},
mailingAddress: {
Expand Down

0 comments on commit 84515da

Please sign in to comment.