The average material cost test for either qoh > 0 and qoh + qty > 0 has changed to...
[fa-stable.git] / admin / db / printers_db.inc
index c1d80368b1d156acb76922d5a9a5a4d24c7eb33d..28c98a56b4b5d56c190d7634e76daca481fb2f64 100644 (file)
@@ -41,6 +41,11 @@ function get_printer($id)
                return  db_fetch($result);
 }
 
+function delete_printer($id)
+{
+       $sql="DELETE FROM ".TB_PREF."printers WHERE id=".db_escape($id);
+       db_query($sql,"could not delete printer definition");
+}
 //============================================================================
 // printer profiles functions
 //
@@ -52,7 +57,7 @@ function update_printer_profile($name, $dest)
                        ."(profile, report, printer) VALUES ("
                        .db_escape($name).","
                        .db_escape($rep).","
-                       .db_escape($printer).")";
+                       .db_escape($printer ? $printer: null, true).")";
                } else {
                        $sql = "DELETE FROM ".TB_PREF."print_profiles WHERE ("
                                ."report=" . db_escape($rep)
@@ -101,4 +106,3 @@ function get_print_profile($name)
        return db_query($sql,"could not get printing profile");
 }
 
-?>
\ No newline at end of file