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

UBL-Invoice-2.1.xsd error #21

Open
DinkyToys opened this issue Mar 14, 2019 · 3 comments
Open

UBL-Invoice-2.1.xsd error #21

DinkyToys opened this issue Mar 14, 2019 · 3 comments

Comments

@DinkyToys
Copy link

When testing with: https://peppol.helger.com/public/locale-en_US/menuitem-validation-bis2
In the Netherlands we use UBL-Invoice-2.1.

I get an failure message:
Error message: [SAX] cvc-complex-type.2.4.b: The content of element 'cac:TaxTotal' is not complete. One of '{"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2":TaxAmount}' is expected.
Technical details: cvc-complex-type.2.4.b: The content of element 'cac:TaxTotal' is not complete. One of '{"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2":TaxAmount}' is expected.

@nssnl
Copy link

nssnl commented Jan 27, 2020

Running into the same issue. Were you able to fix this?

@DinkyToys
Copy link
Author

No. Also didn't go further with it. Too much not documented etc.

@martijnderidder
Copy link

I have fix it;

For each invoice line we use this code;

$taxTotal = new TaxTotal();
$taxSubTotal = new TaxSubTotal();
$taxSubTotal->setTaxableAmount($priceLine);
$taxSubTotal->setTaxAmount($priceLine * $taxPercentage);
$taxSubTotal->setTaxCategory($taxCategory);
$taxTotal->addTaxSubTotal($taxSubTotal);
$taxTotal->setTaxAmount($taxSubTotal->getTaxAmount());

And at the end of the invoice we use this code;

$taxTotal = new TaxTotal();
$taxSubTotal = new TaxSubTotal();
$taxSubTotal->setTaxableAmount($this->centToEur($invoice->amountWithoutTax->getAmount()));
$taxSubTotal->setTaxAmount($this->centToEur($invoice->tax->getAmount()));
$taxSubTotal->setTaxCategory($taxCategory);
$taxTotal->addTaxSubTotal($taxSubTotal);
$taxTotal->setTaxAmount($taxSubTotal->getTaxAmount());

And the last line:

$ublInvoice->setTaxTotal($taxTotal);

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

3 participants