Implemented attachments for Bank Account, and redesign of Bank Accounts to a tabbed...
[fa-stable.git] / admin / db / transactions_db.inc
index d343b7c4ba8522119d1e93688bd73101ff4d4244..d75268e59c635a0f143ee068a8c12716bd5020b5 100644 (file)
@@ -31,11 +31,12 @@ function get_sql_for_view_transactions($filtertype, $from, $to, &$trans_ref)
                $sql .= " ,t.$trans_ref as ref ";
        else
                $sql .= ", r.reference as ref";
-       $sql .= ",t.$trans_date as trans_date";
+       if ($trans_date)
+               $sql .= ",t.$trans_date as trans_date";
        if ($type_name)
                $sql .= ", t.$type_name as type";
        $sql .= " FROM $table_name t LEFT JOIN ".TB_PREF."voided v ON"
-               ." t.$trans_no_name=v.id AND v.type=$filtertype";
+               ." t.$trans_no_name=v.id AND v.type=".db_escape($filtertype);
 
        $sql .= " WHERE ISNULL(v.`memo_`)";
        if ($from != null && $to != null)
@@ -208,6 +209,12 @@ function get_systype_db_info($type)
         case     ST_SALESQUOTE   : return array(TB_PREF."sales_orders", "trans_type", "order_no", "reference", "ord_date");
         case    ST_DIMENSION    : return array(TB_PREF."dimensions", null, "id", "reference", "date_");
         case     ST_COSTUPDATE   : return array(TB_PREF."journal", "type", "trans_no", "reference", "tran_date");
+
+        case     ST_CUSTOMER    : return array(TB_PREF."debtors_master", null, "debtor_no", "debtor_ref", null);
+        case     ST_SUPPLIER    : return array(TB_PREF."suppliers", null, "supplier_id", "supp_ref", null);
+        case     ST_ITEM        : return array(TB_PREF."item_codes", null, "id", "stock_id", null);
+        case     ST_FIXEDASSET  : return array(TB_PREF."item_codes", null, "id", "stock_id", null);
+        case     ST_BANKACCOUNT  : return array(TB_PREF."bank_accounts", null, "id", "bank_account_number", null);
        }
 
        display_db_error("invalid type ($type) sent to get_systype_db_info", "", true);