From 43c686d64e47c1db8dff217c405fb1e569cb07f1 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Wed, 28 Jan 2026 10:22:35 +0100 Subject: [PATCH] XML Peppol : correct negative amount --- include/XMLDocument/invoiceubl21.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php index 546da3074..b4098626e 100644 --- a/include/XMLDocument/invoiceubl21.class.php +++ b/include/XMLDocument/invoiceubl21.class.php @@ -475,6 +475,7 @@ class InvoiceUBL21 extends XMLInvoice { $result->appendChild($this->createElement("cbc:ID", $i)); $amount=sprintf("%.2f",$row['price']); + if ( $row['quantity'] > 0 && $amount < 0 ) $row['quantity'] =bcsub(0,$row['quantity'] ,4); $result->appendChild( $this->createElement("cbc:InvoicedQuantity", sprintf("%.2f",$row['quantity']))) ->setAttribute("unitCode", $row["code_quantity"]);