Skip to content

Inconsistent behavior with country prefixes #485

@Jakub-Wilk

Description

@Jakub-Wilk

As far as I can tell from a bit of research (although I'm not 100% sure), the domestic form of both the Polish NIP and Romanian CF numbers are digits only, and a country prefix can be optionally added to the beginning when using it as an EU VAT number.

The NIP validator behaves like I would expect it to - the documentation says it should return "a compact, consistent representation of the number or code", and it does so - it always returns the domestic form of the number, without the country prefix. The CF validator, however, returns whatever it was passed - if you pass in a country-prefixed number, it outputs a country-prefixed number, and vice versa for a domestic number.

It's hard to rely on the output of the library when for some countries the format of the output depends on the format of the input. I don't know if this is just an issue of the Romanian validator, or a wider issue, but I think it warrants being checked out and corrected, so that the output is indeed compact and consistent.

Small side note: ro/cf.py is also missing checksum validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions