Skip to content

TaxNumberType introduces various issues #351

@saboter

Description

@saboter

Hello,

newly introduced TaxNumberType handling is not aligned with real-world uses cases and it also seem to have some glitches.

There are two issues:

  1. When syncing data the internal validation in Contact model fails because there is unexpected prefix:
def tax_number_type=(tax_number_type)
      validator = EnumAttributeValidator.new('String', ["SSN", "EIN", "ITIN", "ATIN"])
      unless validator.valid?(tax_number_type)
        fail ArgumentError, "invalid value for \"tax_number_type\", must be one of #{validator.allowable_values}."
      end
      @tax_number_type = tax_number_type
    end

It awaits clean type codes but instead in the data delivered by api for contact which has set tax number and tax number type contains prefix e.g. 'TAXNUMBERTYPE/EIN'. So the validation always fails if the tax number type is actually filled in Xero.

  1. It seems that for Xero US organization when uploading invoices is mandatory to provide also tax number and tax number type in contact section of payload or there is some other difference between UK and US. Because newly introduced validation failed only when uploading to US org not to UK one.

Since it is possible to also pick "None" tax number type in Xero web app and some of our users have all kinds of non-validated tax numbers in their data. So we need to detect the format and in some cases it is simply none of the valid number formats. The validation kind of needs also the "NONE" options to align it with web.

Image

Thank you and PF 2006

Martin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions