Skip to content

Commit 4936e4a

Browse files
committed
Fix imports, add to trouble script
1 parent 62824ca commit 4936e4a

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

docs/trouble.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ the problem.
103103
"Fetch holdings",
104104
"Fetch scheduled debits",
105105
"Fetch status protocol",
106-
"Make a simple transfer"
106+
"Make a simple transfer",
107+
"Fetch statements as PDF",
107108
]
108109
109110
print("Choose an operation")
@@ -173,5 +174,19 @@ the problem.
173174
174175
while isinstance(res, NeedTANResponse):
175176
res = ask_for_tan(res)
177+
elif choice == 11:
178+
print("Select statement")
179+
statements = f.get_statements(account)
180+
for i, statement in enumerate(statements):
181+
print(i, f"Statement {statement.statement_number}/{statement.year}")
182+
choice = int(input("Choice: ").strip())
183+
statement = statements[choice]
184+
output_pdf = 'statement.pdf'
185+
res = f.get_statement(account, statement.statement_number, statement.year, StatementFormat.PDF)
186+
while isinstance(res, NeedTANResponse):
187+
res = ask_for_tan(res)
188+
with open(output_pdf, 'wb') as file:
189+
file.write(res.data)
190+
print("Written to", output_pdf)
176191
except FinTSUnsupportedOperation as e:
177192
print("This operation is not supported by this bank:", e)

fints/formals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ class BookedCamtStatements1(DataElementGroup):
10451045
camt_statements = DataElementField(type='bin', min_count=1, required=True, _d="camt-Umsätze gebucht")
10461046

10471047

1048-
@document_enum
1048+
@doc_enum
10491049
class StatementFormat(RepresentableEnum):
10501050
"""Kontoauszugsformat
10511051
@@ -1055,7 +1055,7 @@ class StatementFormat(RepresentableEnum):
10551055
PDF = '3' # doc: printable format (e.g., PDF)
10561056

10571057

1058-
@document_enum
1058+
@doc_enum
10591059
class Confirmation(RepresentableEnum):
10601060
"""Quittierung
10611061

0 commit comments

Comments
 (0)