[0000753] Bank deposit/payment edition fixed (rewritten database rewrite scheme to...
[fa-stable.git] / gl / includes / db / gl_db_trans.inc
index 80663e0bcbf42afdc47ec22add83f73579613638..fe9599afb10d6bc804d5ff4b3d9d5c8c436494b9 100644 (file)
@@ -154,6 +154,7 @@ function get_gl_trans($type, $trans_id)
                LEFT JOIN ".TB_PREF."refs as refs ON (gl.type=refs.type AND gl.type_no=refs.id)"
                ." WHERE gl.type= ".db_escape($type) 
                ." AND gl.type_no = ".db_escape($trans_id)
+               ." AND gl.amount <> 0"
                ." ORDER BY counter";
        return db_query($sql, "The gl transactions could not be retrieved");
 }
@@ -583,22 +584,6 @@ function void_gl_trans($type, $trans_id, $nested=false)
                commit_transaction();
 }
 
-//--------------------------------------------------------------------------------------------------
-
-function clear_gl_trans($type, $trans_id, $nested=false)
-{
-       if (!$nested)
-               begin_transaction();
-
-       $sql = "DELETE FROM ".TB_PREF."gl_trans WHERE type=".db_escape($type)
-       ." AND type_no=".db_escape($trans_id);
-
-       db_query($sql, "could not clear gl transactions for type=$type and trans_no=$trans_id");
-
-       if (!$nested)
-               commit_transaction();
-}
-
 //----------------------------------------------------------------------------------------
 
 function void_journal_trans($type, $type_no, $use_transaction=true)