stadlar / GRV-TS236-peppol-invoice

0 stars 0 forks source link

Mod 11 #1

Open midran opened 3 years ago

midran commented 3 years ago

Kom inn í Peppol sem PEPPOL-4204 frá Henrik Mölle sem er hjá InExchange í Svíþjóð.

Hann leggur til að Ísland bæti inn mod 11 check á kennitöluna. Reynar væri hentugar að setja slíkt tékk inn sem Peppol common rule frekar en að hafa það sem sér íslenska reglu. Ég átta mig ekki á því hvaða vangaveltur hann er með varðandi reglu 002 og 004

In the latest Release Note there is stated.. "Added Icelandic seller country specific rule in accordance with Peppol methodology https://docs.peppol.eu/poacc/billing/3.0/national-rules/"

But. When looking in the rules, IS-R-002 and IS-R-004 there is introduced new types of validation, that "breaks" or maybe interfere is a better word, with the rules for https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AccountingSupplierParty/cac-Party/cac-PartyLegalEntity/cbc-CompanyID/schemeID/

Why not use the same type of rules as for e.g. DK or SE? Isn't there a MOD 11 check for the kennitala if I don't remember wrong, that should/could be used instead?

midran commented 3 years ago

The formal specification from the Registrar is here https://www.skra.is/folk/eg-i-thjodskra/um-kennitolur/

Expressed as a formula it is something like this.

An Icelandic ID is always numerical and 10 digits where each position can expressed as abcdefghij

Let stringsum = ax3 + bx2 + cx7 + dx6 + ex5 + fx4 + gx3 + hx2 Let modnum = 11 - (stingsum - INTERGER(stringsum/11) x 11)

Then

i = IF modnum = 11 THEN 0 ELSE modnum

and

j = {8, 9, 0}

Although not stated on the page is should also hold true tha cd is between 01 and 12 and that gh => 20

Note that the first digit can be a 0 in which case a = 0, i.e. the zero may not be dropped despite being first digit in a numerical string.

midran commented 3 years ago

Fundur 2021-09-22.

midran commented 3 years ago

Formúla í fyrra commenti löguð til að taka tillit til þess þegar útkoma úr modulus check er 11 en þá er vartalan 0