0; } function get_quick_entries($deposit=-1, $bank_only=-1) { $where = false; $sql = "SELECT * FROM ".TB_PREF."quick_entries"; if ($deposit != -1) { $sql .= " WHERE deposit=$deposit"; $where = true; } if ($bank_only != -1) { if ($where) $sql .= " AND bank_only=$bank_only"; else $sql .= " WHERE bank_only=$bank_only"; } $sql .= " ORDER BY description"; return db_query($sql, "could not retreive quick entries"); } function get_quick_entry($selected_id) { $sql = "SELECT * FROM ".TB_PREF."quick_entries WHERE id=$selected_id"; $result = db_query($sql, "could not retreive quick entry $selected_id"); return db_fetch($result); } function get_quick_entry_lines($qid) { $sql = "SELECT ".TB_PREF."quick_entry_lines.*, ".TB_PREF."chart_master.account_name FROM ".TB_PREF."quick_entry_lines, ".TB_PREF."chart_master WHERE ".TB_PREF."quick_entry_lines.account = ".TB_PREF."chart_master.account_code AND qid=$qid"; return db_query($sql, "could not retreive quick entries"); } function has_quick_entry_lines($qid) { $sql = "SELECT id FROM ".TB_PREF."quick_entry_lines WHERE qid=$qid"; $result = db_query($sql, "could not retreive quick entries"); return db_num_rows($result) > 0; } //--------------------------------------------------------------------------------------------- function get_quick_entry_line($selected_id) { $sql = "SELECT * FROM ".TB_PREF."quick_entry_lines WHERE id=$selected_id"; $result = db_query($sql, "could not retreive quick entry for $selected_id"); return db_fetch($result); } //--------------------------------------------------------------------------------------------- ?>