Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML invoice in extended format with UNECE Tax Category [AA] Lower rate is not valid #355

Open
piemar1 opened this issue Dec 12, 2023 · 1 comment

Comments

@piemar1
Copy link

piemar1 commented Dec 12, 2023

Description

I have created xml invoice with the use of Odoo 16.0 software + OCA module account_invoice_facturx.
Invoice contains 1 line with 7% tax with Category Code "AA" - >> see attachment.

INV-2023-00097.txt

I tried to validate this invoice with Mustang, with different configurations. Each time without success.
Most problematic issue was visible below "Value of 'ram:CategoryCode' is not allowed."

java -jar Mustang-CLI-2.9.0.jar --action validate --source ./new_inv/INV-2023-00097.xml 
11:23:10.454 [main] INFO  c.h.s.x.SchematronResourceXSLTCache - Compiling XSLT instance [cpPath=/xslt/ZF_221/FACTUR-X_EXTENDED.xslt; urlResolved=true; URL=jar:file:/home/piemar/Pulpit/hs/addons-din/Mustang/Mustang-CLI-2.9.0.jar!/xslt/ZF_221/FACTUR-X_EXTENDED.xslt]
11:23:15.897 [main] INFO  o.m.validator.XMLValidator - FailedAssert 
11:23:15.902 [main] ERROR o.m.validator.ZUGFeRDValidator - Error 4: 
	Value of 'ram:CategoryCode' is not allowed. from /xslt/ZF_221/FACTUR-X_EXTENDED.xslt)
11:23:15.903 [main] INFO  o.m.validator.XMLValidator - FailedAssert 
11:23:15.903 [main] ERROR o.m.validator.ZUGFeRDValidator - Error 4: 
	Value of 'ram:CategoryCode' is not allowed. from /xslt/ZF_221/FACTUR-X_EXTENDED.xslt)
11:23:15.918 [main] INFO  o.m.validator.ZUGFeRDValidator - Parsed PDF:absent XML:invalid Signature:null Checksum:A713B1DA21A09E898622F4DCD6167BBF588236B2 Profile:urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended Version:2 Took:5648ms Errors:[4,4] 
<?xml version="1.0" encoding="UTF-8"?>

<validation filename="INV-2023-00097.xml" datetime="2023-12-12 11:23:10">
  <xml>
    <info>
      <version>2</version>
      <profile>urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended</profile>
      <validator version="2.9.0"/>
      <rules>
        <fired>50</fired>
        <failed>2</failed>
      </rules>
      <duration unit="ms">5584</duration>
    </info>
    <messages>
      <error type="4" location="/*[local-name()='CrossIndustryInvoice']/*[local-name()='SupplyChainTradeTransaction']/*[local-name()='ApplicableHeaderTradeSettlement']/*[local-name()='ApplicableTradeTax']/*[local-name()='CategoryCode']" criterion="document('FACTUR-X_EXTENDED_codedb.xml')//cl[@id=27]/enumeration[@value=$codeValue27]">Value of 'ram:CategoryCode' is not allowed. from /xslt/ZF_221/FACTUR-X_EXTENDED.xslt)</error>  
      <error type="4" location="/*[local-name()='CrossIndustryInvoice']/*[local-name()='SupplyChainTradeTransaction']/*[local-name()='IncludedSupplyChainTradeLineItem']/*[local-name()='SpecifiedLineTradeSettlement']/*[local-name()='ApplicableTradeTax']/*[local-name()='CategoryCode']" criterion="document('FACTUR-X_EXTENDED_codedb.xml')//cl[@id=15]/enumeration[@value=$codeValue15]">Value of 'ram:CategoryCode' is not allowed. from /xslt/ZF_221/FACTUR-X_EXTENDED.xslt)</error> 
    </messages>
    <summary status="invalid"/>
  </xml>
  <messages></messages>
  <summary status="invalid"/>
</validation>

Expected behavior

Question is how we can prepare and validate invoice with tax of Category Code "AA" ? Or the invoice is correct, only there need to be some changes in Mustang (configuration / code) ?

@jstaerk
Copy link
Collaborator

jstaerk commented Dec 12, 2023

untdid 5305 says AA=lower rate. I usually use S=Standard rate. It's not neccessary the default rate but as far as I understood this is ment to express why no tax at all applies, if that is the case. And no, AA is apparently not valid :-(

I believe already EN16931 may have restricted 5305 to a subset: in the full listing of the codes on https://ec.europa.eu/digital-building-blocks/sites/display/DIGITAL/Registry+of+supporting+artefacts+to+implement+EN16931 you will also see that tab 5305 has no AA.

The extended profile apparently has not re-introduced it.
Page 55 the technical annex of the factur-x spec (zugferd infopaket, documentation 2. FACTUR-X 1.0.06 Technischer-Anhang.pdf) details

The following entries of UNTDID 5305 are used (detailed information in brackets):

  • standard rate (sales tax comes up in standard rate);
  • goods taxable by zero rate (sales tax comes up with a percentage of zero);
  • tax-exempt (USt./IGIC/IPSI);
  • reverse charge (rules of reverse charge apply with USt./IGIC/IPSI);
  • sales tax-exempt for intra-community delivery of goods (USt./IGIC/IPSI no tax demanded for intra-community delivery);
  • free article of exportation, no tax demanded (USt./IGIC/ IPSI not demanded based on export beyond Europe);
  • services beyond tax application area (sale is not underlying USt./IGIC/IPSI)
  • general indirect tax levied in the Canaries (IGIC-tax comes up);
  • IPSI (tax for Ceuta/Melilla) comes up.
    Synonym: Tax category
    Cardinality: 1 .. 1
    EN16931-ID: BT-151
    Use: The codes for sales tax category are:
  • S = standard rate
  • Z = zero rated
  • E = tax-exempt
  • AE = VAT reverse charge
  • K = VAT exempt for EEA intra-community supply of goods and services
  • G = Free export item, tax not charged
  • O = Services outside scope of tax
  • L = Canary Islands general indirect tax
  • M = Tax for production, services and importation in Ceuta and Melilla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants