Skip to content

Commit

Permalink
Feature Prenotification im Navigationsbaum (#290)
Browse files Browse the repository at this point in the history
* Zwischenstand

* Restarbeiten

* Erlaube null bei Integerauswahl

* Jetzt auch Multi Selection bei Lastschriften

* Kommentare
  • Loading branch information
JohannMaierhofer authored Aug 18, 2024
1 parent 10b7c40 commit 3637944
Show file tree
Hide file tree
Showing 16 changed files with 458 additions and 82 deletions.
11 changes: 6 additions & 5 deletions src/de/jost_net/JVerein/gui/action/PreNotificationAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import de.jost_net.JVerein.gui.view.PreNotificationView;
import de.jost_net.JVerein.rmi.Abrechnungslauf;
import de.jost_net.JVerein.rmi.Lastschrift;
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.util.ApplicationException;
Expand All @@ -27,14 +28,14 @@ public class PreNotificationAction implements Action
@Override
public void handleAction(Object context) throws ApplicationException
{
if (context == null)
if (context != null && (context instanceof Abrechnungslauf ||
context instanceof Lastschrift || context instanceof Lastschrift[]))
{
throw new ApplicationException("Keinen Abrechnunglauf ausgewählt!");
GUI.startView(PreNotificationView.class.getName(), context);
}
if (!(context instanceof Abrechnungslauf))
else
{
throw new ApplicationException("Programmfehler! Kein Abrechnunglauf!");
GUI.startView(PreNotificationView.class.getName(), null);
}
GUI.startView(PreNotificationView.class.getName(), context);
}
}
8 changes: 4 additions & 4 deletions src/de/jost_net/JVerein/gui/control/DruckMailControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public DruckMailControl(AbstractView view)
super(view);
}

public static final String EMAIL = "EMail";
public static final String EMAIL = "Mail";

public static final String PDF1 = "PDF (Lastschriften ohne Mailadresse)";
public static final String PDF1 = "PDF (Lastschriften ohne Mail Empfänger)";

public static final String PDF2 = "PDF (Alle)";

Expand Down Expand Up @@ -138,7 +138,7 @@ public SelectInput getOutput()
return output;
}
Object[] values = new Object[] { EMAIL, PDF1, PDF2 };
output = new SelectInput(values, settings.getString("output", PDF1));
output = new SelectInput(values, settings.getString(settingsprefix +"output", PDF1));
output.setName("Ausgabe");
return output;
}
Expand All @@ -152,7 +152,7 @@ public SelectInput getPdfModus()
Object[] values = new Object[] { NICHT_EINZELN, EINZELN_NUMMERIERT,
EINZELN_MITGLIEDSNUMMER, EINZELN_NUMMERIERT_UND_MNR };
pdfModus = new SelectInput(values,
settings.getString("pdfModus", NICHT_EINZELN));
settings.getString(settingsprefix +"pdfModus", NICHT_EINZELN));
pdfModus.setName("PDF als");
return pdfModus;
}
Expand Down
75 changes: 75 additions & 0 deletions src/de/jost_net/JVerein/gui/control/FilterControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
import de.jost_net.JVerein.gui.dialogs.EigenschaftenAuswahlParameter;
import de.jost_net.JVerein.gui.dialogs.ZusatzfelderAuswahlDialog;
import de.jost_net.JVerein.gui.input.GeschlechtInput;
import de.jost_net.JVerein.gui.input.IntegerNullInput;
import de.jost_net.JVerein.gui.input.MailAuswertungInput;
import de.jost_net.JVerein.rmi.Abrechnungslauf;
import de.jost_net.JVerein.rmi.Adresstyp;
import de.jost_net.JVerein.rmi.Beitragsgruppe;
import de.jost_net.JVerein.rmi.Eigenschaft;
Expand Down Expand Up @@ -139,6 +141,10 @@ public class FilterControl extends AbstractControl

protected TextInput suchtext = null;

protected SelectInput abrechnungslaufausw = null;

protected IntegerNullInput integerausw = null;

public enum Mitgliedstyp {
MITGLIED,
NICHTMITGLIED,
Expand Down Expand Up @@ -906,6 +912,61 @@ public boolean isSuchtextAktiv()
return suchtext != null;
}

public SelectInput getAbrechnungslaufAusw(int anzahl) throws RemoteException
{
if (abrechnungslaufausw != null)
{
return abrechnungslaufausw;
}
DBIterator<Abrechnungslauf> list = Einstellungen.getDBService()
.createList(Abrechnungslauf.class);
list.setOrder("ORDER BY id desc");
ArrayList<Abrechnungslauf> liste = null;
if (list != null)
{
liste = new ArrayList<>();
int count = 0;
while (list.hasNext() && count < anzahl)
{
liste.add(list.next());
count++;
}
}
abrechnungslaufausw = new SelectInput(liste, liste.get(0));
abrechnungslaufausw.setName("Abrechnungslauf");
abrechnungslaufausw.setAttribute("idtext");
return abrechnungslaufausw;
}

public boolean isAbrechnungslaufAuswAktiv()
{
return abrechnungslaufausw != null;
}

public IntegerNullInput getIntegerAusw()
{
if (integerausw != null)
{
return integerausw;
}
String tmp = settings.getString(settingsprefix + "intergerauswahl", "");
if (tmp != null && !tmp.isEmpty())
{
integerausw = new IntegerNullInput(Integer.parseInt(tmp));
}
else
{
integerausw = new IntegerNullInput();
}
integerausw.setName("Auswahl");
return integerausw;
}

public boolean isIntegerAuswAktiv()
{
return integerausw != null;
}

/**
* Buttons
*/
Expand Down Expand Up @@ -1020,6 +1081,8 @@ public void handleAction(Object context) throws ApplicationException
abbuchungsdatumbis.setValue(null);
if (suchtext != null)
suchtext.setValue("");
if (integerausw != null)
integerausw.setValue(null);
refresh();
}
}, null, false, "eraser.png");
Expand Down Expand Up @@ -1404,6 +1467,18 @@ public void saveFilterSettings() throws RemoteException
}
}

if (integerausw != null)
{
Integer tmp = (Integer) integerausw.getValue();
if (tmp != null)
{
settings.setAttribute(settingsprefix + "intergerauswahl", tmp);
}
else
{
settings.setAttribute(settingsprefix + "intergerauswahl", "");
}
}
}

private void saveDate(Date tmp, String setting)
Expand Down
6 changes: 6 additions & 0 deletions src/de/jost_net/JVerein/gui/control/LastschriftControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public Part getLastschriftList() throws RemoteException
}
lastschriftList = new TablePart(getLastschriften(), null);
lastschriftList.addColumn("Nr", "id");
lastschriftList.addColumn("Abrechnungslauf", "abrechnungslauf");
lastschriftList.addColumn("Name", "name");
lastschriftList.addColumn("Vorname", "vorname");
lastschriftList.addColumn("Zweck", "verwendungszweck");
Expand Down Expand Up @@ -150,6 +151,11 @@ else if (tmpArt.equalsIgnoreCase("Nicht-Mitglied"))
lastschriften.addFilter("faelligkeit <= ?",
new Object[] { (Date) getDatumbis().getValue() });
}
if (isIntegerAuswAktiv() && getIntegerAusw().getValue() != null)
{
lastschriften.addFilter("abrechnungslauf >= ?",
new Object[] { (Integer) getIntegerAusw().getValue() });
}

lastschriften.setOrder("ORDER BY name");

Expand Down
Loading

0 comments on commit 3637944

Please sign in to comment.