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

Fix: Fehlermeldung wenn keine Buchungen vorhanden #59

Merged
merged 3 commits into from
Nov 2, 2023
Merged
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
8 changes: 8 additions & 0 deletions src/de/jost_net/JVerein/gui/view/BuchungsklasseSaldoView.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.action.DokumentationAction;
import de.jost_net.JVerein.gui.control.BuchungsklasseSaldoControl;
import de.jost_net.JVerein.rmi.Buchung;
import de.willuhn.datasource.rmi.DBIterator;
import de.willuhn.datasource.rmi.DBService;
import de.willuhn.datasource.rmi.ResultSetExtractor;
import de.willuhn.jameica.gui.AbstractView;
Expand Down Expand Up @@ -130,6 +132,12 @@ public void bind() throws Exception
group.addLabelPair("von", control.getDatumvon());
group.addLabelPair("bis", control.getDatumbis());

DBIterator<Buchung> list = Einstellungen.getDBService().createList(Buchung.class);
if (list == null || !list.hasNext())
{
throw new ApplicationException("Abbruch! Es existiert noch keine Buchung.");
}

LabelGroup quickGroup = new LabelGroup(getParent(), "Schnellzugriff");
ButtonArea quickBtns = new ButtonArea();
for (Integer i = getYearBounds("min"); i < getYearBounds("max") + 1; i++)
Expand Down