Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset Filter für Buchungen View #250

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/de/jost_net/JVerein/gui/control/BuchungsControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import de.jost_net.JVerein.rmi.Mitgliedskonto;
import de.jost_net.JVerein.rmi.Projekt;
import de.jost_net.JVerein.util.Dateiname;
import de.jost_net.JVerein.util.Datum;
import de.jost_net.JVerein.util.JVDateFormatTTMMJJJJ;
import de.willuhn.datasource.GenericObject;
import de.willuhn.datasource.pseudo.PseudoIterator;
Expand Down Expand Up @@ -2005,4 +2006,36 @@ public int compareTo(MitgliedZustand o)
}

}

public void resetFilter()
{
try
{
suchbuchungsart.setValue(suchbuchungsart.getList().get(0));
suchprojekt.setValue(null);
suchbetrag.setValue("");
hasmitglied.setValue(hasmitglied.getList().get(2));
Calendar calendar = Calendar.getInstance();
Integer year = calendar.get(Calendar.YEAR);
Date startGJ = Datum.toDate(Einstellungen.getEinstellung()
.getBeginnGeschaeftsjahr() + year);
if (calendar.getTime().before(startGJ))
{
year = year -1;
startGJ = Datum.toDate(Einstellungen.getEinstellung()
.getBeginnGeschaeftsjahr() + year);
}
vondatum.setValue(startGJ);
calendar.setTime(startGJ);
calendar.add(Calendar.YEAR, 1);
calendar.add(Calendar.DAY_OF_MONTH, -1);
bisdatum.setValue(calendar.getTime());
suchtext.setValue("");
refreshBuchungsList();
}
catch (Exception ex)
{
Logger.error("Error filter reset", ex);
}
}
}
10 changes: 10 additions & 0 deletions src/de/jost_net/JVerein/gui/view/BuchungslisteView.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ public void bind() throws Exception
right.addLabelPair("Enthaltener Text", control.getSuchtext());

ButtonArea buttons1 = new ButtonArea();
Button reset = new Button("Filter-Reset", new Action()
{
@Override
public void handleAction(Object context) throws ApplicationException
{
control.resetFilter();
}
}, null, false, "eraser.png");
buttons1.addButton(reset);

Button suchen = new Button("Suchen", new Action()
{
@Override
Expand Down