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

feature/belegnummer #58

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2e848db
Belegnummern können verwendet werden: Update der Datenbank (mit Impor…
VinRud Apr 13, 2020
f1c553a
Belegnummer wird in der Auswertung berücksichtigt (entsprechend der v…
VinRud Apr 13, 2020
15055f4
die Views "Splitbuchung" und "Spendenbescheinigung" sollen auch ggf. …
VinRud Apr 13, 2020
35feda9
Belegnummern werden automatisch inkrementiert. Dabei kann der Inkreme…
VinRud Apr 14, 2020
6fa6779
in DB Update: Falls Fehler beim Import auftritt, sollen die zuvor neu…
VinRud Apr 15, 2020
14e4b38
auslesen der letzten Belegnummer direkt über SQL Befehl anstatt Filte…
VinRud Apr 16, 2020
f221a44
Merge branch 'feature/belegnummer'
Nov 10, 2022
bcba0ab
Update BuchungsControl.java
FullHD23 Oct 25, 2023
6687896
Merge remote-tracking branch 'openjverein/master' into feature/belegn…
Oct 29, 2023
bcd74a6
Fix: Umlaut in BuchungsControl.java & formatting
Oct 29, 2023
990f827
Merge remote-tracking branch 'openjverein/master' into feature/belegn…
Nov 12, 2023
d71f4c2
Merge remote-tracking branch 'openjverein/master' into feature/belegn…
Nov 24, 2023
af46cea
Fix: setUnterdrueckungOhneBuchung doppelt
Nov 26, 2023
ddc5c85
Fix. Encoding text
Nov 26, 2023
17df4c9
Fix: encoding issues
Nov 26, 2023
6013e91
Merge remote-tracking branch 'origin/feature/belegnummer' into featur…
Nov 26, 2023
b7f57cf
Merge remote-tracking branch 'openjverein/master' into feature/belegn…
Dec 9, 2023
4b06048
Merge remote-tracking branch 'openjverein/master' into feature/belegn…
Dec 11, 2023
76dfce4
Merge remote-tracking branch 'openjverein/master' into feature/belegn…
Dec 27, 2023
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
61 changes: 51 additions & 10 deletions src/de/jost_net/JVerein/Einstellungen.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
/**********************************************************************
* 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
*
* 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.
* 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/>.
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <http://www.gnu.org/licenses/>.
*
* heiner@jverein.de
* www.jverein.de
* heiner@jverein.de | www.jverein.de
**********************************************************************/

package de.jost_net.JVerein;

import java.rmi.RemoteException;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;

import java.util.GregorianCalendar;
import de.jost_net.JVerein.io.MailSender.IMAPCopyData;
import de.jost_net.JVerein.keys.Altermodel;
import de.jost_net.JVerein.keys.ArbeitsstundenModel;
import de.jost_net.JVerein.keys.Beitragsmodel;
import de.jost_net.JVerein.keys.SepaMandatIdSource;
import de.jost_net.JVerein.rmi.Beitragsgruppe;
import de.jost_net.JVerein.rmi.Einstellung;
import de.jost_net.JVerein.util.JVDateFormatTTMMJJJJ;
import de.willuhn.datasource.rmi.DBIterator;
import de.willuhn.datasource.rmi.DBService;
import de.willuhn.jameica.hbci.rmi.HBCIDBService;
Expand Down Expand Up @@ -226,6 +228,45 @@ public static void setEinstellung(Einstellung einst)
einstellung = einst;
}

public static GregorianCalendar getBeginnGeschaeftsjahr(
dippeal marked this conversation as resolved.
Show resolved Hide resolved
GregorianCalendar date)
{
GregorianCalendar BeginnGeschaeftsjahr = new GregorianCalendar();
try
{
BeginnGeschaeftsjahr.setTime(new JVDateFormatTTMMJJJJ()
.parse(getEinstellung().getBeginnGeschaeftsjahr()
+ ((Integer) date.get(Calendar.YEAR)).toString()));
if (BeginnGeschaeftsjahr.compareTo(date) > 0)
{
BeginnGeschaeftsjahr.add(Calendar.YEAR, -1);
}
}
catch (RemoteException e)
{
Logger.error("Error while reading \"BeginnGeschaeftsjahr!\"", e);
BeginnGeschaeftsjahr.set(Calendar.YEAR, date.get(Calendar.YEAR));
BeginnGeschaeftsjahr.set(Calendar.MONTH, 1);
BeginnGeschaeftsjahr.set(Calendar.DAY_OF_MONTH, 1);
}
catch (ParseException e)
{
Logger.error("Error while parsing \"BeginnGeschaeftsjahr!\"", e);
BeginnGeschaeftsjahr.set(Calendar.YEAR, date.get(Calendar.YEAR));
BeginnGeschaeftsjahr.set(Calendar.MONTH, 1);
BeginnGeschaeftsjahr.set(Calendar.DAY_OF_MONTH, 1);
}
return BeginnGeschaeftsjahr;
}

public static GregorianCalendar getEndeGeschaeftsjahr(GregorianCalendar date)
{
GregorianCalendar EndeGeschaeftsjahr = getBeginnGeschaeftsjahr(date);
EndeGeschaeftsjahr.add(Calendar.YEAR, 1);
EndeGeschaeftsjahr.add(Calendar.DAY_OF_MONTH, -1);
return EndeGeschaeftsjahr;
}

/**
* Prueft, ob die MD5-Checksumme der Datenbank geprueft werden soll.
*
Expand Down
100 changes: 57 additions & 43 deletions src/de/jost_net/JVerein/Queries/BuchungQuery.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**********************************************************************
* 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
*
* 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.
* 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/>.
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <http://www.gnu.org/licenses/>.
*
* heiner@jverein.de
* www.jverein.de
* heiner@jverein.de | www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.Queries;

Expand Down Expand Up @@ -51,25 +51,32 @@ public class BuchungQuery
private List<Buchung> ergebnis;

private Boolean hasMitglied;

private HashMap<String, String> sortValues = new HashMap<String, String>();

private void SortHashMap() {
sortValues.put("ORDER_ID","order by id");
sortValues.put("ORDER_DATUM","order by datum");
sortValues.put("ORDER_DATUM_NAME","order by datum, name");
sortValues.put("ORDER_DATUM_ID","order by datum, id");
sortValues.put("ORDER_DATUM_ID_NAME","order by datum, id, name");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER","order by datum, auszugsnummer");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER_NAME","order by datum, auszugsnummer, name");
sortValues.put("ORDER_DATUM_BLATTNUMMER","order by datum, blattnummer");
sortValues.put("ORDER_DATUM_BLATTNUMMER_NAME","order by datum, blattnummer, name");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER_ID","order by datum, auszugsnummer, id");
sortValues.put("ORDER_DATUM_BLATTNUMMER_ID","order by datum, blattnummer, id");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER_BLATTNUMMER_ID","order by datum, auszugsnummer, blattnummer, id");
sortValues.put("DEFAULT","order by datum");
private void SortHashMap()
{
sortValues.put("ORDER_ID", "order by id");
sortValues.put("ORDER_DATUM", "order by datum");
sortValues.put("ORDER_DATUM_NAME", "order by datum, name");
sortValues.put("ORDER_DATUM_ID", "order by datum, id");
sortValues.put("ORDER_DATUM_ID_NAME", "order by datum, id, name");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER",
"order by datum, auszugsnummer");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER_NAME",
"order by datum, auszugsnummer, name");
sortValues.put("ORDER_DATUM_BLATTNUMMER", "order by datum, blattnummer");
sortValues.put("ORDER_DATUM_BLATTNUMMER_NAME",
"order by datum, blattnummer, name");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER_ID",
"order by datum, auszugsnummer, id");
sortValues.put("ORDER_DATUM_BLATTNUMMER_ID",
"order by datum, blattnummer, id");
sortValues.put("ORDER_DATUM_AUSZUGSNUMMER_BLATTNUMMER_ID",
"order by datum, auszugsnummer, blattnummer, id");
sortValues.put("DEFAULT", "order by datum");
}

public String ordername = null;

public BuchungQuery(Date datumvon, Date datumbis, Konto konto,
Expand All @@ -85,27 +92,33 @@ public BuchungQuery(Date datumvon, Date datumbis, Konto konto,
this.betrag = betrag;
this.hasMitglied = hasMitglied;
}

public String getOrder(String value) {
SortHashMap();
String newvalue = null;
if ( value == null ) {
return sortValues.get("DEFAULT");
} else {
newvalue = value.replaceAll(", ", "_");
newvalue = newvalue.toUpperCase();
newvalue = "ORDER_" + newvalue;
return sortValues.get(newvalue);
}

public String getOrder(String value)
{
SortHashMap();
String newvalue = null;
if (value == null)
{
return sortValues.get("DEFAULT");
}
else
{
newvalue = value.replaceAll(", ", "_");
newvalue = newvalue.toUpperCase();
newvalue = "ORDER_" + newvalue;
return sortValues.get(newvalue);
}

}

public void setOrdername(String value)
{
if ( value != null ) {
ordername = value;
if (value != null)
{
ordername = value;
}
}

public Boolean getHasMitglied()
{
return hasMitglied;
Expand Down Expand Up @@ -251,9 +264,10 @@ else if (buchungart.getNummer() >= 0)
// 20220823: sbuer: Neue Sortierfelder
SortHashMap();
String orderString = getOrder(ordername);
// System.out.println("ordervalue : " + ordername + " ,orderString : " + orderString);
// System.out.println("ordervalue : " + ordername + " ,orderString : " +
// orderString);
it.setOrder(orderString);

this.ergebnis = PseudoIterator.asList(it);
return ergebnis;
}
Expand Down
19 changes: 10 additions & 9 deletions src/de/jost_net/JVerein/Variable/BuchungVar.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**********************************************************************
* 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
*
* 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.
* 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/>.
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <http://www.gnu.org/licenses/>.
*
* heiner@jverein.de
* www.jverein.de
* heiner@jverein.de | www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.Variable;

Expand All @@ -21,6 +21,7 @@ public enum BuchungVar
ABRECHNUNGSLAUF("buchung_abrechnungslauf"), //
ART("buchung_art"), //
AUSZUGSNUMMER("buchung_auszugsnummer"), //
BELEG("buchung_belegnummer"), //
BETRAG("buchung_betrag"), //
BLATTNUMMER("buchung_blattnummer"), //
BUCHUNGSARBEZEICHNUNG("buchung_buchungsart_bezeichnung"), //
Expand Down
20 changes: 11 additions & 9 deletions src/de/jost_net/JVerein/gui/action/BuchungNeuAction.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**********************************************************************
* 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
*
* 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.
* 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/>.
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <http://www.gnu.org/licenses/>.
*
* heiner@jverein.de
* www.jverein.de
* heiner@jverein.de | www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.gui.action;

Expand Down Expand Up @@ -43,6 +43,8 @@ public void handleAction(Object context)
Konto konto = (Konto) control.getSuchKonto().getValue();
if (null != konto)
buch.setKonto(konto);
buch.setBelegnummer(BuchungsControl.getLastBelegnummer(buch.getDatum(),
buch.getKonto().getID()) + 1);
}
GUI.startView(BuchungView.class, buch);
}
Expand Down
25 changes: 12 additions & 13 deletions src/de/jost_net/JVerein/gui/action/SplitbuchungNeuAction.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/**********************************************************************
* 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.
* 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.
* 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/>.
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <http://www.gnu.org/licenses/>.
*
* heiner@jverein.de
* www.jverein.de
* heiner@jverein.de www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.gui.action;

Expand All @@ -35,8 +33,8 @@ public void handleAction(Object context)
try
{
Buchung master = SplitbuchungsContainer.getMaster();
Buchung buch = (Buchung) Einstellungen.getDBService().createObject(Buchung.class,
null);
Buchung buch = (Buchung) Einstellungen.getDBService()
.createObject(Buchung.class, null);
buch.setAuszugsnummer(master.getAuszugsnummer());
buch.setBlattnummer(master.getBlattnummer());
buch.setDatum(master.getDatum());
Expand All @@ -47,6 +45,7 @@ public void handleAction(Object context)
buch.setProjekt(master.getProjekt());
buch.setSplitId(new Long(master.getID()));
buch.setUmsatzid(master.getUmsatzid());
buch.setBelegnummer(master.getBelegnummer());
buch.setZweck(master.getZweck());
buch.setSpeicherung(false);
buch.setSplitTyp(SplitbuchungTyp.SPLIT);
Expand Down
Loading