Skip to content

Commit

Permalink
Feature Filter Update (#276)
Browse files Browse the repository at this point in the history
* Einige Filter Updates

* Update AnfangsbestandControl.java

* Update Anfangsbestand Tabelle
  • Loading branch information
JohannMaierhofer authored Aug 1, 2024
1 parent 1c4ffcb commit 6dbcbae
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 15 deletions.
47 changes: 35 additions & 12 deletions src/de/jost_net/JVerein/gui/control/AbrechnungslaufControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import de.willuhn.datasource.rmi.DBIterator;
import de.willuhn.datasource.rmi.DBService;
import de.willuhn.datasource.rmi.ResultSetExtractor;
import de.willuhn.jameica.gui.AbstractControl;
import de.willuhn.jameica.gui.AbstractView;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.Part;
Expand All @@ -47,11 +46,9 @@
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

public class AbrechnungslaufControl extends AbstractControl
public class AbrechnungslaufControl extends FilterControl
{

private final de.willuhn.jameica.system.Settings settings;

private Abrechnungslauf abrl;

private TablePart abrechnungslaufList;
Expand All @@ -64,7 +61,7 @@ public class AbrechnungslaufControl extends AbstractControl

private LabelInput faelligkeit;

private LabelInput stichtag;
private LabelInput astichtag;

private LabelInput eingabedatum;

Expand All @@ -80,7 +77,7 @@ public class AbrechnungslaufControl extends AbstractControl

private LabelInput statistiklastschriften;

public AbrechnungslaufControl(AbstractView view)
public AbrechnungslaufControl(AbstractView view)
{
super(view);
settings = new de.willuhn.jameica.system.Settings(this.getClass());
Expand Down Expand Up @@ -145,16 +142,16 @@ public LabelInput getFaelligkeit() throws RemoteException
return faelligkeit;
}

public LabelInput getStichtag() throws RemoteException
public LabelInput getAbrechnungStichtag() throws RemoteException
{
if (stichtag != null)
if (astichtag != null)
{
return stichtag;
return astichtag;
}
stichtag = new LabelInput(new JVDateFormatTTMMJJJJ()
astichtag = new LabelInput(new JVDateFormatTTMMJJJJ()
.format(getAbrechnungslaeufe().getStichtag()));
stichtag.setName("Stichtag");
return stichtag;
astichtag.setName("Stichtag");
return astichtag;
}

public LabelInput getEingabedatum() throws RemoteException
Expand Down Expand Up @@ -349,6 +346,16 @@ public Part getAbrechungslaeufeList() throws RemoteException
DBService service = Einstellungen.getDBService();
DBIterator<Abrechnungslauf> abrechnungslaeufe = service
.createList(Abrechnungslauf.class);
if (isDatumvonAktiv() && getDatumvon().getValue() != null)
{
abrechnungslaeufe.addFilter("datum >= ?",
new Object[] { (Date) getDatumvon().getValue() });
}
if (isDatumbisAktiv() && getDatumbis().getValue() != null)
{
abrechnungslaeufe.addFilter("datum <= ?",
new Object[] { (Date) getDatumbis().getValue() });
}
abrechnungslaeufe.setOrder("ORDER BY datum DESC");

if (abrechnungslaufList == null)
Expand Down Expand Up @@ -388,5 +395,21 @@ public Part getAbrechungslaeufeList() throws RemoteException
}
return abrechnungslaufList;
}

public void TabRefresh()
{
if (abrechnungslaufList == null)
{
return;
}
try
{
getAbrechungslaeufeList();
}
catch (RemoteException e1)
{
Logger.error("Fehler", e1);
}
}

}
12 changes: 11 additions & 1 deletion src/de/jost_net/JVerein/gui/control/AnfangsbestandControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public Part getAnfangsbestandList() throws RemoteException
}
anfangsbestandList = new TablePart(getAnfangsstaende(),
new AnfangsbestandDetailAction());
anfangsbestandList.addColumn("Konto", "kontotext");
anfangsbestandList.addColumn("Nummer", "nummer");
anfangsbestandList.addColumn("Bezeichnung", "bezeichnung");
anfangsbestandList.addColumn("Datum", "datum",
new DateFormatter(new JVDateFormatTTMMJJJJ()));
anfangsbestandList.addColumn("Betrag", "betrag",
Expand Down Expand Up @@ -201,6 +202,15 @@ private DBIterator<Anfangsbestand> getAnfangsstaende() throws RemoteException
new Object[] { "%" + tmpSuchname.toLowerCase() + "%"});
}
}
if (isSuchtextAktiv() && getSuchtext().getValue() != null)
{
String tmpSuchtext = (String) getSuchtext().getValue();
if (tmpSuchtext.length() > 0)
{
anfangsbestaende.addFilter("(lower(nummer) like ?)",
new Object[] { "%" + tmpSuchtext.toLowerCase() + "%"});
}
}
if (isDatumvonAktiv() && getDatumvon().getValue() != null)
{
anfangsbestaende.addFilter("datum >= ?",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,15 @@ private DBIterator<Kursteilnehmer> getIterator() throws RemoteException
new Object[] { "%" + suchN + "%" });
}
}
if (isSuchtextAktiv() && getSuchtext().getValue() != null)
{
String tmpSuchtext = (String) getSuchtext().getValue();
if (tmpSuchtext.length() > 0)
{
kursteilnehmer.addFilter("(lower(vzweck1) like ?)",
new Object[] { "%" + tmpSuchtext.toLowerCase() + "%"});
}
}
if (isEingabedatumvonAktiv() && getEingabedatumvon().getValue() != null)
{
kursteilnehmer.addFilter("eingabedatum >= ?",
Expand Down
17 changes: 17 additions & 0 deletions src/de/jost_net/JVerein/gui/view/AbrechnungslaufListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
import de.willuhn.jameica.gui.AbstractView;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.parts.ButtonArea;
import de.willuhn.jameica.gui.util.ColumnLayout;
import de.willuhn.jameica.gui.util.LabelGroup;
import de.willuhn.jameica.gui.util.SimpleContainer;

public class AbrechnungslaufListView extends AbstractView
{
Expand All @@ -31,6 +34,20 @@ public void bind() throws Exception
GUI.getView().setTitle("Abrechnungsläufe");

AbrechnungslaufControl control = new AbrechnungslaufControl(this);

LabelGroup group = new LabelGroup(getParent(), "Filter");
ColumnLayout cl = new ColumnLayout(group.getComposite(), 2);

SimpleContainer left = new SimpleContainer(cl.getComposite());
left.addInput(control.getDatumvon());

SimpleContainer right = new SimpleContainer(cl.getComposite());
right.addInput(control.getDatumbis());

ButtonArea fbuttons = new ButtonArea();
fbuttons.addButton(control.getResetButton());
fbuttons.addButton(control.getSuchenButton());
group.addButtonArea(fbuttons);

control.getAbrechungslaeufeList().paint(this.getParent());

Expand Down
2 changes: 1 addition & 1 deletion src/de/jost_net/JVerein/gui/view/AbrechnungslaufView.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void bind() throws Exception
group.addInput(control.getAbgeschlossen());
group.addInput(control.getAbrechnungsmodus());
group.addInput(control.getFaelligkeit());
group.addInput(control.getStichtag());
group.addInput(control.getAbrechnungStichtag());
group.addInput(control.getEingabedatum());
group.addInput(control.getAustrittsdatum());
group.addInput(control.getZahlungsgrund());
Expand Down
3 changes: 2 additions & 1 deletion src/de/jost_net/JVerein/gui/view/AnfangsbestandListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public void bind() throws Exception
ColumnLayout cl = new ColumnLayout(group.getComposite(), 2);

SimpleContainer left = new SimpleContainer(cl.getComposite());
left.addLabelPair("Konto", control.getSuchname());
left.addLabelPair("Nummer", control.getSuchtext());
left.addLabelPair("Bezeichnung", control.getSuchname());

SimpleContainer right = new SimpleContainer(cl.getComposite());
right.addInput(control.getDatumvon());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public Object extract(ResultSet rs) throws SQLException

SimpleContainer left = new SimpleContainer(cl.getComposite());
left.addInput(control.getSuchname());
left.addLabelPair("Verwendungszweck", control.getSuchtext());

SimpleContainer middle = new SimpleContainer(cl.getComposite());
middle.addInput(control.getEingabedatumvon());
Expand Down
8 changes: 8 additions & 0 deletions src/de/jost_net/JVerein/server/AnfangsbestandImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ public Object getAttribute(String fieldName) throws RemoteException
{
return getKonto().getNummer() + " " + getKonto().getBezeichnung();
}
else if (fieldName.equals("nummer"))
{
return getKonto().getNummer();
}
else if (fieldName.equals("bezeichnung"))
{
return getKonto().getBezeichnung();
}
else
{
return super.getAttribute(fieldName);
Expand Down

0 comments on commit 6dbcbae

Please sign in to comment.