BR-CO-17 — PDV u poreznom podzbroju nije točan
Uzrok, popravak i reproducirani XML primjer za BR-CO-17 u hrvatskom eRačunu.
Značenje i popravak
Iznos PDV-a za pojedinu poreznu grupu mora odgovarati njezinoj osnovici i stopi, uz propisano zaokruživanje. Provjera BR-CO-17 djeluje na porezni podzbroj, a ne samo na završni zbroj poreza cijelog dokumenta. Zato račun može imati uvjerljiv ukupni iznos i ipak sadržavati pogrešan porez jedne grupe.
U pozitivnom primjeru osnovica je 100 eura, stopa 25 posto i pripadajući porez 25 eura. Negativna inačica mijenja samo TaxSubtotal/TaxAmount na 27. Ostali iznosi ostaju jednaki pa se vidi i moguća posljedica na zbrajanje podzbrojeva. Popravak vraća porez grupe na 25. Pri stvarnom izvozu ponovno izračunaj porez iz odgovarajuće osnovice umjesto ručnog usklađivanja konačnog salda. Pregledaj ima li račun više stopa, više valuta ili troškove koji ulaze u različite porezne grupe. Iznos PDV-a izražen u obračunskoj valuti ima zasebnu ulogu i ne smije se zamijeniti podzbrojem u valuti računa. Decimalni zapis u XML-u koristi točku, ne hrvatski decimalni zarez iz prikaza računa. U izvještaju usporedi putanju i kod jer postoje različite provjere ukupnog poreza, iznosa grupe i konačnog iznosa s PDV-om. Ispravljeni primjer dokazuje aritmetički odnos u zadanom testu, bez potvrđivanja porezne klasifikacije stvarnog proizvoda.
Polje koje mijenja test
Za BR-CO-17 mijenja se samo /*/cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount. Struktura i atributi ostaju jednaki, a zamjenjuje se tekst odabranog elementa.
Reproducirani rezultat
Negativna datoteka: BR-CO-14, BR-CO-17, BR-S-09.
Ispravljena datoteka prolazi XSD i oba skupa poslovnih pravila. Upozorenja osnovnog profila ostaju vidljiva: UBL-CR-006, UBL-CR-200, UBL-CR-412.
{
"bad": {
"ok": false,
"stage": "Business rules",
"rules": "HR-CIUS/EXT 2025 1.0.0, 13.3.2026 (primjena 15.3.2026) + EN16931 1.3.16",
"syntax": "UBL",
"engine": "SaxonC-HE 13.1 / saxonche 13.1.1",
"errors": [
{
"code": "BR-CO-14",
"message": "[BR-CO-14]-Invoice total VAT amount (BT-110) = Σ VAT category tax amount (BT-117).",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:TaxTotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]"
},
{
"code": "BR-CO-17",
"message": "[BR-CO-17]-VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:TaxTotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:TaxSubtotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]"
},
{
"code": "BR-S-09",
"message": "[BR-S-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is \"Standard rated\" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119).",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:TaxTotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:TaxSubtotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:TaxCategory[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]"
}
],
"warnings": [
{
"code": "UBL-CR-006",
"message": "[UBL-CR-006]-A UBL invoice should not include the IssueTime",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]"
},
{
"code": "UBL-CR-200",
"message": "[UBL-CR-200]-A UBL invoice should not include the AccountingSupplierParty SellerContact",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]"
},
{
"code": "UBL-CR-412",
"message": "[UBL-CR-412]-A UBL invoice should not include the PaymentMeans PaymentDueDate",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]"
}
],
"truncated": false
},
"good": {
"ok": true,
"stage": "Business rules",
"rules": "HR-CIUS/EXT 2025 1.0.0, 13.3.2026 (primjena 15.3.2026) + EN16931 1.3.16",
"syntax": "UBL",
"engine": "SaxonC-HE 13.1 / saxonche 13.1.1",
"errors": [],
"warnings": [
{
"code": "UBL-CR-006",
"message": "[UBL-CR-006]-A UBL invoice should not include the IssueTime",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]"
},
{
"code": "UBL-CR-200",
"message": "[UBL-CR-200]-A UBL invoice should not include the AccountingSupplierParty SellerContact",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]"
},
{
"code": "UBL-CR-412",
"message": "[UBL-CR-412]-A UBL invoice should not include the PaymentMeans PaymentDueDate",
"path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]"
}
],
"truncated": false
}
}Izmišljeni XML za preuzimanje
Preuzmi pogrešan XML · Preuzmi ispravljeni XML
<ubl:Invoice xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cn="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:mfin.gov.hr:cius-2025:1.0#conformant#urn:mfin.gov.hr:ext-2025:1.0</cbc:CustomizationID>
<cbc:ProfileID>P1</cbc:ProfileID>
<cbc:ID>TEST-HR-2026-001</cbc:ID>
<cbc:IssueDate>2026-11-03</cbc:IssueDate>
<cbc:IssueTime>12:34:56</cbc:IssueTime>
<cbc:DueDate>2026-11-30</cbc:DueDate>
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="9934">12345678903</cbc:EndpointID>
<cac:PostalAddress>
<cbc:StreetName>Izmišljena ulica 1</cbc:StreetName>
<cbc:CityName>Zagreb</cbc:CityName>
<cbc:PostalZone>10000</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>HR</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>HR12345678903</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>XSDHub izmišljeni prodavatelj</cbc:RegistrationName>
<cbc:CompanyID>12345678903</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
<cac:SellerContact>
<cbc:ID>12345678903</cbc:ID>
<cbc:Name>Testni operater</cbc:Name>
</cac:SellerContact>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cac:Party>
<cbc:EndpointID schemeID="9934">98765432106</cbc:EndpointID>
<cac:PostalAddress>
<cbc:StreetName>Izmišljena ulica 1</cbc:StreetName>
<cbc:CityName>Zagreb</cbc:CityName>
<cbc:PostalZone>10000</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>HR</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>HR98765432106</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>XSDHub izmišljeni kupac</cbc:RegistrationName>
<cbc:CompanyID>98765432106</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:PaymentMeans>
<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>
<cbc:PaymentDueDate>2026-11-30</cbc:PaymentDueDate>
</cac:PaymentMeans>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="EUR">25.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">100.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">27.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>25</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">100.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">125.00</cbc:TaxInclusiveAmount>
<cbc:PayableAmount currencyID="EUR">125.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>Izmišljena usluga za provjeru</cbc:Name>
<cac:CommodityClassification>
<cbc:ItemClassificationCode listID="CG">62.10.11</cbc:ItemClassificationCode>
</cac:CommodityClassification>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>25</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">100.00</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
</ubl:Invoice>
<ubl:Invoice xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cn="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:mfin.gov.hr:cius-2025:1.0#conformant#urn:mfin.gov.hr:ext-2025:1.0</cbc:CustomizationID>
<cbc:ProfileID>P1</cbc:ProfileID>
<cbc:ID>TEST-HR-2026-001</cbc:ID>
<cbc:IssueDate>2026-11-03</cbc:IssueDate>
<cbc:IssueTime>12:34:56</cbc:IssueTime>
<cbc:DueDate>2026-11-30</cbc:DueDate>
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="9934">12345678903</cbc:EndpointID>
<cac:PostalAddress>
<cbc:StreetName>Izmišljena ulica 1</cbc:StreetName>
<cbc:CityName>Zagreb</cbc:CityName>
<cbc:PostalZone>10000</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>HR</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>HR12345678903</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>XSDHub izmišljeni prodavatelj</cbc:RegistrationName>
<cbc:CompanyID>12345678903</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
<cac:SellerContact>
<cbc:ID>12345678903</cbc:ID>
<cbc:Name>Testni operater</cbc:Name>
</cac:SellerContact>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cac:Party>
<cbc:EndpointID schemeID="9934">98765432106</cbc:EndpointID>
<cac:PostalAddress>
<cbc:StreetName>Izmišljena ulica 1</cbc:StreetName>
<cbc:CityName>Zagreb</cbc:CityName>
<cbc:PostalZone>10000</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>HR</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>HR98765432106</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>XSDHub izmišljeni kupac</cbc:RegistrationName>
<cbc:CompanyID>98765432106</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:PaymentMeans>
<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>
<cbc:PaymentDueDate>2026-11-30</cbc:PaymentDueDate>
</cac:PaymentMeans>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="EUR">25.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">100.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">25.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>25</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">100.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">125.00</cbc:TaxInclusiveAmount>
<cbc:PayableAmount currencyID="EUR">125.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>Izmišljena usluga za provjeru</cbc:Name>
<cac:CommodityClassification>
<cbc:ItemClassificationCode listID="CG">62.10.11</cbc:ItemClassificationCode>
</cac:CommodityClassification>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>25</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">100.00</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
</ubl:Invoice>
Uvjet iz izvornih pravila
[
{
"source": "EN16931 1.3.16 expanded source",
"kind": "assert",
"context": "cac:TaxTotal/cac:TaxSubtotal",
"test": "(round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) = 0 and (round(xs:decimal(cbc:TaxAmount)) = 0)) or (round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) != 0 and ((abs(xs:decimal(cbc:TaxAmount)) - 1 < round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ) and (abs(xs:decimal(cbc:TaxAmount)) + 1 > round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ))) or (not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent))) and (round(xs:decimal(cbc:TaxAmount)) = 0))",
"message": "[BR-CO-17]-VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals."
}
]UBL 2.1 Invoice / CreditNote · EN16931 1.3.16 · HR-CIUS/EXT 13.3.2026, primjena 15.3.2026 · XSD + Schematron #ALL
Provjeri vlastiti XML · Sva pravila
Porezna uprava: dokumentacija · Izvori / Sources · JSON: testovi · Metoda i granice (Hrvatski)