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

Fehler bei Autosplit und Buchungszuordnung #601

Merged
merged 6 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions src/de/jost_net/JVerein/gui/control/EinstellungControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ public class EinstellungControl extends AbstractControl

private DialogInput verrechnungskonto;

private CheckboxInput splitpositionzweck;

public EinstellungControl(AbstractView view)
{
super(view);
Expand Down Expand Up @@ -845,6 +847,19 @@ public CheckboxInput getOptiert() throws RemoteException
return optiert;
}

public CheckboxInput getSplitPositionZweck() throws RemoteException
{
if (splitpositionzweck != null)
{
return splitpositionzweck;
}
splitpositionzweck = new CheckboxInput(
Einstellungen.getEinstellung().getSplitPositionZweck());
splitpositionzweck.setName("Bei automatischem Splitten den "
+ "Verwendungszweck aus den Sollbuchungspositionen übernehmen");
return splitpositionzweck;
}

public CheckboxInput getFreieBuchungsklasse() throws RemoteException
{
if (freiebuchungsklasse != null)
Expand Down Expand Up @@ -2351,6 +2366,7 @@ public void handleStoreBuchfuehrung()
e.setKontonummerInBuchungsliste((Boolean) kontonummer_in_buchungsliste.getValue());
e.setOptiert((Boolean) getOptiert().getValue());
e.setBuchungsklasseInBuchung((Boolean) getFreieBuchungsklasse().getValue());
e.setSplitPositionZweck((Boolean) getSplitPositionZweck().getValue());
e.store();
Einstellungen.setEinstellung(e);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.eclipse.swt.widgets.Composite;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.keys.SplitbuchungTyp;
import de.jost_net.JVerein.keys.Zahlungsweg;
import de.jost_net.JVerein.rmi.Buchung;
import de.jost_net.JVerein.rmi.Mitglied;
Expand Down Expand Up @@ -286,6 +287,8 @@ public Object extract(ResultSet rs) throws SQLException, RemoteException
DBIterator<Buchung> buchungen = Einstellungen.getDBService().createList(Buchung.class);
buchungen.addFilter("datum >= ?", dateFromInput);
buchungen.addFilter("datum <= ?", dateUntilInput);
buchungen.addFilter("splittyp != ?", SplitbuchungTyp.HAUPT);
buchungen.addFilter("splittyp != ?", SplitbuchungTyp.GEGEN);
buchungen.addFilter("mitgliedskonto is null");
buchungen.setOrder("ORDER BY datum");

Expand All @@ -304,7 +307,10 @@ public Object extract(ResultSet rs) throws SQLException, RemoteException
uniqueNames.get(bookingPurpose), "Vorname und Nachname")
|| assginMemberAccountToBooking(assignedBooking,
usedMemberAccount, dateFromInput, dateUntilInput, buchung,
uniqueZweck.get(buchung.getZweck()), "Verwendungszweck"))
uniqueNames.get(buchung.getName()), "Vorname und Nachname")
|| assginMemberAccountToBooking(assignedBooking,
usedMemberAccount, dateFromInput, dateUntilInput, buchung,
uniqueZweck.get(bookingPurpose), "Verwendungszweck"))
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void bind() throws Exception
cont.addInput(control.getKontonummerInBuchungsliste());
cont.addInput(control.getOptiert());
cont.addInput(control.getFreieBuchungsklasse());
cont.addInput(control.getSplitPositionZweck());

ButtonArea buttons = new ButtonArea();
buttons.addButton("Hilfe", new DokumentationAction(),
Expand Down
8 changes: 4 additions & 4 deletions src/de/jost_net/JVerein/io/SplitbuchungsContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.dialogs.YesNoDialog;
import de.willuhn.jameica.system.OperationCanceledException;
import de.willuhn.jameica.system.Settings;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -416,6 +415,7 @@ else if (splitMap.size() > 1)
{
throw new OperationCanceledException();
}
splitten = true;
}
if (splitten)
{
Expand Down Expand Up @@ -470,8 +470,8 @@ else if (buchung.getSplitTyp() == SplitbuchungTyp.GEGEN
}
}

boolean splitPositionZweck = new Settings(SplitbuchungsContainer.class)
.getBoolean("splitPositionZweck", true);
boolean splitPositionZweck = Einstellungen.getEinstellung()
.getSplitPositionZweck();
Iterator<Entry<String, Double>> iterator = splitMap.entrySet()
.iterator();
while (iterator.hasNext())
Expand All @@ -490,7 +490,7 @@ else if (buchung.getSplitTyp() == SplitbuchungTyp.GEGEN
}
else
{
splitBuchung.setZweck(mk.getZweck1());
splitBuchung.setZweck(buchung.getZweck());
}
splitBuchung.setMitgliedskonto(mk);
String buchungsart = entry.getKey().substring(0,
Expand Down
4 changes: 4 additions & 0 deletions src/de/jost_net/JVerein/rmi/Einstellung.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,8 @@ public void setCt1SepaVersion(SepaVersion sepaversion)
public Long getVerrechnungskontoId() throws RemoteException;

public void setVerrechnungskontoId(Long konto) throws RemoteException;

public boolean getSplitPositionZweck() throws RemoteException;

public void setSplitPositionZweck(boolean split) throws RemoteException;;
}
36 changes: 36 additions & 0 deletions src/de/jost_net/JVerein/server/DDLTool/Updates/Update0460.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 java.sql.Connection;

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;

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

@Override
public void run() throws ApplicationException
{
execute(addColumn("einstellung", new Column("splitpositionzweck",
COLTYPE.BOOLEAN, 1, "0", true, false)));
}
}
12 changes: 12 additions & 0 deletions src/de/jost_net/JVerein/server/EinstellungImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2209,4 +2209,16 @@ public void setVerrechnungskontoId(Long konto) throws RemoteException
{
setAttribute("verrechnungskonto", konto);
}

@Override
public boolean getSplitPositionZweck() throws RemoteException
{
return (Boolean) getAttribute("splitpositionzweck");
}

@Override
public void setSplitPositionZweck(boolean split) throws RemoteException
{
setAttribute("splitpositionzweck", split);
}
}
Loading