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"]);