Imports PDF deposit statements from the German online broker flatex to Sage Business Cloud Accounting.
Supported documents:
- Sammelabrechnung (Wertpapierkauf/-verkauf)
- Dividendengutschrift für ausländische Wertpapiere
- Ertragsmitteilung - ausschüttender/teilthesaurierender Fonds
- Create a Sage Developer account and log in to the Sage Developer console
- Click Create App
- Enter a name and
http://localhost:8080
as Callback URL for your app - Click Save
- Rename
config-sample.json
toconfig.json
- Copy the Client ID and Client Secret from the Sage Developer console to
config.json
- Copy your SKR04 ledger account names to
config.json
- Run app.py
$ pip install virtualenv
$ virtualenv -p python3.9 env
$ source ./env/bin/activate
$ pip install -r ./requirements.txt
$ python ./app.py
__ _ _ _ _
/ _|| | __ _ | |_ ___ __ __ (_) _ __ ___ _ __ ___ _ __ | |_
| |_ | | / _` || __| / _ \\ \/ / _____ | || '_ ` _ \ | '_ \ / _ \ | '__|| __|
| _|| || (_| || |_ | __/ > < |_____|| || | | | | || |_) || (_) || | | |_
|_| |_| \__,_| \__| \___|/_/\_\ |_||_| |_| |_|| .__/ \___/ |_| \__|
|_|
[*] Please continue the login in the web browser.
127.0.0.1 - - [22/Jul/2021 19:42:47] "GET /?code=DE%1F07b6534d-2096-3c87-af09-04522459531e&country=DE HTTP/1.1" 200 -
[*] Please enter the filepath of the flatex deposit statement you want to import:
/Users/L480/flatex-deposit-statement.pdf
[*] The following transactions will be imported:
Sales with profit:
╒════╤══════════════════════════════╤═══════════╤═══════════════╤═══════════════════╤══════════════════════════╕
│ │ Referenz │ Datum │ Bank (Soll) │ Erträge (Haben) │ Anlagevermögen (Haben) │
╞════╪══════════════════════════════╪═══════════╪═══════════════╪═══════════════════╪══════════════════════════╡
│ 0 │ Verkauf 4x DE000BAY0017 │ 2021-7-21 │ 1045.7 │ 156.53 │ 889.17 │
├────┼──────────────────────────────┼───────────┼───────────────┼───────────────────┼──────────────────────────┤
│ 1 │ Verkauf 5x DE0007100000 │ 2021-7-21 │ 1224.35 │ 175.27 │ 1049.08 │
╘════╧══════════════════════════════╧═══════════╧═══════════════╧═══════════════════╧══════════════════════════╛
Sales with loss:
╒════╤══════════════════════════╤═══════════╤══════════════════════════╤═══════════════════╤═══════════════╕
│ │ Referenz │ Datum │ Anlagevermögen (Haben) │ Verluste (Soll) │ Bank (Soll) │
╞════╪══════════════════════════╪═══════════╪══════════════════════════╪═══════════════════╪═══════════════╡
│ 0 │ Verkauf 7x DE0008232125 │ 2021-7-21 │ 784.76 │ 67.18 │ 717.58 │
├────┼──────────────────────────┼───────────┼──────────────────────────┼───────────────────┼───────────────┤
│ 1 │ Verkauf 13x DE0005557508 │ 2021-7-21 │ 903.44 │ 121.98 │ 781.46 │
╘════╧══════════════════════════╧═══════════╧══════════════════════════╧═══════════════════╧═══════════════╛
Purchases:
╒════╤═══════════════════════╤═══════════╤════════════════╤═════════════════════════╕
│ │ Referenz │ Datum │ Bank (Haben) │ Anlagevermögen (Soll) │
╞════╪═══════════════════════╪═══════════╪════════════════╪═════════════════════════╡
│ 0 │ Kauf 10x DE0005552004 │ 2021-7-21 │ 1265.4 │ 1265.4 │
╘════╧═══════════════════════╧═══════════╧════════════════╧═════════════════════════╛
[*] Continue? [y/N]:
y
[✔] Created journal 'Verkauf 4x DE000BAY0017'.
[✔] Created journal 'Verkauf 5x DE0007100000'.
[✔] Created journal 'Verkauf 7x DE0008232125'.
[✔] Created journal 'Verkauf 13x DE0005557508'.
[✔] Created journal 'Kauf 10x DE0005552004'.