Skip to content

Commit

Permalink
Merge branch 'master' into Spendenbescheinigung_auf_zahler_ausstellen
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann Maierhofer committed Jan 24, 2025
2 parents b24ec57 + e342eee commit eaa6b3a
Show file tree
Hide file tree
Showing 33 changed files with 1,053 additions and 162 deletions.
10 changes: 4 additions & 6 deletions src/de/jost_net/JVerein/Queries/SollbuchungQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,13 @@ else if (ein_zahler_name && umwandeln)

if (DIFFERENZ.FEHLBETRAG == diff)
{
sql.append(
" HAVING SUM(buchung.betrag) < mitgliedskonto.betrag OR"
+ " (SUM(buchung.betrag) IS NULL AND mitgliedskonto.betrag > 0)");
sql.append(" (HAVING SUM(buchung.betrag) < mitgliedskonto.betrag OR "
+ "(SUM(buchung.betrag) IS NULL AND mitgliedskonto.betrag > 0))");
}
if (DIFFERENZ.UEBERZAHLUNG == diff)
{
sql.append(
" HAVING SUM(buchung.betrag) > mitgliedskonto.betrag OR"
+ " (SUM(buchung.betrag) IS NULL AND mitgliedskonto.betrag < 0)");
sql.append(" (HAVING SUM(buchung.betrag) > mitgliedskonto.betrag OR"
+ "(SUM(buchung.betrag) IS NULL AND mitgliedskonto.betrag < 0))");
}

List<Long> ids = (List<Long>) service.execute(sql.toString(), param.toArray(),
Expand Down
21 changes: 17 additions & 4 deletions src/de/jost_net/JVerein/gui/action/RechnungNeuAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
**********************************************************************/
package de.jost_net.JVerein.gui.action;

import java.util.Date;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.dialogs.FormularAuswahlDialog;
import de.jost_net.JVerein.gui.dialogs.RechnungDialog;
import de.jost_net.JVerein.rmi.Formular;
import de.jost_net.JVerein.rmi.Mitgliedskonto;
import de.jost_net.JVerein.rmi.Rechnung;
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.system.OperationCanceledException;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -53,9 +56,14 @@ else if (context instanceof Mitgliedskonto[])

try
{
FormularAuswahlDialog dialog = new FormularAuswahlDialog();
Formular formular = dialog.open();
if (formular == null)
RechnungDialog dialog = new RechnungDialog();
if (!dialog.open())
{
return;
}
Formular formular = dialog.getFormular();
Date rechnungsdatum = dialog.getDatum();
if (formular == null || rechnungsdatum == null)
{
return;
}
Expand All @@ -72,6 +80,7 @@ else if (context instanceof Mitgliedskonto[])
.createObject(Rechnung.class, null);

rechnung.setFormular(formular);
rechnung.setDatum(rechnungsdatum);
rechnung.fill(mk);
rechnung.store();

Expand All @@ -89,6 +98,10 @@ else if (context instanceof Mitgliedskonto[])
GUI.getStatusBar().setSuccessText(erstellt + " Rechnung(en) erstellt"
+ (skip > 0 ? ", " + skip + " vorhandene übersprungen." : "."));
}
}
catch (OperationCanceledException ignore)
{

}
catch (Exception e)
{
Expand Down
27 changes: 9 additions & 18 deletions src/de/jost_net/JVerein/gui/action/SollbuchungEditAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,30 @@ public class SollbuchungEditAction implements Action
@Override
public void handleAction(Object context) throws ApplicationException
{
MitgliedskontoNode mkn = null;
Mitgliedskonto mk = null;
MitgliedskontoNode mkn = null;

if (context != null && (context instanceof MitgliedskontoNode))
if (context instanceof Mitgliedskonto)
{
mk = (Mitgliedskonto) context;
}
else if (context instanceof MitgliedskontoNode)
{
mkn = (MitgliedskontoNode) context;
try
{
mk = (Mitgliedskonto) Einstellungen.getDBService().createObject(
Mitgliedskonto.class, mkn.getID());
mk = (Mitgliedskonto) Einstellungen.getDBService()
.createObject(Mitgliedskonto.class, mkn.getID());
}
catch (RemoteException e)
{
throw new ApplicationException(
"Fehler beim Editieren einer Sollbuchung");
}
}
else if (context != null && (context instanceof Mitgliedskonto))
{
mk = (Mitgliedskonto) context;
}
else
{
try
{
mk = (Mitgliedskonto) Einstellungen.getDBService().createObject(
Mitgliedskonto.class, null);
}
catch (Exception e)
{
throw new ApplicationException(
"Fehler bei der Erzeugung einer neuen Sollbuchung", e);
}
throw new ApplicationException("Keine Sollbuchung ausgewählt");
}
GUI.startView(new SollbuchungDetailView(), mk);
}
Expand Down
45 changes: 25 additions & 20 deletions src/de/jost_net/JVerein/gui/action/SollbuchungNeuAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,38 @@ public void handleAction(Object context) throws ApplicationException
MitgliedskontoNode mkn = null;
Mitgliedskonto mk = null;

if (context == null || !(context instanceof MitgliedskontoNode))
if (context instanceof MitgliedskontoNode)
{
throw new ApplicationException("Keine Sollbuchung ausgewählt");
}

mkn = (MitgliedskontoNode) context;
try
{
Mitglied m = (Mitglied) Einstellungen.getDBService()
.createObject(Mitglied.class, mkn.getID());
mk = (Mitgliedskonto) Einstellungen.getDBService()
.createObject(Mitgliedskonto.class, null);
mk.setZahlungsweg(m.getZahlungsweg());
mk.setMitglied(m);
if (m.getZahlerID() != null)
mkn = (MitgliedskontoNode) context;
try
{
mk.setZahlerId(m.getZahlerID());
Mitglied m = (Mitglied) Einstellungen.getDBService()
.createObject(Mitglied.class, mkn.getID());
mk = (Mitgliedskonto) Einstellungen.getDBService()
.createObject(Mitgliedskonto.class, null);
mk.setZahlungsweg(m.getZahlungsweg());
mk.setMitglied(m);
mk.setBetrag(0.0);
}
else
catch (RemoteException e)
{
mk.setZahler(m);
throw new ApplicationException(
"Fehler bei der Erzeugung einer Sollbuchung");
}
}
catch (RemoteException e)
else
{
throw new ApplicationException(
"Fehler bei der Erzeugung einer Sollbuchung");
try
{
mk = (Mitgliedskonto) Einstellungen.getDBService()
.createObject(Mitgliedskonto.class, null);
mk.setBetrag(0.0);
}
catch (Exception e)
{
throw new ApplicationException(
"Fehler bei der Erzeugung einer neuen Sollbuchung", e);
}
}
GUI.startView(new SollbuchungDetailView(), mk);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**********************************************************************
* Copyright (c) by Heiner Jostkleigrewe
* 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/>.
*
* [email protected]
* www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.gui.action;

import java.rmi.RemoteException;
import java.util.ArrayList;

import de.jost_net.JVerein.gui.view.SollbuchungDetailView;
import de.jost_net.JVerein.rmi.Mitgliedskonto;
import de.jost_net.JVerein.rmi.SollbuchungPosition;
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.dialogs.YesNoDialog;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

/**
* Löschen eines Formularfeldes
*/
public class SollbuchungPositionDeleteAction implements Action
{

@Override
public void handleAction(Object context) throws ApplicationException
{
if (context instanceof TablePart)
{
TablePart tp = (TablePart) context;
context = tp.getSelection();
}
if (context == null || !(context instanceof SollbuchungPosition))
{
throw new ApplicationException("Keine Sollbuchungsposition ausgewählt");
}
try
{
SollbuchungPosition position = (SollbuchungPosition) context;
if (position.isNewObject())
{
return;
}

YesNoDialog d = new YesNoDialog(YesNoDialog.POSITION_CENTER);
d.setTitle("Sollbuchungsposition löschen");
d.setText("Wollen Sie diese Sollbuchungsposition wirklich löschen?");

try
{
Boolean choice = (Boolean) d.open();
if (!choice.booleanValue())
{
return;
}
}
catch (Exception e)
{
Logger.error("Fehler beim Löschen der Sollbuchungsposition", e);
return;
}
position.delete();
// Betrag in Sollbuchung neu berechnen
Double betrag = 0.0;
Mitgliedskonto sollb = position.getSollbuchung();
ArrayList<SollbuchungPosition> sollbpList = sollb
.getSollbuchungPositionList();
for (SollbuchungPosition sollp : sollbpList)
{
betrag += sollp.getBetrag();
}
sollb.setBetrag(betrag);
sollb.store();
GUI.startView(SollbuchungDetailView.class.getName(), sollb);
GUI.getStatusBar().setSuccessText("Sollbuchungsposition gelöscht.");
}
catch (RemoteException e)
{
String fehler = "Fehler beim Löschen der Sollbuchungsposition";
GUI.getStatusBar().setErrorText(fehler);
Logger.error(fehler, e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**********************************************************************
* Copyright (c) by Heiner Jostkleigrewe
* 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/>.
*
* [email protected]
* www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.gui.action;

import de.jost_net.JVerein.gui.view.SollbuchungPositionView;
import de.jost_net.JVerein.rmi.SollbuchungPosition;
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.util.ApplicationException;

public class SollbuchungPositionEditAction implements Action
{

@Override
public void handleAction(Object context) throws ApplicationException
{
SollbuchungPosition position = null;

if (context != null && (context instanceof SollbuchungPosition))
{
position = (SollbuchungPosition) context;
}
else
{
throw new ApplicationException("Keine Sollbuchungsposition ausgewählt");
}

GUI.startView(SollbuchungPositionView.class.getName(), position);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**********************************************************************
* Copyright (c) by Heiner Jostkleigrewe
* 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/>.
*
* [email protected]
* www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.gui.action;

import java.rmi.RemoteException;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.view.SollbuchungPositionView;
import de.jost_net.JVerein.rmi.Mitgliedskonto;
import de.jost_net.JVerein.rmi.SollbuchungPosition;
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

public class SollbuchungPositionNeuAction implements Action
{

@Override
public void handleAction(Object context) throws ApplicationException
{
Mitgliedskonto sollbuchung = null;
SollbuchungPosition position = null;

if (context != null && (context instanceof Mitgliedskonto))
{
sollbuchung = (Mitgliedskonto) context;
try
{
if (sollbuchung.isNewObject())
{
throw new ApplicationException(
"Vor dem Anlegen der Sollbuchungsposition muss die Sollbuchung gespeichert werden!");
}
position = (SollbuchungPosition) Einstellungen.getDBService()
.createObject(SollbuchungPosition.class, null);
position.setSollbuchung(sollbuchung.getID());
}
catch (RemoteException e)
{
Logger.error("Fehler", e);
throw new ApplicationException(
"Fehler bei der Erzeugung einer neuen Sollbuchungsposition", e);
}
}
else
{
throw new ApplicationException("Keine Sollbuchung ausgewählt");
}

GUI.startView(SollbuchungPositionView.class.getName(), position);
}
}
Loading

0 comments on commit eaa6b3a

Please sign in to comment.