Skip to content

Commit 3cba074

Browse files
authored
Merge branch 'willuhn:master' into refactoring/redundant_local_variable
2 parents 22b02b7 + 0fb893d commit 3cba074

20 files changed

+199
-32
lines changed

build/ChangeLog

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
HEAD 2.11 (nightly)
22

3+
2021-11-19 Version 2.10.4
4+
5+
* NEW: 0962 CSV-Export von Ums�tzen: Name2 mit exportieren, falls vorhanden
6+
* NEW: 0961 Neue obantoo-Version mit aktualisierter BLZ-Datei g�ltig ab 06.12.2021
7+
* NEW: 0960 Beim Klick auf "Ums�tze abrufen..." in Umsatzliste die Kontoauswahl �berspringen, wenn bereits ein Konto ausgew�hlt ist
8+
* NEW: 0959 Duplizieren von Dauerauftr�gen per Kontextmen�
9+
* NEW: 0958 Strengere Pr�fung der IBAN im Zahlungsverkehr - bisher wurden hier unbekannte IBANs toleriert, wenn die Option zur CRC-Pr�fung aktiv war
10+
* NEW: 0957 Korrektur des Startdatums beim Umsatzabruf, falls es au�erhalb einer von der Bank in den BPD festgelegten Zeitspanne liegt
11+
* BUG: 0956 Korrektur des Startdatums beim Umsatzabruf, falls es in der Zukunft liegt, erst nachdem ggf. ein Offset hinzugez�hlt wurde
12+
* NEW: 0955 Neue obantoo-Version mit aktualisierter BLZ-Datei g�ltig ab 06.09.2021
13+
* BUG: 0954 BIC nicht mehr basierend auf IBAN vorbef�llen, wenn bereits eine eingetragen wurde
314
* BUG: 0953 Das Vergr��ern des Flicker-Codes f�hrte ab einer gewissen Gr��e zu Darstellungsfehlern
415
* BUG: 0952 Option "Nur aktive Konten" in "Saldo im Verlauf" wurde nicht gespeichert
516
* BUG: 0951 Bearbeiten eines Umsatzes: Beim �bernehmen einer Adresse wurde Kto/BLZ statt IBAN/BIC �bernommen

lib/hbci4java_info.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<info>
22
<name>HBCI4Java</name>
33
<description>Java-basierte Implementierung des HBCI-Protokolls</description>
4-
<url>http://hbci4java.kapott.org/</url>
5-
<license>GPL - http://www.gnu.org/copyleft/gpl.html</license>
4+
<url>https://github.com/hbci4j/hbci4java/</url>
5+
<license>LGPL - https://github.com/hbci4j/hbci4java/blob/master/LICENSE</license>
66
</info>

lib/obantoo-bin-2.1.12.jar

-2.01 KB
Binary file not shown.

lib/velocity/de.willuhn.jameica.hbci.rmi.Umsatz.csv.vm

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
#set($konto = $umsatz.Konto)
88
#set($kat = "")
99
#set($kat = $!{umsatz.UmsatzTyp.Name})
10-
"$!{umsatz.ID}";"$!{konto.Iban}";"$!{konto.Bic}";"$!{konto.Bezeichnung}";"$!{umsatz.GegenkontoNummer}";"$!{umsatz.GegenkontoBLZ}";"$!{umsatz.GegenkontoName}";"$!{decimalformat.format(${umsatz.Betrag})}";"$!{dateformat.format(${umsatz.Valuta})}";"$!{dateformat.format(${umsatz.Datum})}";#if($fullUsage)"$!{filter.escape($!{umsatz.Zweck})}"#else"$!{filter.escape($!{umsatz.getAttribute("SVWZ")})}"#end;"#if($fullUsage)$!{filter.escape($!{umsatz.Zweck2})}#end";#if(!$hideSaldo)"$!{decimalformat.format(${umsatz.Saldo})}";#end"$!{umsatz.Primanota}";"$!{umsatz.CustomerRef}";"$!{kat}";"$!{filter.escape($!{umsatz.Kommentar})}";"#if($fullUsage)#foreach($ewz in $umsatz.WeitereVerwendungszwecke)$!{filter.escape($!{ewz})} #end#end";"$!{umsatz.Art}";#if($umsatz.hasFlag(2))"ja"#end;"$!{umsatz.endToEndId}"
10+
"$!{umsatz.ID}";"$!{konto.Iban}";"$!{konto.Bic}";"$!{konto.Bezeichnung}";"$!{umsatz.GegenkontoNummer}";"$!{umsatz.GegenkontoBLZ}";"$!{umsatz.getAttribute('empfaenger')}";"$!{decimalformat.format(${umsatz.Betrag})}";"$!{dateformat.format(${umsatz.Valuta})}";"$!{dateformat.format(${umsatz.Datum})}";#if($fullUsage)"$!{filter.escape($!{umsatz.Zweck})}"#else"$!{filter.escape($!{umsatz.getAttribute("SVWZ")})}"#end;"#if($fullUsage)$!{filter.escape($!{umsatz.Zweck2})}#end";#if(!$hideSaldo)"$!{decimalformat.format(${umsatz.Saldo})}";#end"$!{umsatz.Primanota}";"$!{umsatz.CustomerRef}";"$!{kat}";"$!{filter.escape($!{umsatz.Kommentar})}";"#if($fullUsage)#foreach($ewz in $umsatz.WeitereVerwendungszwecke)$!{filter.escape($!{ewz})} #end#end";"$!{umsatz.Art}";#if($umsatz.hasFlag(2))"ja"#end;"$!{umsatz.endToEndId}"
1111
#end

src/de/willuhn/jameica/hbci/HBCIProperties.java

+64-3
Original file line numberDiff line numberDiff line change
@@ -519,14 +519,14 @@ public final static boolean checkAccountCRC(String blz, String kontonummer)
519519
* @see HBCIUtils#checkIBANCRC(java.lang.String)
520520
* @param iban die IBAN.
521521
* @return true, wenn die IBAN ok ist.
522-
* @deprecated Bitte {@link HBCIProperties#getIBAN(String)} verwenden.
522+
* @deprecated Bitte {@link HBCIProperties#checkIBAN(String)} verwenden.
523523
*/
524524
@Deprecated
525525
public final static boolean checkIBANCRC(String iban)
526526
{
527527
try
528528
{
529-
getIBAN(iban);
529+
checkIBAN(iban);
530530
return true;
531531
}
532532
catch (ApplicationException ae)
@@ -557,6 +557,7 @@ public final static String checkBIC(String bic) throws ApplicationException
557557

558558
return bic;
559559
}
560+
560561
/**
561562
* Prueft die Gueltigkeit einer Creditor-ID (Gläubiger-Identifikationsnummer)
562563
* anhand von Pruefziffern.
@@ -637,7 +638,67 @@ public final static IBAN getIBAN(String iban) throws ApplicationException
637638
throw new ApplicationException(se.getMessage());
638639
}
639640
}
640-
641+
642+
643+
/**
644+
* Prueft die IBAN auf Gueltigkeit.
645+
* @param iban die IBAN.
646+
* @throws ApplicationException die Fehlermeldung, wenn die IBAN nicht korrekt ist.
647+
*/
648+
public final static void checkIBAN(String iban) throws ApplicationException
649+
{
650+
if (StringUtils.trimToNull(iban) == null)
651+
throw new ApplicationException(i18n.tr("Bitte geben Sie eine IBAN ein"));
652+
653+
iban = StringUtils.deleteWhitespace(iban);
654+
655+
if (iban == null || iban.length() == 0)
656+
throw new ApplicationException(i18n.tr("Bitte geben Sie eine IBAN ein"));
657+
658+
// Wir checken selbst bei deaktivierter Pruefung wenigstens bei deutschen IBANs die Laenge
659+
if (iban.toLowerCase().startsWith("de") && iban.length() != 22)
660+
throw new ApplicationException(i18n.tr("Bitte prüfen Sie die Länge der IBAN"));
661+
662+
if (!de.willuhn.jameica.hbci.Settings.getKontoCheck())
663+
return;
664+
665+
try
666+
{
667+
final IBAN i = new IBAN(iban);
668+
669+
// Rückgabe-Code checken
670+
IBANCode code = i.getCode();
671+
if (code == null || code == IBANCode.GUELTIG)
672+
return;
673+
674+
// Tolerieren wir ebenfalls
675+
if (code == IBANCode.KONTONUMMERERSETZT ||
676+
code == IBANCode.GEMELDETEBLZZURLOESCHUNGVORGEMERKT ||
677+
code == IBANCode.PRUEFZIFFERNMETHODEFEHLT)
678+
return;
679+
680+
throw new ApplicationException(code.getMessage());
681+
}
682+
catch (SEPAException e)
683+
{
684+
// Haben wir einen Fehlercode?
685+
Fehler f = e.getFehler();
686+
if (f != null)
687+
{
688+
String msg = obantooCodes.get(f);
689+
if (msg != null)
690+
throw new ApplicationException(i18n.tr("IBAN \"{0}\": {1}",iban,msg));
691+
}
692+
693+
// Oder alternativ einen Fehlertext?
694+
String msg = e.getMessage();
695+
if (msg != null)
696+
throw new ApplicationException(i18n.tr("IBAN \"{0}\": {1}",iban,msg));
697+
}
698+
699+
throw new ApplicationException(i18n.tr("IBAN ungültig: \"{0}\"",iban));
700+
}
701+
641702

642703
/**
643704
* Erzeugt die IBAN aus der uebergebenen Bankverbindung.

src/de/willuhn/jameica/hbci/gui/input/IBANInput.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ public void setValue(Object value)
8686
return;
8787

8888
// 2. Wenn wir ein BICInput haben, dann gleich noch die BIC ermitteln und
89-
// vervollstaendigen
89+
// vervollstaendigen. Aber nur, wenn nicht schon eine BIC eingetragen ist.
90+
if (StringUtils.trimToNull((String)this.bicInput.getValue()) != null)
91+
return;
92+
9093
String bic = StringUtils.trimToNull(iban.getBIC());
9194
if (bic == null)
9295
return;

src/de/willuhn/jameica/hbci/gui/menus/SepaDauerauftragList.java

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import de.willuhn.jameica.gui.parts.ContextMenu;
1717
import de.willuhn.jameica.gui.parts.ContextMenuItem;
1818
import de.willuhn.jameica.hbci.HBCI;
19+
import de.willuhn.jameica.hbci.gui.action.Duplicate;
1920
import de.willuhn.jameica.hbci.gui.action.KontoFetchSepaDauerauftraege;
2021
import de.willuhn.jameica.hbci.gui.action.SepaDauerauftragDelete;
2122
import de.willuhn.jameica.hbci.gui.action.SepaDauerauftragNew;
@@ -42,6 +43,8 @@ public SepaDauerauftragList()
4243
addItem(new ContextMenuItem(i18n.tr("Neuer Dauerauftrag..."), new DNeu(),"text-x-generic.png"));
4344
addItem(new CheckedContextMenuItem(i18n.tr("Löschen..."), new SepaDauerauftragDelete(),"user-trash-full.png"));
4445
addItem(ContextMenuItem.SEPARATOR);
46+
addItem(new CheckedSingleContextMenuItem(i18n.tr("Duplizieren..."), new Duplicate(),"edit-copy.png"));
47+
addItem(ContextMenuItem.SEPARATOR);
4548
addItem(new ContextMenuItem(i18n.tr("Daueraufträge abrufen..."), new KontoFetchSepaDauerauftraege(),"mail-send-receive.png"));
4649
addItem(ContextMenuItem.SEPARATOR);
4750
addItem(new CheckedSingleContextMenuItem(i18n.tr("Drucken..."),new Action() {

src/de/willuhn/jameica/hbci/gui/parts/KontoauszugList.java

+17-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,23 @@ public void handleAction(Object context) throws ApplicationException
218218
handlePrint();
219219
}
220220
},null,false,"document-save.png");
221-
buttons.addButton(i18n.tr("Umsätze abrufen..."), new KontoFetchUmsaetze(),null,false,"mail-send-receive.png");
221+
buttons.addButton(i18n.tr("Umsätze abrufen..."), new Action() {
222+
223+
@Override
224+
public void handleAction(Object context) throws ApplicationException
225+
{
226+
Object ctx = null;
227+
try
228+
{
229+
ctx = getKontoAuswahl().getValue();
230+
}
231+
catch (RemoteException re)
232+
{
233+
Logger.error("unable to get current konto",re);
234+
}
235+
new KontoFetchUmsaetze().handleAction(ctx);
236+
}
237+
},null,false,"mail-send-receive.png");
222238
buttons.addButton(i18n.tr("Filter zurücksetzen"), new Action()
223239
{
224240
public void handleAction(Object context) throws ApplicationException

src/de/willuhn/jameica/hbci/messaging/QueryIBANCRCMessageConsumer.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**********************************************************************
22
*
3-
* Copyright (c) 2004 Olaf Willuhn
3+
* Copyright (c) 2021 Olaf Willuhn
44
* All rights reserved.
55
*
66
* This software is copyrighted work licensed under the terms of the
@@ -58,7 +58,7 @@ public void handleMessage(Message message) throws Exception
5858

5959
try
6060
{
61-
HBCIProperties.getIBAN(data.toString());
61+
HBCIProperties.checkIBAN(data.toString());
6262
qm.setData(Boolean.TRUE);
6363
}
6464
catch (ApplicationException ae)
@@ -68,11 +68,3 @@ public void handleMessage(Message message) throws Exception
6868
}
6969

7070
}
71-
72-
73-
/**********************************************************************
74-
* $Log: QueryIBANCRCMessageConsumer.java,v $
75-
* Revision 1.1 2009/02/17 00:00:02 willuhn
76-
* @N BUGZILLA 159 - Erster Code fuer Auslands-Ueberweisungen
77-
*
78-
**********************************************************************/

src/de/willuhn/jameica/hbci/passports/rdh/Controller.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,8 @@ public synchronized void startCreate()
678678
}
679679
catch (Throwable t)
680680
{
681-
Logger.error("error while exporting key",t);
682-
Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Fehler beim Export der Schlüsseldatei"),StatusBarMessage.TYPE_ERROR));
681+
Logger.error("error while creating key",t);
682+
Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Fehler beim Erstellen der Schlüsseldatei"),StatusBarMessage.TYPE_ERROR));
683683
}
684684

685685
}

src/de/willuhn/jameica/hbci/rmi/SepaDauerauftrag.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* Bildet einen SEPA-Dauerauftrag in Hibiscus ab.
1616
*/
17-
public interface SepaDauerauftrag extends HibiscusTransfer, Checksum, BaseDauerauftrag, SepaPayment, SepaBooking
17+
public interface SepaDauerauftrag extends HibiscusTransfer, Checksum, Duplicatable, BaseDauerauftrag, SepaPayment, SepaBooking
1818
{
1919
/**
2020
* Liefert true, wenn die Bank mitgeteilt hat, dass der Auftrag aenderbar ist.

src/de/willuhn/jameica/hbci/server/AbstractSepaSammelTransferBuchungImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ protected void insertCheck() throws ApplicationException
6969

7070
HBCIProperties.checkChars(s, HBCIProperties.HBCI_IBAN_VALIDCHARS);
7171
HBCIProperties.checkLength(s, HBCIProperties.HBCI_IBAN_MAXLENGTH);
72+
HBCIProperties.checkIBAN(s);
7273

7374
if (StringUtils.trimToNull(getGegenkontoBLZ()) != null)
7475
HBCIProperties.checkBIC(getGegenkontoBLZ());

src/de/willuhn/jameica/hbci/server/AuslandsUeberweisungImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ protected void insertCheck() throws ApplicationException {
9999

100100
HBCIProperties.checkChars(s, HBCIProperties.HBCI_IBAN_VALIDCHARS);
101101
HBCIProperties.checkLength(s, HBCIProperties.HBCI_IBAN_MAXLENGTH);
102+
HBCIProperties.checkIBAN(s);
102103

103104
if (StringUtils.trimToNull(getGegenkontoBLZ()) != null)
104105
HBCIProperties.checkBIC(getGegenkontoBLZ());

src/de/willuhn/jameica/hbci/server/BPDUtil.java

+5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ public enum Query
6767
*/
6868
KontoauszugPdf("KontoauszugPdf","HKEKP"),
6969

70+
/**
71+
* Query fuer die Suche nach den BPD-Parametern fuer den Abruf der Umsaetze.
72+
*/
73+
Umsatz("KUmsZeit","HKKAZ"),
74+
7075
/**
7176
* Query fuer Abruf der Umsaetze im CAMT-Format.
7277
*/

src/de/willuhn/jameica/hbci/server/HibiscusAddressImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected void insertCheck() throws ApplicationException {
9898
{
9999
HBCIProperties.checkLength(iban, HBCIProperties.HBCI_IBAN_MAXLENGTH);
100100
HBCIProperties.checkChars(iban, HBCIProperties.HBCI_IBAN_VALIDCHARS);
101-
HBCIProperties.getIBAN(iban);
101+
HBCIProperties.checkIBAN(iban);
102102
haveAccount = true;
103103
}
104104
if (bic != null && bic.length() > 0)

src/de/willuhn/jameica/hbci/server/KontoImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected void insertCheck() throws ApplicationException
120120
{
121121
HBCIProperties.checkLength(iban, HBCIProperties.HBCI_IBAN_MAXLENGTH);
122122
HBCIProperties.checkChars(iban, HBCIProperties.HBCI_IBAN_VALIDCHARS);
123-
HBCIProperties.getIBAN(iban);
123+
HBCIProperties.checkIBAN(iban);
124124
}
125125
if (bic != null && bic.length() > 0)
126126
{

src/de/willuhn/jameica/hbci/server/KontoUtil.java

+33
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import de.willuhn.jameica.system.OperationCanceledException;
3636
import de.willuhn.jameica.util.DateUtil;
3737
import de.willuhn.logging.Logger;
38+
import de.willuhn.util.TypedProperties;
3839

3940
/**
4041
* Hilfsklasse mit statischen Funktionen fuer Konten.
@@ -202,6 +203,38 @@ public static boolean useCamt(Konto k, boolean ask)
202203
}
203204
}
204205

206+
/**
207+
* Extrahiert aus den BPD die Zeitspanne, fuer die laut Bank Umsaetze eines Kontos abgerufen werden koennen.
208+
* @param k das betreffende Konto.
209+
* @param askForCamtIfPossible true, wenn der User hier auch gefragt werden darf, ob die Umsaetze per CAMT abgerufen werden sollen, falls er die Entscheidung noch nicht getroffen hat.
210+
* @return -1, wenn kein Konto angegeben wurde, ansonsten Wert des Parameters "timerange" aus den BPD oder 0, falls der Parameter fehlt.
211+
*/
212+
public static int getUmsaetzeTimeRange(Konto k, boolean askForCamtIfPossible)
213+
{
214+
if (k == null)
215+
{
216+
Logger.warn("unable to get time range from BPD, no account given");
217+
return -1;
218+
}
219+
220+
boolean usingCamt = useCamt(k, askForCamtIfPossible);
221+
Support support = BPDUtil.getSupport(k, usingCamt ? Query.UmsatzCamt : Query.Umsatz);
222+
TypedProperties bpd = (support != null && support.isSupported()) ? support.getBpd() : null;
223+
if (bpd == null)
224+
{
225+
Logger.debug("unable to get BPD");
226+
return 0;
227+
}
228+
229+
int timeRange = bpd.getInt("timerange", 0);
230+
if (timeRange > 0)
231+
{
232+
Logger.debug("time range from BPD for " + (usingCamt ? "KUmsZeitCamt" : "KUmsZeit") + ": " + timeRange);
233+
}
234+
235+
return timeRange;
236+
}
237+
205238

206239
/**
207240
* Sucht das Konto in der Datenbank.

src/de/willuhn/jameica/hbci/server/SepaDauerauftragImpl.java

+23
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import de.willuhn.jameica.hbci.HBCI;
1919
import de.willuhn.jameica.hbci.HBCIProperties;
20+
import de.willuhn.jameica.hbci.rmi.Duplicatable;
2021
import de.willuhn.jameica.hbci.rmi.Konto;
2122
import de.willuhn.jameica.hbci.rmi.SepaDauerauftrag;
2223
import de.willuhn.jameica.system.Application;
@@ -47,6 +48,27 @@ protected String getTableName()
4748
{
4849
return "sepadauerauftrag";
4950
}
51+
52+
/**
53+
* @see de.willuhn.jameica.hbci.rmi.Duplicatable#duplicate()
54+
*/
55+
@Override
56+
public Duplicatable duplicate() throws RemoteException
57+
{
58+
SepaDauerauftrag u = (SepaDauerauftrag) getService().createObject(SepaDauerauftrag.class,null);
59+
u.setBetrag(getBetrag());
60+
u.setGegenkontoNummer(getGegenkontoNummer());
61+
u.setGegenkontoName(getGegenkontoName());
62+
u.setGegenkontoBLZ(getGegenkontoBLZ());
63+
u.setKonto(getKonto());
64+
u.setZweck(getZweck());
65+
u.setEndtoEndId(getEndtoEndId());
66+
u.setPmtInfId(getPmtInfId());
67+
u.setPurposeCode(getPurposeCode());
68+
u.setLetzteZahlung(getLetzteZahlung());
69+
u.setTurnus(getTurnus());
70+
return u;
71+
}
5072

5173
/**
5274
* @see de.willuhn.jameica.hbci.rmi.Checksum#getChecksum()
@@ -120,6 +142,7 @@ protected void insertCheck() throws ApplicationException
120142

121143
HBCIProperties.checkChars(s, HBCIProperties.HBCI_IBAN_VALIDCHARS);
122144
HBCIProperties.checkLength(s, HBCIProperties.HBCI_IBAN_MAXLENGTH);
145+
HBCIProperties.checkIBAN(s);
123146

124147
if (StringUtils.trimToNull(getGegenkontoBLZ()) != null)
125148
HBCIProperties.checkBIC(getGegenkontoBLZ());

src/de/willuhn/jameica/hbci/server/SepaLastschriftImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ protected void insertCheck() throws ApplicationException {
122122

123123
HBCIProperties.checkChars(s, HBCIProperties.HBCI_IBAN_VALIDCHARS);
124124
HBCIProperties.checkLength(s, HBCIProperties.HBCI_IBAN_MAXLENGTH);
125+
HBCIProperties.checkIBAN(s);
125126

126127
if (StringUtils.trimToNull(getGegenkontoBLZ()) != null)
127128
HBCIProperties.checkBIC(getGegenkontoBLZ());

0 commit comments

Comments
 (0)