diff --git a/src/de/jost_net/JVerein/gui/control/KontensaldoControl.java b/src/de/jost_net/JVerein/gui/control/KontensaldoControl.java index c4452b2dc..e305fc6e4 100644 --- a/src/de/jost_net/JVerein/gui/control/KontensaldoControl.java +++ b/src/de/jost_net/JVerein/gui/control/KontensaldoControl.java @@ -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; @@ -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 zeile, - final File file, final Geschaeftsjahr gj) + final File file, final Date datumvon, final Date datumbis) { BackgroundTask t = new BackgroundTask() { @@ -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) diff --git a/src/de/jost_net/JVerein/gui/control/MitgliedControl.java b/src/de/jost_net/JVerein/gui/control/MitgliedControl.java index 3a44f309f..005be82c8 100644 --- a/src/de/jost_net/JVerein/gui/control/MitgliedControl.java +++ b/src/de/jost_net/JVerein/gui/control/MitgliedControl.java @@ -2548,7 +2548,7 @@ public TextInput getSuchExterneMitgliedsnummer() { return suchexternemitgliedsnummer; } - suchexternemitgliedsnummer = new TextInput("", 50); + suchexternemitgliedsnummer = new TextInput(settings.getString(mitgliedtyp + ".suchExterneMitgliedsNummer",""), 50); return suchexternemitgliedsnummer; } @@ -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(); diff --git a/src/de/jost_net/JVerein/gui/control/MitgliedskontoControl.java b/src/de/jost_net/JVerein/gui/control/MitgliedskontoControl.java index 60250db56..b90cba9c9 100644 --- a/src/de/jost_net/JVerein/gui/control/MitgliedskontoControl.java +++ b/src/de/jost_net/JVerein/gui/control/MitgliedskontoControl.java @@ -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) @@ -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() @@ -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); @@ -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()) { @@ -994,6 +1004,7 @@ public void handleAction(Object context) { try { + saveDefaults(); new Kontoauszug(currentObject, (Date) von.getValue(), (Date) bis.getValue()); } catch (Exception e) @@ -1075,7 +1086,6 @@ public void handleEvent(Event event) Logger.error("Fehler", e); } } - refresh(); } } @@ -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 @@ -1104,7 +1114,6 @@ public void refreshMitgliedskontoList1() { Logger.error("Fehler", e); } - settings.setAttribute("differenz", getDifferenz().getValue().toString()); } // Für SollbuchungAuswahlDialog diff --git a/src/de/jost_net/JVerein/gui/control/ProjektSaldoControl.java b/src/de/jost_net/JVerein/gui/control/ProjektSaldoControl.java index 623238575..76fca3eb7 100644 --- a/src/de/jost_net/JVerein/gui/control/ProjektSaldoControl.java +++ b/src/de/jost_net/JVerein/gui/control/ProjektSaldoControl.java @@ -117,7 +117,7 @@ private void starteAuswertung() throws ApplicationException ArrayList 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()); // diff --git a/src/de/jost_net/JVerein/gui/dialogs/SollbuchungAuswahlDialog.java b/src/de/jost_net/JVerein/gui/dialogs/SollbuchungAuswahlDialog.java index 27d75b552..8951fc1a9 100755 --- a/src/de/jost_net/JVerein/gui/dialogs/SollbuchungAuswahlDialog.java +++ b/src/de/jost_net/JVerein/gui/dialogs/SollbuchungAuswahlDialog.java @@ -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; @@ -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()); diff --git a/src/de/jost_net/JVerein/io/JahressaldoPDF.java b/src/de/jost_net/JVerein/io/KontenSaldoPDF.java similarity index 87% rename from src/de/jost_net/JVerein/io/JahressaldoPDF.java rename to src/de/jost_net/JVerein/io/KontenSaldoPDF.java index 9415b4e51..ea694be7d 100644 --- a/src/de/jost_net/JVerein/io/JahressaldoPDF.java +++ b/src/de/jost_net/JVerein/io/KontenSaldoPDF.java @@ -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 zeile, final File file, - Geschaeftsjahr gj) throws ApplicationException + public KontenSaldoPDF(ArrayList 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, diff --git a/src/de/jost_net/JVerein/io/Mahnungsausgabe.java b/src/de/jost_net/JVerein/io/Mahnungsausgabe.java index edd5a8830..d5c8f001b 100644 --- a/src/de/jost_net/JVerein/io/Mahnungsausgabe.java +++ b/src/de/jost_net/JVerein/io/Mahnungsausgabe.java @@ -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()); diff --git a/src/de/jost_net/JVerein/io/ProjektSaldoPDF.java b/src/de/jost_net/JVerein/io/ProjektSaldoPDF.java index 1844b7d39..f5d695627 100644 --- a/src/de/jost_net/JVerein/io/ProjektSaldoPDF.java +++ b/src/de/jost_net/JVerein/io/ProjektSaldoPDF.java @@ -42,7 +42,7 @@ public ProjektSaldoPDF(ArrayList 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); diff --git a/src/de/jost_net/JVerein/io/Rechnungsausgabe.java b/src/de/jost_net/JVerein/io/Rechnungsausgabe.java index 3fa585b17..0e65a5683 100644 --- a/src/de/jost_net/JVerein/io/Rechnungsausgabe.java +++ b/src/de/jost_net/JVerein/io/Rechnungsausgabe.java @@ -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());