HR-BR-25

Stavka …: Svaki artikl MORA imati identifikator klasifikacije artikla iz sheme Klasifikacija proizvoda po djelatnostima: KPD (CPA) – listID „CG“, osim u slučaju računa za predujam i odobrenja.

In English Each item must have an item classification identifier from the KPD (CPA) scheme, listID "CG", except on prepayment invoices and credit notes.

error: the document is invalid

Why it fails

  • A cac:Item has no cac:CommodityClassification/cbc:ItemClassificationCode.
  • The classification code has another listID; Croatia wants the KPD classification, listID="CG".

How to fix it

Add <cac:CommodityClassification><cbc:ItemClassificationCode listID="CG">…</cbc:ItemClassificationCode></cac:CommodityClassification> to each item, with the item's KPD code. Prepayment invoices and credit notes may leave it out.

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Context
cac:Item
Test
(exists(cac:CommodityClassification/cbc:ItemClassificationCode) and (cac:CommodityClassification/cbc:ItemClassificationCode/@listID = 'CG')) or (not(exists(cac:CommodityClassification/cbc:ItemClassificationCode)) and $documentTypeCode[contains(' 386 81 83 261 262 296 308 381 396 420 458 532 ', concat(' ', normalize-space(.), ' '))]) or ($documentTypeCode[contains(' 386 81 83 261 262 296 308 381 396 420 458 532 ', concat(' ', normalize-space(.), ' '))] and (cac:CommodityClassification/cbc:ItemClassificationCode/@listID != 'CG'))

Checked with Croatia eRačun Invoice (UBL), Croatia eRačun Credit Note (UBL)