Skip to content

Commit

Permalink
Fix imports, add to trouble script
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Oct 26, 2024
1 parent 62824ca commit 4936e4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion docs/trouble.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ the problem.
"Fetch holdings",
"Fetch scheduled debits",
"Fetch status protocol",
"Make a simple transfer"
"Make a simple transfer",
"Fetch statements as PDF",
]
print("Choose an operation")
Expand Down Expand Up @@ -173,5 +174,19 @@ the problem.
while isinstance(res, NeedTANResponse):
res = ask_for_tan(res)
elif choice == 11:
print("Select statement")
statements = f.get_statements(account)
for i, statement in enumerate(statements):
print(i, f"Statement {statement.statement_number}/{statement.year}")
choice = int(input("Choice: ").strip())
statement = statements[choice]
output_pdf = 'statement.pdf'
res = f.get_statement(account, statement.statement_number, statement.year, StatementFormat.PDF)
while isinstance(res, NeedTANResponse):
res = ask_for_tan(res)
with open(output_pdf, 'wb') as file:
file.write(res.data)
print("Written to", output_pdf)
except FinTSUnsupportedOperation as e:
print("This operation is not supported by this bank:", e)
4 changes: 2 additions & 2 deletions fints/formals.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ class BookedCamtStatements1(DataElementGroup):
camt_statements = DataElementField(type='bin', min_count=1, required=True, _d="camt-Umsätze gebucht")


@document_enum
@doc_enum
class StatementFormat(RepresentableEnum):
"""Kontoauszugsformat
Expand All @@ -1055,7 +1055,7 @@ class StatementFormat(RepresentableEnum):
PDF = '3' # doc: printable format (e.g., PDF)


@document_enum
@doc_enum
class Confirmation(RepresentableEnum):
"""Quittierung
Expand Down

0 comments on commit 4936e4a

Please sign in to comment.