Giter VIP home page Giter VIP logo

Comments (14)

phax avatar phax commented on May 24, 2024

Hi. Can you please provide the whole InvoiceLine - so far I don't see the problem. Okay, PriceAmount has more than 2 digits, but LineExtensionAmount has no. E.g. the following example works for me:

    <cac:InvoiceLine>
        <cbc:ID>1</cbc:ID>
        <cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
        <cbc:LineExtensionAmount currencyID="EUR">19.90</cbc:LineExtensionAmount>
        <cac:Item>
            <cbc:Name>PATAT FRITES 10MM 10KG</cbc:Name>
            <cac:SellersItemIdentification>
                <cbc:ID>166022</cbc:ID>
            </cac:SellersItemIdentification>
            <cac:ClassifiedTaxCategory>
                <cbc:ID>S</cbc:ID>
                <cbc:Percent>6</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VA</cbc:ID>
                </cac:TaxScheme>
            </cac:ClassifiedTaxCategory>
       </cac:Item>
        <cac:Price>
            <cbc:PriceAmount currencyID="EUR">9.9473</cbc:PriceAmount>
        </cac:Price>
    </cac:InvoiceLine>

from einvoicing-en16931.

jurajmarkovic avatar jurajmarkovic commented on May 24, 2024

Hi,
thanks for your fast reply. I will try to explain more precisely what seems to me could be a problem.
PriceAmount has more than 2 digits (and this is OK), but also Price discount has more than 2 digits and this seems to be a problem (InvoiceLine/Price/AllowanceCharge/Amount and BaseAmount). Here is the whole InvoiceLine

<cac:InvoiceLine>
	<cbc:ID>1</cbc:ID>
	<cbc:InvoicedQuantity unitCode="EA">100.000</cbc:InvoicedQuantity>
	<cbc:LineExtensionAmount currencyID="HRK">12.12</cbc:LineExtensionAmount>
	<cac:Item>
		<cbc:Name>stavka 1</cbc:Name>
		<cac:OriginCountry>
			<cbc:IdentificationCode>HR</cbc:IdentificationCode>
		</cac:OriginCountry>
		<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="HRK">0.1212</cbc:PriceAmount>
		<cbc:BaseQuantity unitCode="EA">1</cbc:BaseQuantity>
		<cac:AllowanceCharge>
			<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
			<cbc:Amount currencyID="HRK">0.0022</cbc:Amount>
			<cbc:BaseAmount currencyID="HRK">0.1234</cbc:BaseAmount>
		</cac:AllowanceCharge>
	</cac:Price>
</cac:InvoiceLine>

from einvoicing-en16931.

phax avatar phax commented on May 24, 2024

I see your problem.
As soon as <cbc:Amount currencyID="HRK">0.0022</cbc:Amount> is added to the XML, the validation fails (with UBL-DT-01).
Reason: the selector //*[ends-with(name(), 'Amount') and not(ends-with(name(),'PriceAmount'))] is too vague!

from einvoicing-en16931.

oriol avatar oriol commented on May 24, 2024

exclusion of AllowanceCharge amounts added in the selector.

from einvoicing-en16931.

oriol avatar oriol commented on May 24, 2024

Will revert this change as in the Norm, table 26 states that allowance and base amount must have a maximum of 2 digits.

from einvoicing-en16931.

phax avatar phax commented on May 24, 2024

For "InvoiceLine Allowance Amount" I fully agree, but for the "non-binding" Price I think it is something different.
So I suggest instead of adding and not(ancestor::cac:AllowanceCharge) I suggest to add and not(../../cac:Price/cac:AllowanceCharge)

from einvoicing-en16931.

phax avatar phax commented on May 24, 2024

@jurajmarkovic can you please cross check, if that solution works for you - thanks.

from einvoicing-en16931.

jurajmarkovic avatar jurajmarkovic commented on May 24, 2024

Sure, we will check now. I have already tried it on http://13.80.11.48:8000/invoice/upload (not sure if it is the same validator) and we've got an error that something is wrong with sch file:
"An error occurred during the validation [Schematron file [/validator/invoice/ubl/schematron/EN16931-UBL-model.sch] is invalid]"

from einvoicing-en16931.

phax avatar phax commented on May 24, 2024

Weird - is this your validator?
Did you resolve the error?

from einvoicing-en16931.

jurajmarkovic avatar jurajmarkovic commented on May 24, 2024

Unfortunatelly, we are still facing the same (fatal) errors:
[SVRLFailedAssert@0x-128ae031: diagnosticRefs=[]; text=[UBL-DT-01]-Amounts shall be decimal up to two fraction digits; location=/Invoice/cac:InvoiceLine/cac:Price/cac:AllowanceCharge/cbc:Amount; test=string-length(substring-after(.,'.'))<=2; flag=FATAL_ERROR]
[SVRLFailedAssert@0x18ebb84b: diagnosticRefs=[]; text=[UBL-DT-01]-Amounts shall be decimal up to two fraction digits; location=/Invoice/cac:InvoiceLine/cac:Price/cac:AllowanceCharge/cbc:BaseAmount; test=string-length(substring-after(.,'.'))<=2; flag=FATAL_ERROR]

Here is the whole Invoice xml:
<?xml version="1.0" encoding="UTF-8"?> <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"> <cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID> <cbc:ProfileID>P1</cbc:ProfileID> <cbc:ID>test decimal 1</cbc:ID> <cbc:IssueDate>2018-02-05</cbc:IssueDate> <cbc:DueDate>2018-02-28</cbc:DueDate> <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode> <cbc:DocumentCurrencyCode>HRK</cbc:DocumentCurrencyCode> <cbc:TaxCurrencyCode>HRK</cbc:TaxCurrencyCode> <cac:AccountingSupplierParty> <cac:Party> <cac:PartyIdentification> <cbc:ID>46830600751</cbc:ID> </cac:PartyIdentification> <cac:PostalAddress> <cbc:StreetName>ULICA 1</cbc:StreetName> <cbc:CityName>SPLIT</cbc:CityName> <cbc:PostalZone>10000</cbc:PostalZone> <cac:AddressLine> <cbc:Line>ULICA 1, 10000 SPLIT</cbc:Line> </cac:AddressLine> <cac:Country> <cbc:IdentificationCode>HR</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID>HR46830600751</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>HEP SPLIT</cbc:RegistrationName> <cbc:CompanyID>086374645</cbc:CompanyID> </cac:PartyLegalEntity> </cac:Party> </cac:AccountingSupplierParty> <cac:AccountingCustomerParty> <cac:Party> <cac:PartyIdentification> <cbc:ID>12346830600751</cbc:ID> </cac:PartyIdentification> <cac:PostalAddress> <cbc:StreetName>VUKOVARSKA PROMJENA ADRESE</cbc:StreetName> <cbc:CityName>ZAGREB</cbc:CityName> <cbc:PostalZone>10000</cbc:PostalZone> <cac:AddressLine> <cbc:Line>VUKOVARSKA PROMJENA ADRESE 20, 10000 ZAGREB</cbc:Line> </cac:AddressLine> <cac:Country> <cbc:IdentificationCode>HR</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID>HR46830600751</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>HEP-OPERATOR DISTRIBUCIJSKOG SUSTAVA D.O.O. ZA DISTRIBUCIJU I OPSKRBU ELEKTRICNE ENERGIJE</cbc:RegistrationName> <cbc:CompanyID>08634543</cbc:CompanyID> </cac:PartyLegalEntity> </cac:Party> </cac:AccountingCustomerParty> <cac:PaymentMeans> <cbc:PaymentMeansCode>4</cbc:PaymentMeansCode> </cac:PaymentMeans> <cac:TaxTotal> <cbc:TaxAmount currencyID="HRK">3.03</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="HRK">12.12</cbc:TaxableAmount> <cbc:TaxAmount currencyID="HRK">3.03</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="HRK">12.12</cbc:LineExtensionAmount> <cbc:TaxExclusiveAmount currencyID="HRK">12.12</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID="HRK">15.15</cbc:TaxInclusiveAmount> <cbc:PayableAmount currencyID="HRK">15.15</cbc:PayableAmount> </cac:LegalMonetaryTotal> <cac:InvoiceLine> <cbc:ID>1</cbc:ID> <cbc:InvoicedQuantity unitCode="EA">100.000</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID="HRK">12.12</cbc:LineExtensionAmount> <cac:Item> <cbc:Name>stavka 1</cbc:Name> <cac:OriginCountry> <cbc:IdentificationCode>HR</cbc:IdentificationCode> </cac:OriginCountry> <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="HRK">0.1212</cbc:PriceAmount> <cbc:BaseQuantity unitCode="EA">1</cbc:BaseQuantity> <cac:AllowanceCharge> <cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:Amount currencyID="HRK">0.0022</cbc:Amount> <cbc:BaseAmount currencyID="HRK">0.1234</cbc:BaseAmount> </cac:AllowanceCharge> </cac:Price> </cac:InvoiceLine> </Invoice>

from einvoicing-en16931.

oriol avatar oriol commented on May 24, 2024

the xpath should be not(ancestor::cac:Price/cac:AllowanceCharge)

from einvoicing-en16931.

jurajmarkovic avatar jurajmarkovic commented on May 24, 2024

Thanks, we will check this first thing in the morning

from einvoicing-en16931.

jurajmarkovic avatar jurajmarkovic commented on May 24, 2024

Everything OK now. Thanks

from einvoicing-en16931.

phax avatar phax commented on May 24, 2024

Thanks for cross-checking and thanks for the error report!

from einvoicing-en16931.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.