Leave artnr field empty in output when it is uknown
[misc/hallinta-metro] / utils.php
index f7c4729..6728aae 100644 (file)
--- a/utils.php
+++ b/utils.php
@@ -147,9 +147,9 @@ function ordersatz_write($id, $dir, $send)
     if (strlen($row['hersteller']))
       $bez .= ' (' . $row['hersteller'] . ')';
 
-    fwrite($f, sprintf('\order{%d}{%d}{%s %s}{%s}'."\n",
+    fwrite($f, sprintf('\order{%d}{%s}{%s %s}{%s}'."\n",
                       $row['anzahl'],
-                      $row['artnr'],
+                      $row['artnr'] ? (int)$row['artnr'] : '',
                       $row['menge'],
                       latex_encode($bez),
                       latex_encode($row['vpname'])));