If VAT percent is not set, because there is no VAT

This commit is contained in:
sparkyx 2026-02-10 13:02:11 +01:00
parent 02a938a08f
commit a046e447e7

View file

@ -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]."";