Skip to content

Commit

Permalink
Einige Korrekturen und Fixes (#201)
Browse files Browse the repository at this point in the history
* Kleinere Korrekturen und ein Fix

* weitere änderung

* use saveDefaults

* else Zweig

* Typo für MitgliedskontoControl

* check != null

* falscher suchname

* Fix Namensfilter in Sollbuchungen View
  • Loading branch information
JohannMaierhofer committed Apr 9, 2024
1 parent f70b47f commit 8ac3e5e
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 70 deletions.
23 changes: 6 additions & 17 deletions src/de/jost_net/JVerein/gui/control/KontensaldoControl.java
Expand Up @@ -18,19 +18,17 @@

import java.io.File;
import java.rmi.RemoteException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.parts.KontensaldoList;
import de.jost_net.JVerein.io.JahressaldoPDF;
import de.jost_net.JVerein.io.KontenSaldoPDF;
import de.jost_net.JVerein.io.SaldoZeile;
import de.jost_net.JVerein.util.Dateiname;
import de.jost_net.JVerein.util.Geschaeftsjahr;
import de.jost_net.JVerein.util.JVDateFormatTTMMJJJJ;
import de.willuhn.jameica.gui.AbstractView;
import de.willuhn.jameica.gui.Action;
Expand Down Expand Up @@ -138,27 +136,18 @@ private void starteAuswertung() throws ApplicationException

final File file = new File(s);
settings.setAttribute("lastdir", file.getParent());
Calendar cal = Calendar.getInstance();
cal.setTime(getDatumvon().getDate());
int jahr = cal.get(Calendar.YEAR);
Geschaeftsjahr gj = new Geschaeftsjahr(jahr);

auswertungSaldoPDF(zeile, file, gj);
auswertungSaldoPDF(zeile, file, getDatumvon().getDate(),
getDatumbis().getDate());
}
catch (RemoteException e)
{
throw new ApplicationException(
"Fehler beim Aufbau des Reports: " + e.getMessage());
}
catch (ParseException e)
{
throw new ApplicationException(
"Fehler beim Aufbau des Reports: " + e.getMessage());
}
}

private void auswertungSaldoPDF(final ArrayList<SaldoZeile> zeile,
final File file, final Geschaeftsjahr gj)
final File file, final Date datumvon, final Date datumbis)
{
BackgroundTask t = new BackgroundTask()
{
Expand All @@ -168,7 +157,7 @@ public void run(ProgressMonitor monitor) throws ApplicationException
{
try
{
new JahressaldoPDF(zeile, file, gj);
new KontenSaldoPDF(zeile, file, datumvon, datumbis);
GUI.getCurrentView().reload();
}
catch (ApplicationException ae)
Expand Down
16 changes: 14 additions & 2 deletions src/de/jost_net/JVerein/gui/control/MitgliedControl.java
Expand Up @@ -2548,7 +2548,7 @@ public TextInput getSuchExterneMitgliedsnummer()
{
return suchexternemitgliedsnummer;
}
suchexternemitgliedsnummer = new TextInput("", 50);
suchexternemitgliedsnummer = new TextInput(settings.getString(mitgliedtyp + ".suchExterneMitgliedsNummer",""), 50);
return suchexternemitgliedsnummer;
}

Expand Down Expand Up @@ -2793,7 +2793,19 @@ public void saveDefaults() throws RemoteException
settings.setAttribute("status.mitglied",
(String) getMitgliedStatus().getValue());
}

if (Einstellungen.getEinstellung().getExterneMitgliedsnummer() &&
suchexternemitgliedsnummer != null)
{
String tmp = (String) getSuchExterneMitgliedsnummer().getValue();
if (tmp != null)
{
settings.setAttribute(mitgliedtyp + ".suchExterneMitgliedsNummer",tmp);
}
else
{
settings.setAttribute(mitgliedtyp + ".suchExterneMitgliedsNummer","");
}
}
if (geburtsdatumvon != null)
{
Date tmp = (Date) getGeburtsdatumvon().getValue();
Expand Down
83 changes: 46 additions & 37 deletions src/de/jost_net/JVerein/gui/control/MitgliedskontoControl.java
Expand Up @@ -469,17 +469,31 @@ public SelectInput getDifferenz(DIFFERENZ defaultvalue)
return differenz;
}

// Für SollbuchungListeView
public TextInput getSuchName()
{
if (suchname != null && !suchname.getControl().isDisposed())
{
return suchname;
}
suchname = new TextInput("", 30);
suchname = new TextInput(settings.getString("sollbuchung.suchname",""), 30);
suchname.setName("Name");
return suchname;
}

// Für SollbuchungAuswahlDialog
public TextInput getSuchName1(boolean newcontrol)
{
if (!newcontrol && suchname != null)
{
return suchname;
}
suchname = new TextInput("", 30);
suchname.setName("Name");
return suchname;
}

//Für SollbuchungAuswahlDialog
public TextInput getSuchName2(boolean newcontrol)
{
if (!newcontrol && suchname2 != null)
Expand Down Expand Up @@ -538,41 +552,36 @@ public TextAreaInput getTxt(String verwendung)
txt.setName("Text");
return txt;
}

private void refresh()
{
saveDefaults();
}

public void saveDefaults()
{
if (this.vondatum != null)
{
Date tmp = (Date) getVondatum("kontoauszugdatumvon").getValue();
if (tmp != null)
{
settings.setAttribute("kontoauszugdatumvon",
new JVDateFormatTTMMJJJJ().format(tmp));
}
else
{
settings.setAttribute("kontoauszugdatumvon", "");
}
}

if (this.bisdatum != null)
{
Date tmp = (Date) getBisdatum("kontoauszugdatumbis").getValue();
if (tmp != null)
{
settings.setAttribute("kontoauszugdatumbis",
new JVDateFormatTTMMJJJJ().format(tmp));
}
else
{
settings.setAttribute("kontoauszugbatumbis", "");
}
}
if (this.vondatum != null)
{
Date tmp = (Date) getVondatum("kontoauszugdatumvon").getValue();
if (tmp != null)
{
settings.setAttribute("kontoauszugdatumvon",
new JVDateFormatTTMMJJJJ().format(tmp));
}
else
{
settings.setAttribute("kontoauszugdatumvon", "");
}
}

if (this.bisdatum != null)
{
Date tmp = (Date) getBisdatum("kontoauszugdatumbis").getValue();
if (tmp != null)
{
settings.setAttribute("kontoauszugdatumbis",
new JVDateFormatTTMMJJJJ().format(tmp));
}
else
{
settings.setAttribute("kontoauszugbatumbis", "");
}
}
}

public void handleStore()
Expand Down Expand Up @@ -666,7 +675,7 @@ public TablePart getMitgliedskontoList(Action action, ContextMenu menu)
this.action = action;
@SuppressWarnings("rawtypes")
GenericIterator mitgliedskonten = getMitgliedskontoIterator();
settings.setAttribute("differenz", getDifferenz().getValue().toString());
settings.setAttribute(datumverwendung + "differenz", getDifferenz().getValue().toString());
if (mitgliedskontoList == null)
{
mitgliedskontoList = new TablePart(mitgliedskonten, action);
Expand Down Expand Up @@ -778,6 +787,7 @@ public void refreshMitgliedkonto1() throws RemoteException
{
@SuppressWarnings("rawtypes")
GenericIterator mitgliedskonten = getMitgliedskontoIterator();
settings.setAttribute(datumverwendung + "differenz", getDifferenz().getValue().toString());
mitgliedskontoList.removeAll();
while (mitgliedskonten.hasNext())
{
Expand Down Expand Up @@ -994,6 +1004,7 @@ public void handleAction(Object context)
{
try
{
saveDefaults();
new Kontoauszug(currentObject, (Date) von.getValue(), (Date) bis.getValue());
}
catch (Exception e)
Expand Down Expand Up @@ -1075,7 +1086,6 @@ public void handleEvent(Event event)
Logger.error("Fehler", e);
}
}
refresh();
}
}

Expand All @@ -1084,13 +1094,13 @@ public void refreshMitgliedskontoList()
{
try
{
settings.setAttribute("sollbuchung.suchname", getSuchName().getValue().toString());
getMitgliedskontoList(action, null);
}
catch (RemoteException e)
{
Logger.error("Fehler", e);
}
refresh();
}

// Für SollbuchungAuswahlDialog
Expand All @@ -1104,7 +1114,6 @@ public void refreshMitgliedskontoList1()
{
Logger.error("Fehler", e);
}
settings.setAttribute("differenz", getDifferenz().getValue().toString());
}

// Für SollbuchungAuswahlDialog
Expand Down
Expand Up @@ -117,7 +117,7 @@ private void starteAuswertung() throws ApplicationException
ArrayList<ProjektSaldoZeile> zeile = saldoList.getInfo();

FileDialog fd = new FileDialog(GUI.getShell(), SWT.SAVE);
fd.setText("Ausgabedatei w?hlen.");
fd.setText("Ausgabedatei wählen.");
//
Settings settings = new Settings(this.getClass());
//
Expand Down
Expand Up @@ -36,7 +36,6 @@
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.dialogs.AbstractDialog;
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.Button;
import de.willuhn.jameica.gui.parts.ButtonArea;
import de.willuhn.jameica.gui.parts.TablePart;
Expand Down Expand Up @@ -108,9 +107,8 @@ else if (item.getText().startsWith("Soll"))
TabGroup tabNurIst = new TabGroup(folder, "Istbuchung einer Sollbuchung zuordnen", false, 1);
LabelGroup grNurIst = new LabelGroup(tabNurIst.getComposite(), "Filter");

TextInput suNa = control.getSuchName();
suNa.setValue(buchung.getName());
grNurIst.addLabelPair("Name", suNa);
control.getSuchName1(true).setValue(buchung.getName());
grNurIst.addLabelPair("Name", control.getSuchName1(false));
grNurIst.addLabelPair("Differenz",
control.getDifferenz(DIFFERENZ.FEHLBETRAG));
grNurIst.addInput(control.getSpezialSuche1());
Expand Down
Expand Up @@ -19,26 +19,28 @@
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Date;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Element;

import de.jost_net.JVerein.util.Geschaeftsjahr;
import de.jost_net.JVerein.util.JVDateFormatTTMMJJJJ;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

public class JahressaldoPDF
public class KontenSaldoPDF
{

public JahressaldoPDF(ArrayList<SaldoZeile> zeile, final File file,
Geschaeftsjahr gj) throws ApplicationException
public KontenSaldoPDF(ArrayList<SaldoZeile> zeile, final File file,
final Date datumvon, final Date datumbis) throws ApplicationException
{
try
{
FileOutputStream fos = new FileOutputStream(file);
String subtitle = gj.toString();
Reporter reporter = new Reporter(fos, "Jahressaldo", subtitle,
String subtitle = new JVDateFormatTTMMJJJJ().format(datumvon) + " - "
+ new JVDateFormatTTMMJJJJ().format(datumbis);
Reporter reporter = new Reporter(fos, "Kontensaldo", subtitle,
zeile.size());

reporter.addHeaderColumn("Konto-\nnummer", Element.ALIGN_CENTER, 50,
Expand Down
2 changes: 1 addition & 1 deletion src/de/jost_net/JVerein/io/Mahnungsausgabe.java
Expand Up @@ -37,7 +37,7 @@ public Mahnungsausgabe(MitgliedskontoControl control) throws IOException
.getValue();
if (form == null)
{
throw new IOException("kein Mahnungsformular ausgewählt");
throw new IOException("Kein Mahnungsformular ausgewählt");
}
Formular formular = (Formular) Einstellungen.getDBService().createObject(
Formular.class, form.getID());
Expand Down
2 changes: 1 addition & 1 deletion src/de/jost_net/JVerein/io/ProjektSaldoPDF.java
Expand Up @@ -42,7 +42,7 @@ public ProjektSaldoPDF(ArrayList<ProjektSaldoZeile> zeile,
FileOutputStream fos = new FileOutputStream(file);
String subtitle = new JVDateFormatTTMMJJJJ().format(datumvon) + " - "
+ new JVDateFormatTTMMJJJJ().format(datumbis);
Reporter reporter = new Reporter(fos, "Projekte-Saldo", subtitle,
Reporter reporter = new Reporter(fos, "Projekt-Saldo", subtitle,
zeile.size());
makeHeader(reporter);

Expand Down
2 changes: 1 addition & 1 deletion src/de/jost_net/JVerein/io/Rechnungsausgabe.java
Expand Up @@ -40,7 +40,7 @@ public Rechnungsausgabe(MitgliedskontoControl control) throws IOException
.getValue();
if (form == null)
{
throw new IOException("kein Rechnungsformular ausgewählt");
throw new IOException("Kein Rechnungsformular ausgewählt");
}
Formular formular = (Formular) Einstellungen.getDBService()
.createObject(Formular.class, form.getID());
Expand Down

0 comments on commit 8ac3e5e

Please sign in to comment.