Skip to content

Add Dutch Taxpayer Identification Number #3077

Open
@bart-westenenk-bex

Description

@bart-westenenk-bex

Specification can be source from:
https://taxation-customs.ec.europa.eu/online-services/online-services-and-databases-taxation/taxpayer-identification-number-tin_en

        check = 10
        while check == 10
          # Generate a random 8 digit number
          tin_number = rand((10**7)..((10**8) - 1)).to_s

          multipliers =
            9
              .downto(2)
              .each_with_index
              .map { |multiplier, position| multiplier * tin_number[position].to_i }

          check = multipliers.sum % 11
        end

        tin_number.to_s + check.to_s

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