Skip to content
This repository has been archived by the owner on Jul 24, 2022. It is now read-only.

Latest commit

 

History

History
69 lines (62 loc) · 6.38 KB

README.md

File metadata and controls

69 lines (62 loc) · 6.38 KB

flatex-import

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

Getting started

  1. Create a Sage Developer account and log in to the Sage Developer console
  2. Click Create App
  3. Enter a name and http://localhost:8080 as Callback URL for your app
  4. Click Save
  5. Rename config-sample.json to config.json
  6. Copy the Client ID and Client Secret from the Sage Developer console to config.json
  7. Copy your SKR04 ledger account names to config.json
  8. 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'.