Merged stable branch up to 2.3.10
[fa-stable.git] / includes / systypes.inc
index 969960cd3a4c8e11c857c3e54d3b2cbbd6121cc0..974adfdbb0ed51f27272ab4f6e5d6ec168c0a075 100644 (file)
@@ -26,7 +26,7 @@ function get_next_trans_no ($trans_type){
        $sql = "SELECT MAX(`$st[2]`) FROM $st[0]";
 
        if ($st[1] != null)
-                $sql .= " WHERE `$st[1]`=$trans_type";
+                $sql .= " WHERE `$st[1]`=".db_escape($trans_type);
 
     $result = db_query($sql,"The next transaction number for $trans_type could not be retrieved");
     $myrow = db_fetch_row($result);
@@ -51,7 +51,7 @@ function get_systype_db_info($type)
         case     ST_CUSTDELIVERY : return array("".TB_PREF."debtor_trans", "type", "trans_no", "reference", "tran_date");
         case     ST_LOCTRANSFER  : return array("".TB_PREF."stock_moves", "type", "trans_no", "reference", "tran_date");
         case     ST_INVADJUST    : return array("".TB_PREF."stock_moves", "type", "trans_no", "reference", "tran_date");
-        case     ST_PURCHORDER   : return array("".TB_PREF."purch_orders", null, "order_no", "reference", "tran_date");
+        case     ST_PURCHORDER   : return array("".TB_PREF."purch_orders", null, "order_no", "reference", "ord_date");
         case     ST_SUPPINVOICE  : return array("".TB_PREF."supp_trans", "type", "trans_no", "reference", "tran_date");
         case     ST_SUPPCREDIT   : return array("".TB_PREF."supp_trans", "type", "trans_no", "reference", "tran_date");
         case     ST_SUPPAYMENT   : return array("".TB_PREF."supp_trans", "type", "trans_no", "reference", "tran_date");