From a046e447e7441b54916ee53de8d0ef043dda39c5 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 10 Feb 2026 13:02:11 +0100 Subject: [PATCH] If VAT percent is not set, because there is no VAT --- include/XMLDocument/xmlinvoice_reader.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/XMLDocument/xmlinvoice_reader.class.php b/include/XMLDocument/xmlinvoice_reader.class.php index 6379cf524..eafb539cc 100644 --- a/include/XMLDocument/xmlinvoice_reader.class.php +++ b/include/XMLDocument/xmlinvoice_reader.class.php @@ -164,7 +164,12 @@ class XMLInvoice_Reader extends XML_Reader $row ['taxable_amount'] = $xml->xpath("//cbc:TaxableAmount")[$e] . ""; $row ['tax'] = $xml->xpath("//cbc:TaxAmount")[$e] . ""; $row ['tax_id'] = $xml->xpath("//cac:TaxCategory/cbc:ID")[$e] . ""; - $row ['tax_percent'] = $xml->xpath("//cac:TaxCategory/cbc:Percent")[$e] . ""; + $row ['tax_percent'] =0; + $r=$xml->xpath("//cac:TaxCategory/cbc:Percent"); + if ( isset($r[$e]) ) + { + $row ['tax_percent'] = $xml->xpath("//cac:TaxCategory/cbc:Percent")[$e] . ""; + } if (isset($xml->xpath("//cac:InvoiceLine/cac:Item/cbc:Name")[$e])) { $row ['name'] =$xml->xpath("//cac:InvoiceLine/cac:Item/cbc:Name")[$e]."";