Closed dragonfly4 closed 4 years ago
After analyzing the code this is just a sample problem. Just add the tax tags for each line. This is quick & dirty so cleanup for own use.
// item tax $itemTax = new NumNum\UBL\TaxTotal(); $itemTax->setTaxAmount("10.00"); $itemTaxSub = new NumNum\UBL\TaxSubTotal(); $itemTaxSub->setTaxableAmount("10.00"); $itemTaxSub->setTaxAmount("2.00"); $itemTaxSub->setPercent("21.00"); $itemTaxCat = new NumNum\UBL\TaxCategory; $itemTaxCat->setId("S"); $itemTaxCat->setName("BTW 21%"); $itemTaxCat->setPercent("21.00"); $ItemTaxScheme = new NumNum\UBL\TaxScheme(); $ItemTaxScheme->setId("VAT"); $itemTaxCat->setTaxScheme($ItemTaxScheme); $itemTaxSub->setTaxCategory($itemTaxCat); $itemTax->addTaxSubTotal($itemTaxSub);
$invoiceLine->setTaxTotal($itemTax);
Thanks. Yeah exactly, you can use the library to generate invalid XML's if you ommit a child tag or something. The example
folder in this repo should be totally checked & recreated.
I added a valid example in the tests/ folder in the fa55d62d49c9d933ec77a2b0bc9be46df04d8282 commit.
Using the sample of Version 1.5 to test your wonderful plugin.
The generated file does not pass UBL validation.
https://peppol.helger.com/public/locale-en_US/menuitem-validation-upload UBL Invoice 2.1
This is due the presence of a tag in InvoiceLine. If I comment out this line the file passes validation.
InvoiceLine.php#L195
Is this a bug or did you add that line for a reason please?