cadrumo.domain.iva.identification module¶
Resolve which Member State a party is IVA-identified in — never where it is established.
Separate from establishment because the two answer legally distinct
questions, and conflating them is the defect this module exists to end. A
document printing DE811234567 states two things that look like one: that the
party operates under a German IVA identification, and — the reader’s inference —
that the party is in Germany. Only the first is evidence.
Registration IS the identification fact, so a printed prefix is decisive
here. Where establishment refuses to let the same prefix settle a
place on its own – the establishment ladder reaches a territory only once a
printed country name or postal code corroborates one – this module treats it as
what it actually is: the Member State under whose identification the party
operates, stated by the party itself on its own invoice. There is nothing to
corroborate, because nothing further is being claimed.
And it establishes NOTHING about establishment, symmetrically on both sides.
Every Member State registers non-residents on the same terms Spain does, so a
German number is exactly as compatible with a sede de actividad económica in
Spain as a Spanish N-leader CIF is with one in Germany (Ley 37/1992
arts. 69–70). The asymmetry that made a foreign prefix decisive for place while
a Spanish one was correctly refused is closed by splitting the fact, not by
demanding corroboration on one side of it.
Spain cannot arise from a printed IVA number here, and that is a property of
the prefix vocabulary rather than a judgement made in this module: Spanish
identifiers are checksum identifiers routed through the Spanish tax-id validator
and ES is absent from NifIvaPrefix. A Spanish
identification is therefore established from the Spanish identifier authority or
declared, never inferred here.
That absence is an implementation boundary, not a statement that the evidence
does not exist. This path recognises a prefix by matching the number’s body
against the structural pattern its own prefix claims, and a Spanish identifier is
validated by the AEAT control-letter checksum instead – so ES could not join
the vocabulary as a pattern the way its siblings did. Whether it SHOULD join,
through the checksum validator this codebase already ships, is an open scope
question about the axis rather than a settled refusal, and the earlier wording
here read as the latter.
See also
IvaTerritorialScopeThe OTHER party fact — where the party is established. A value here never implies one there.
PartyFactThe closed pair, and the axis a classification branch declares it consumes.
- identification_state_for_printed_tax_identifier(printed_identifier, *, operation)[source]¶
Return the Member State a printed IVA number identifies the party in.
A composition rather than a second rule set:
_establishment.country_code_for_printed_tax_identifier()stays the single authority on which country a printed number NAMES — including the GreekEL/GRdivergence and the requirement that the number’s body match the structure its own prefix claims — and this adds only the step from that ISO code to the closed catalogue.- Parameters:
printed_identifier (
str|None) – The identifier as transcribed, orNone.operation (
PinnedAuthorityOperation) – Caller-owned pinned authority operation for the country and member-state catalogues used by this lookup.
- Return type:
- Returns:
The
EUMemberStatethe number identifies the party in, orNonewhen no IVA number was recognised.Nonemeans the identification was not established, never that the party is identified nowhere and above all never that it is identified in Spain: a document printing a bare SpanishB-CIF prints no prefix at all, so reading absence as a Spanish identification would manufacture the fact from its own silence.