Skip to content

Commit

Permalink
Feature Verbesserung Suche und Namensänderungen (#196)
Browse files Browse the repository at this point in the history
* Fix #163

* Sollte von größer als bis sein

* Zwischenstand

* Final fix

* Und noch was

* Leerzeile auch bei Jahressaldo

* kleine Optimierung

* Weiterer Update

* Text ändern

* Remove ...

* Kontensaldo statt Jahressaldo

* Buchung vor ersten Abschluss erlauben

* Bemerkung einfügen

* Intervall für aktive Konten konfigurierbar

* Titel korrigieren

* Lösche Bemerkung

* Wegen anderer Lösung KontoAuswahlDialog entfernt

* Verbesserung und Fix Mitgliedskonten Auswahl Dialoge

* Auch Adressen Suche

* Auch Mitglieder Suche View angepasst

* Zwischenstand

* Update1

* Zwischenstand

* Remove unused Listener

* Rückgängig

* Mehr Suchoptionen bei Nicht-Mitglieder

* Zwischenstand

* Update für Suchen als Default Button

* Zwischenstand

* Zwischenstand

* Rename Jahres.. to Konto...

* Rename Jahres... to Konten...

* Revert "Rename Jahres.. to Konto..."

This reverts commit 0a0bba1.

* fix import

* JahressaldoAction umbenannt

* Delete JahressaldoControl.java

* Umbenennungen

* Add Spezialsuche1

* Komment Logger

* Disable Kontensaldo Feature

* Kleiner Fix, ist aber egal da Attribut nicht gelesen wird

* Zwei Bugs im alten Code behoben

* Blank im Kommentar

* Merge Master und Korrekturen

* Update InternalColumns.java

* fix  Zusatzfelder Reset in Dialog
  • Loading branch information
JohannMaierhofer committed Mar 28, 2024
1 parent dff59bb commit b1629e1
Show file tree
Hide file tree
Showing 67 changed files with 964 additions and 546 deletions.
73 changes: 47 additions & 26 deletions src/de/jost_net/JVerein/Queries/MitgliedQuery.java
Expand Up @@ -50,6 +50,10 @@ public class MitgliedQuery
private boolean and = false;

private String sql = "";

String zusatzfeld = null;

String zusatzfelder = null;

public MitgliedQuery(MitgliedControl control, boolean batch)
{
Expand All @@ -60,6 +64,16 @@ public MitgliedQuery(MitgliedControl control, boolean batch)
@SuppressWarnings("unchecked")
public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
{
if (adresstyp == 1)
{
zusatzfeld = "zusatzfeld.";
zusatzfelder = "zusatzfelder.";
}
else
{
zusatzfeld = "nichtzusatzfeld.";
zusatzfelder = "nichtzusatzfelder.";
}
final DBService service = Einstellungen.getDBService();
ArrayList<Object> bedingungen = new ArrayList<>();

Expand All @@ -74,23 +88,23 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
char synonym = 'a';
DBIterator<Felddefinition> fdit = Einstellungen.getDBService()
.createList(Felddefinition.class);
if (settings.getInt("zusatzfelder.selected", 0) > fdit.size())
if (settings.getInt(zusatzfelder + "selected", 0) > fdit.size())
{
settings.setAttribute("zusatzfelder.selected", 0);
settings.setAttribute(zusatzfelder + "selected", 0);
}
if (settings.getInt("zusatzfelder.selected", 0) > 0)
if (settings.getInt(zusatzfelder + "selected", 0) > 0)
{
for (int i = 1; i <= settings.getInt("zusatzfelder.counter", 0); i++)
for (int i = 1; i <= settings.getInt(zusatzfelder + "counter", 0); i++)
{
int definition = settings.getInt("zusatzfeld." + i + ".definition", -1);
switch (settings.getInt("zusatzfeld." + i + ".datentyp", -1))
int definition = settings.getInt(zusatzfeld + i + ".definition", -1);
switch (settings.getInt(zusatzfeld + i + ".datentyp", -1))
{
case Datentyp.ZEICHENFOLGE:
{
String value = settings
.getString("zusatzfeld." + i + ".value", null)
.getString(zusatzfeld + i + ".value", null)
.replace('*', '%');
String cond = settings.getString("zusatzfeld." + i + ".cond", null);
String cond = settings.getString(zusatzfeld + i + ".cond", null);
if (value != null && value.length() > 0)
{
sql += "join zusatzfelder " + synonym + " on " + synonym
Expand All @@ -105,9 +119,9 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
}
case Datentyp.DATUM:
{
String value = settings.getString("zusatzfeld." + i + ".value",
String value = settings.getString(zusatzfeld + i + ".value",
null);
String cond = settings.getString("zusatzfeld." + i + ".cond", null);
String cond = settings.getString(zusatzfeld + i + ".cond", null);
if (value != null)
{
try
Expand All @@ -129,9 +143,9 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
}
case Datentyp.GANZZAHL:
{
int value = settings.getInt("zusatzfeld." + i + ".value",
int value = settings.getInt(zusatzfeld + i + ".value",
Integer.MIN_VALUE);
String cond = settings.getString("zusatzfeld." + i + ".cond", null);
String cond = settings.getString(zusatzfeld + i + ".cond", null);
if (value != Integer.MIN_VALUE)
{
sql += "join zusatzfelder " + synonym + " on " + synonym
Expand All @@ -145,7 +159,7 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
}
case Datentyp.JANEIN:
{
boolean value = settings.getBoolean("zusatzfeld." + i + ".value",
boolean value = settings.getBoolean(zusatzfeld + i + ".value",
false);
if (value)
{
Expand All @@ -160,9 +174,9 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
}
case Datentyp.WAEHRUNG:
{
String value = settings.getString("zusatzfeld." + i + ".value",
String value = settings.getString(zusatzfeld + i + ".value",
null);
String cond = settings.getString("zusatzfeld." + i + ".cond", null);
String cond = settings.getString(zusatzfeld + i + ".cond", null);
if (value != null)
{
try
Expand All @@ -186,8 +200,15 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
}
}
}
addCondition("adresstyp = " + adresstyp);
if (control.isMitgliedStatusAktiv())
if (adresstyp != 0)
{
addCondition("adresstyp = " + adresstyp);
}
else
{
addCondition("adresstyp != " + 1);
}
if (control.isMitgliedStatusAktiv() && adresstyp == 1)
{
if (control.getMitgliedStatus().getValue().equals("Angemeldet"))
{
Expand Down Expand Up @@ -292,13 +313,13 @@ else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
bedingungen.add(new java.sql.Date(d.getTime()));
}

if (batch && control.getSterbedatumvon().getValue() != null)
if (batch && control.getSterbedatumvon().getValue() != null && adresstyp == 1)
{
addCondition("sterbetag >= ?");
Date d = (Date) control.getSterbedatumvon().getValue();
bedingungen.add(new java.sql.Date(d.getTime()));
}
if (batch && control.getSterbedatumbis().getValue() != null)
if (batch && control.getSterbedatumbis().getValue() != null && adresstyp == 1)
{
addCondition("sterbetag <= ?");
Date d = (Date) control.getSterbedatumbis().getValue();
Expand All @@ -311,19 +332,19 @@ else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
String g = (String) control.getGeschlecht().getValue();
bedingungen.add(g);
}
if (control.getEintrittvon().getValue() != null)
if (control.getEintrittvon().getValue() != null && adresstyp == 1)
{
addCondition("eintritt >= ?");
Date d = (Date) control.getEintrittvon().getValue();
bedingungen.add(new java.sql.Date(d.getTime()));
}
if (control.getEintrittbis().getValue() != null)
if (control.getEintrittbis().getValue() != null && adresstyp == 1)
{
addCondition("eintritt <= ?");
Date d = (Date) control.getEintrittbis().getValue();
bedingungen.add(new java.sql.Date(d.getTime()));
}
if (control.isAustrittbisAktiv())
if (control.isAustrittbisAktiv() && adresstyp == 1)
{
if (control.getAustrittvon().getValue() != null)
{
Expand All @@ -349,7 +370,7 @@ else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
{
try
{
if (control.getSuchExterneMitgliedsnummer().getValue() != null)
if (control.getSuchExterneMitgliedsnummer().getValue() != null && adresstyp == 1)
{
String ext = (String) control.getSuchExterneMitgliedsnummer()
.getValue();
Expand All @@ -366,7 +387,7 @@ else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
}
Beitragsgruppe bg = (Beitragsgruppe) control.getBeitragsgruppeAusw()
.getValue();
if (bg != null)
if (bg != null && adresstyp == 1)
{
addCondition("beitragsgruppe = ? ");
}
Expand Down Expand Up @@ -410,7 +431,7 @@ public Object extract(ResultSet rs) throws RemoteException, SQLException
try
{
if (Einstellungen.getEinstellung().getExterneMitgliedsnummer()
&& control.getSuchExterneMitgliedsnummer().getValue() != null)
&& control.getSuchExterneMitgliedsnummer().getValue() != null && adresstyp == 1)
{
String ext = (String) control.getSuchExterneMitgliedsnummer()
.getValue();
Expand All @@ -424,7 +445,7 @@ public Object extract(ResultSet rs) throws RemoteException, SQLException
{
// Workaround f. Bug in IntegerInput
}
if (bg != null)
if (bg != null && adresstyp == 1)
{
bedingungen.add(Integer.valueOf(bg.getID()));
}
Expand Down
4 changes: 2 additions & 2 deletions src/de/jost_net/JVerein/Queries/MitgliedskontoQuery.java
Expand Up @@ -80,7 +80,7 @@ public ArrayList<Mitgliedskonto> get() throws RemoteException
}
catch (NullPointerException e)
{
Logger.info("Export Mitgliedskonto ohne 'von-Datum'");
//Logger.info("Export Mitgliedskonto ohne 'von-Datum'");
}

try
Expand All @@ -90,7 +90,7 @@ public ArrayList<Mitgliedskonto> get() throws RemoteException
}
catch (NullPointerException e)
{
Logger.info("Export Mitgliedskonto ohne 'bis-Datum'");
//Logger.info("Export Mitgliedskonto ohne 'bis-Datum'");
}

if (ohneAbbucher.booleanValue())
Expand Down
2 changes: 1 addition & 1 deletion src/de/jost_net/JVerein/gui/action/BackupCreateAction.java
Expand Up @@ -149,7 +149,7 @@ public void run(ProgressMonitor monitor) throws ApplicationException
backup(AbrechnungslaufImpl.class, writer, monitor);
monitor.addPercentComplete(2);

monitor.setStatusText("Speichere Adresstypen");
monitor.setStatusText("Speichere Mitgliedstypen");
backup(AdresstypImpl.class, writer, monitor);
monitor.addPercentComplete(2);

Expand Down
Expand Up @@ -19,7 +19,7 @@

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.control.BuchungsControl;
import de.jost_net.JVerein.gui.dialogs.MitgliedskontoAuswahlDialog;
import de.jost_net.JVerein.gui.dialogs.SollbuchungAuswahlDialog;
import de.jost_net.JVerein.keys.Zahlungsweg;
import de.jost_net.JVerein.rmi.Buchung;
import de.jost_net.JVerein.rmi.Mitglied;
Expand All @@ -33,11 +33,11 @@
/**
* Mitgliedskonto zuordnen.
*/
public class BuchungMitgliedskontoZuordnungAction implements Action
public class BuchungSollbuchungZuordnungAction implements Action
{
private BuchungsControl control;

public BuchungMitgliedskontoZuordnungAction(BuchungsControl control)
public BuchungSollbuchungZuordnungAction(BuchungsControl control)
{
this.control = control;
}
Expand Down Expand Up @@ -74,7 +74,7 @@ public void handleAction(Object context) throws ApplicationException
{
return;
}
MitgliedskontoAuswahlDialog mkaz = new MitgliedskontoAuswahlDialog(b[0]);
SollbuchungAuswahlDialog mkaz = new SollbuchungAuswahlDialog(b[0]);
Object open = mkaz.open();
Mitgliedskonto mk = null;

Expand Down Expand Up @@ -113,11 +113,11 @@ else if (open instanceof Mitglied)

if (mk == null)
{
GUI.getStatusBar().setSuccessText("Mitgliedskonto gelöscht");
GUI.getStatusBar().setSuccessText("Sollbuchung gelöscht");
}
else
{
GUI.getStatusBar().setSuccessText("Mitgliedskonto zugeordnet");
GUI.getStatusBar().setSuccessText("Sollbuchung zugeordnet");
}
}
}
Expand All @@ -133,7 +133,7 @@ else if (open instanceof Mitglied)
{
Logger.error("Fehler", e);
GUI.getStatusBar().setErrorText(
"Fehler bei der Zuordnung des Mitgliedskontos");
"Fehler bei der Zuordnung der Sollbuchung");
}
}
}
Expand Up @@ -18,20 +18,20 @@

import java.util.Date;

import de.jost_net.JVerein.gui.dialogs.BuchungenMitgliedskontenZuordnungDialog;
import de.jost_net.JVerein.gui.dialogs.BuchungenSollbuchungZuordnungDialog;
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.input.DateInput;
import de.willuhn.jameica.system.OperationCanceledException;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

public class BuchungMitgliedskontoZuordnungAutomatischAction implements Action
public class BuchungSollbuchungZuordnungAutomatischAction implements Action
{
private DateInput vondatum;
private DateInput bisdatum;

public BuchungMitgliedskontoZuordnungAutomatischAction(DateInput vondatum, DateInput bisdatum) {
public BuchungSollbuchungZuordnungAutomatischAction(DateInput vondatum, DateInput bisdatum) {
this.vondatum = vondatum;
this.bisdatum = bisdatum;
}
Expand All @@ -44,7 +44,7 @@ public void handleAction(Object context) throws ApplicationException
{
try
{
BuchungenMitgliedskontenZuordnungDialog d = new BuchungenMitgliedskontenZuordnungDialog((Date)vondatum.getValue(), (Date)bisdatum.getValue());
BuchungenSollbuchungZuordnungDialog d = new BuchungenSollbuchungZuordnungDialog((Date)vondatum.getValue(), (Date)bisdatum.getValue());
d.open();
}
catch (OperationCanceledException oce)
Expand All @@ -58,7 +58,7 @@ public void handleAction(Object context) throws ApplicationException
catch (Exception e)
{
Logger.error("error while assign transfers to members", e);
GUI.getStatusBar().setErrorText("Fehler beim Zuordnen von Buchungen zu Mitgliedskonten");
GUI.getStatusBar().setErrorText("Fehler beim Zuordnen von Buchungen zu Sollbuchungen");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/de/jost_net/JVerein/gui/action/MitgliedDetailAction.java
Expand Up @@ -19,7 +19,7 @@
import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.control.FamilienbeitragNode;
import de.jost_net.JVerein.gui.dialogs.PersonenartDialog;
import de.jost_net.JVerein.gui.view.AdresseDetailView;
import de.jost_net.JVerein.gui.view.NichtMitgliedDetailView;
import de.jost_net.JVerein.gui.view.MitgliedDetailView;
import de.jost_net.JVerein.io.ArbeitseinsatzZeile;
import de.jost_net.JVerein.rmi.Mitglied;
Expand Down Expand Up @@ -83,7 +83,7 @@ else if (context != null && (context instanceof Mitgliedskonto))
}
else
{
GUI.startView(new AdresseDetailView(), m);
GUI.startView(new NichtMitgliedDetailView(), m);
}
}
catch (OperationCanceledException oce)
Expand Down
Expand Up @@ -16,7 +16,7 @@
**********************************************************************/
package de.jost_net.JVerein.gui.action;

import de.jost_net.JVerein.gui.view.AdresseDetailView;
import de.jost_net.JVerein.gui.view.NichtMitgliedDetailView;
import de.jost_net.JVerein.gui.view.MitgliedDetailView;
import de.jost_net.JVerein.rmi.Mitglied;
import de.willuhn.jameica.gui.Action;
Expand Down Expand Up @@ -44,7 +44,7 @@ public void handleAction(Object context) throws ApplicationException
}
else
{
GUI.startView(new AdresseDetailView(), m);
GUI.startView(new NichtMitgliedDetailView(), m);
}
}
catch (Exception e)
Expand Down
Expand Up @@ -29,7 +29,7 @@
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

public class MitgliedskontoIstLoesenAction implements Action
public class MitgliedskontoIstbuchungLoesenAction implements Action
{

@Override
Expand Down

0 comments on commit b1629e1

Please sign in to comment.