]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
Fix bugs found when talking to banks
authorHenryk Plötz <henryk@ploetzli.ch>
Mon, 27 Aug 2018 13:13:09 +0000 (15:13 +0200)
committerRaphael Michel <mail@raphaelmichel.de>
Mon, 3 Dec 2018 18:34:29 +0000 (19:34 +0100)
fints/fields.py
fints/formals.py

index 06ca8b707f88ce2214ff77f3a5f4f3d560640105..31bf5cb13ccb4553507c637ee97734f023cde085 100644 (file)
@@ -184,7 +184,7 @@ class NumericField(FieldRenderFormatStringMixin, DataElementField):
     def _parse_value(self, value): 
         _value = str(value)
         if len(_value) > 1 and _value[0] == '0':
-            raise TypeError("Leading zeroes not allowed for value of type 'num': {!r}".format(value))
+            raise ValueError("Leading zeroes not allowed for value of type 'num': {!r}".format(value))
         return int(_value, 10)
 
 class ZeroPaddedNumericField(NumericField):
index dc01fd91a55dd78ac46647620d4162d4bbe9b083..3e0ee758db2cc45325b1f13904539b1f142dd7fd 100644 (file)
@@ -718,8 +718,8 @@ class ScheduledDebitParameter2(DataElementGroup):
     """Parameter terminierte SEPA-Einzellastschrift einreichen, version 2
 
     Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
-    min_advance_notice = DataElementField(type='num', max_length=4, _d="Minimale Vorlaufzeit SEPA-Lastschrift")
-    max_advance_notice = DataElementField(type='num', max_length=4, _d="Maximale Vorlaufzeit SEPA-Lastschrift")
+    min_advance_notice = DataElementField(type='an', max_length=99, _d="Minimale Vorlaufzeit SEPA-Lastschrift")
+    max_advance_notice = DataElementField(type='an', max_length=99, _d="Maximale Vorlaufzeit SEPA-Lastschrift")
     allowed_purpose_codes = DataElementField(type='an', max_length=4096, required=False, _d="Zulässige purpose codes")
     supported_sepa_formats = DataElementField(type='an', max_length=256, max_count=9, required=False, _d="Unterstützte SEPA-Datenformate")
 
@@ -739,8 +739,8 @@ class ScheduledBatchDebitParameter2(DataElementGroup):
     """Parameter terminierte SEPA-Sammellastschrift einreichen, version 2
 
     Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
-    min_advance_notice = DataElementField(type='num', max_length=4, _d="Minimale Vorlaufzeit SEPA-Lastschrift")
-    max_advance_notice = DataElementField(type='num', max_length=4, _d="Maximale Vorlaufzeit SEPA-Lastschrift")
+    min_advance_notice = DataElementField(type='an', max_length=99, _d="Minimale Vorlaufzeit SEPA-Lastschrift")
+    max_advance_notice = DataElementField(type='an', max_length=99, _d="Maximale Vorlaufzeit SEPA-Lastschrift")
     max_debit_count = DataElementField(type='num', max_length=7, _d="Maximale Anzahl DirectDebitTransfer TransactionInformation")
     sum_amount_required = DataElementField(type='jn', _d="Summenfeld benötigt")
     single_booking_allowed = DataElementField(type='jn', _d="Einzelbuchung erlaubt")
@@ -774,6 +774,7 @@ class QueryScheduledDebitParameter1(DataElementGroup):
 
     Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
     date_range_allowed = DataElementField(type='jn', _d="Zeitraum möglich")
+    max_number_responses_allowed = DataElementField(type='jn', _d="Eingabe Anzahl Einträge erlaubt")
 
 class QueryScheduledDebitParameter2(DataElementGroup):
     """Parameter Bestand terminierter SEPA-Einzellastschriften, version 2