Skip to content

Commit

Permalink
SEPA XML-Version in Einstellungen (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannMaierhofer committed Feb 8, 2024
1 parent 5115f3a commit a9db8fa
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 11 deletions.
15 changes: 11 additions & 4 deletions src/de/jost_net/JVerein/gui/control/AbrechnungSEPAControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,18 @@ private void doAbrechnung() throws ApplicationException, RemoteException
settings.setAttribute("lastdir.sepa", sepafilercur.getParent());
try
{
PainVersionDialog d = new PainVersionDialog(org.kapott.hbci.sepa.SepaVersion.Type.PAIN_008);
sepaVersion = (SepaVersion) d.open();
if (sepaVersion == null)
if (Einstellungen.getEinstellung().getSepaVersion() != null)
{
return;
sepaVersion = Einstellungen.getEinstellung().getSepaVersion();
}
else
{
PainVersionDialog d = new PainVersionDialog(org.kapott.hbci.sepa.SepaVersion.Type.PAIN_008);
sepaVersion = (SepaVersion) d.open();
if (sepaVersion == null)
{
return;
}
}
}
catch (OperationCanceledException oce)
Expand Down
20 changes: 20 additions & 0 deletions src/de/jost_net/JVerein/gui/control/EinstellungControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
import java.rmi.RemoteException;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.kapott.hbci.sepa.SepaVersion;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.input.BICInput;
Expand Down Expand Up @@ -221,6 +223,8 @@ public class EinstellungControl extends AbstractControl
private SelectInput zahlungsrhytmus;

private SelectInput sepaland;

private SelectInput sepaversion;

private Input altersgruppen;

Expand Down Expand Up @@ -1250,6 +1254,21 @@ public SelectInput getDefaultSEPALand() throws RemoteException
sepaland = new SEPALandInput(sl);
return sepaland;
}

public SelectInput getSepaVersion() throws RemoteException
{
if (sepaversion != null)
{
return sepaversion;
}
List<SepaVersion> list = SepaVersion.getKnownVersions(
org.kapott.hbci.sepa.SepaVersion.Type.PAIN_008);
sepaversion = new SelectInput(list,
Einstellungen.getEinstellung().getSepaVersion());
sepaversion.setAttribute("file");
sepaversion.setPleaseChoose("Bitte auswählen");
return sepaversion;
}

public Input getAltersgruppen() throws RemoteException
{
Expand Down Expand Up @@ -1851,6 +1870,7 @@ public void handleStoreAbrechnung()
e.setZahlungsweg(zw.getKey());
SEPALandObject slo = (SEPALandObject) getDefaultSEPALand().getValue();
e.setDefaultLand(slo.getLand().getKennzeichen());
e.setSepaVersion((SepaVersion) sepaversion.getValue());
e.setSEPADatumOffset((Integer) sepadatumoffset.getValue());
e.setAbrlAbschliessen((Boolean) abrlabschliessen.getValue());
e.store();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public void bind() throws Exception
cont.addInput(control.getZahlungsweg());
cont.addInput(control.getSEPADatumOffset());
cont.addInput(control.getDefaultSEPALand());
cont.addLabelPair("SEPA XML-Version",
control.getSepaVersion());
cont.addLabelPair("Arbeitsstunden Modell",
control.getArbeitsstundenmodel());
cont.addLabelPair("Abrechnungslauf abschließen",
Expand Down
7 changes: 6 additions & 1 deletion src/de/jost_net/JVerein/rmi/Einstellung.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import java.rmi.RemoteException;
import java.util.Date;
import org.kapott.hbci.sepa.SepaVersion;

import de.jost_net.JVerein.io.IBankverbindung;
import de.jost_net.JVerein.keys.Beitragsmodel;
import de.willuhn.datasource.rmi.DBObject;
import de.willuhn.jameica.gui.input.CheckboxInput;

public interface Einstellung extends DBObject, IBankverbindung
{
Expand Down Expand Up @@ -528,5 +528,10 @@ public void setBuchungBuchungsartAuswahl(int buchungBuchungsartAuswahl)
public Boolean getOptiert() throws RemoteException;

public void setOptiert(Boolean optiert) throws RemoteException;

public void setSepaVersion(SepaVersion sepaversion)
throws RemoteException;

public SepaVersion getSepaVersion() throws RemoteException;

}
36 changes: 36 additions & 0 deletions src/de/jost_net/JVerein/server/DDLTool/Updates/Update0431.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**********************************************************************
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If not,
* see <http://www.gnu.org/licenses/>.
*
**********************************************************************/
package de.jost_net.JVerein.server.DDLTool.Updates;

import de.jost_net.JVerein.server.DDLTool.AbstractDDLUpdate;
import de.jost_net.JVerein.server.DDLTool.Column;
import de.willuhn.util.ApplicationException;
import de.willuhn.util.ProgressMonitor;

import java.sql.Connection;

public class Update0431 extends AbstractDDLUpdate
{
public Update0431(String driver, ProgressMonitor monitor, Connection conn)
{
super(driver, monitor, conn);
}

@Override
public void run() throws ApplicationException
{
execute(addColumn("einstellung",
new Column("sepaversion", COLTYPE.VARCHAR, 50, null, false, false)));
}
}
34 changes: 28 additions & 6 deletions src/de/jost_net/JVerein/server/EinstellungImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.Serializable;
import java.rmi.RemoteException;
import java.util.Date;
import org.kapott.hbci.sepa.SepaVersion;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.JVereinPlugin;
Expand All @@ -29,9 +30,6 @@
import de.jost_net.JVerein.keys.BuchungBuchungsartAuswahl;
import de.jost_net.JVerein.rmi.Einstellung;
import de.jost_net.JVerein.rmi.Felddefinition;
import de.jost_net.OBanToo.SEPA.BIC;
import de.jost_net.OBanToo.SEPA.IBAN;
import de.jost_net.OBanToo.SEPA.SEPAException;
import de.willuhn.datasource.db.AbstractDBObject;
import de.willuhn.datasource.rmi.DBIterator;
import de.willuhn.datasource.rmi.DBService;
Expand Down Expand Up @@ -835,7 +833,7 @@ public double getSpendenbescheinigungminbetrag() throws RemoteException
Double d = (Double) getAttribute("spendenbescheinigungminbetrag");
if (d == null)
{
d = new Double(0);
d = Double.valueOf(0.0d);
}
return (d);
}
Expand Down Expand Up @@ -1330,7 +1328,7 @@ public boolean hasZusatzfelder() throws RemoteException
{
DBIterator<Felddefinition> it = Einstellungen.getDBService()
.createList(Felddefinition.class);
hasZus = new Boolean(it.size() > 0);
hasZus = Boolean.valueOf(it.size() > 0);
}
return hasZus;
}
Expand Down Expand Up @@ -1699,7 +1697,7 @@ public Integer getSEPADatumOffset() throws RemoteException
Integer offset = (Integer) getAttribute("sepadatumoffset");
if (offset == null)
{
offset = new Integer(0);
offset = Integer.valueOf(0);
}
return offset;
}
Expand Down Expand Up @@ -1753,5 +1751,29 @@ public void setAbrlAbschliessen(Boolean abschliessen) throws RemoteException
{
setAttribute("abrlabschliessen", Boolean.valueOf(abschliessen));
}

@Override
public SepaVersion getSepaVersion() throws RemoteException
{
String sepaversion = (String) getAttribute("sepaversion");
if (sepaversion == null || !(sepaversion.length() > 0))
{
return null;
}
return SepaVersion.byURN(sepaversion);
}

@Override
public void setSepaVersion(SepaVersion sepaversion) throws RemoteException
{
if (sepaversion == null)
{
setAttribute("sepaversion", null);
}
else
{
setAttribute("sepaversion", sepaversion.getFile());
}
}

}

0 comments on commit a9db8fa

Please sign in to comment.