/**
* @see de.willuhn.jameica.hbci.gui.parts.AbstractFromToList#getList(java.lang.Object, java.util.Date, java.util.Date, java.lang.String)
*/
protected DBIterator getList(Object konto, Date from, Date to, String text) throws RemoteException
{
HBCIDBService service = (HBCIDBService) Settings.getDBService();
DBIterator list = service.createList(getObjectType());
if (from != null) list.addFilter("termin >= ?", new Object[]{new java.sql.Date(DateUtil.startOfDay(from).getTime())});
if (to != null) list.addFilter("termin <= ?", new Object[]{new java.sql.Date(DateUtil.endOfDay(to).getTime())});
if (text != null && text.length() > 0)
{
list.addFilter("LOWER(bezeichnung) like ?", new Object[]{"%" + text.toLowerCase() + "%"});
}
if (konto != null && (konto instanceof Konto))
list.addFilter("konto_id = " + ((Konto) konto).getID());
else if (konto != null && (konto instanceof String))
list.addFilter("konto_id in (select id from konto where kategorie = ?)", (String) konto);
boolean pending = ((Boolean) this.getPending().getValue()).booleanValue();
if (pending)
list.addFilter("ausgefuehrt = 0");
list.setOrder("ORDER BY " + service.getSQLTimestamp("termin") + " DESC, id DESC");
return list;
}