Skip to content

Export ​

Portfelj exports the data from your flex reports to files you can use elsewhere:

  • CSV: for spreadsheet apps and other tools
  • XML for eDavki: Doh-KDVP, Doh-Div and D-IFI XML forms compatible with eDavki

CSV ​

Export closing trades and dividends to CSV files for spreadsheet apps and other tools by running the following command:

sh
portfelj export csv --tax-year 2024

It takes flex reports from flex directory and outputs CSV files in csv directory:

sh
.
└─ csv
   └─ 2024
      ├─ stocks.csv
      ├─ derivatives.csv
      └─ dividends.csv
  • stocks.csv: closing trades of stocks in the given year, together with the opening trades matched against them using the FIFO method.
  • derivatives.csv: the same for derivatives. It has no ISIN column because flex reports don't include ISIN for derivatives.
  • dividends.csv: dividends paid in the given year, with withholding tax and, when known, the company paying the dividend. Negative payments in lieu of dividends on short positions are left out.

If the files already exist, you'll be asked to confirm before they're overwritten. Pass --overwrite to skip the prompt, or --output-dir to write the files elsewhere.

Amounts in euros ​

Prices and amounts are kept in the original currency by default. Pass --euro to convert them to EUR using the reference rates of the European Central Bank (ECB). To use the rates of the Bank of Slovenia (BSI) instead, pass --fx-source bsi:

sh
portfelj export csv --tax-year 2024 --euro --fx-source bsi

To change the default, see Reference rates. The export for eDavki always uses the rates of the Bank of Slovenia.

Separate files per account ​

By default, trades from all accounts are merged together. Pass --separate to output files for each account in its own directory:

sh
.
└─ csv
   └─ 2024
      ├─ U1234567
      │  ├─ stocks.csv
      │  ├─ derivatives.csv
      │  └─ dividends.csv
      └─ U7654321
         └─ ...

Some accounts are still merged together, i.e. CFD sub-accounts (IBUK) or accounts migrated between different branches of Interactive Brokers. Their directory name lists all the account IDs, i.e. U1234567-U1234567F.

XML for eDavki ​

Convert flex reports into XML files that you can import into eDavki by running the following command:

sh
portfelj export edavki --tax-year 2024

It takes flex reports from flex directory and outputs XML for edavki in edavki directory.

The prompt to enter the tax payer information will automatically appear on the very first run. Once the tax payer is all set, it will be used automatically on each run.

The output is organized by tax payer ID and tax year:

sh
.
└─ edavki
   └─ {TAX PAYER ID}
      └─ 2024
         ├─ Doh-KDVP.xml
         ├─ Doh-Div.xml
         └─ D-IFI.xml

INFO

Portfelj can generate Doh-KDVP, D-IFI, Doh-Div.

WARNING

Portfelj is merely a tool for converting the data in your reports. It is not tax or investment advice. Check all figures before you submit them.

Upload to eDavki ​

Follow the next steps to upload the produced XML forms:

  1. Log in to eDavki
  2. Navigate to Dokumenti -> Uvoz. You should see Uvoz podatkov iz XML datoteke
  3. Click Izberi datoteko and choose the generated XML form (i.e Doh-KDVP.xml, Doh-Div.xml, D-IFI.xml)
  4. Click Prenesi datoteko
  5. Fill in any missing information.
  6. Select individual securities and check if everything looks alright. Since only closing trades are being filed, the remaining inventory (Zaloga) in the last entry for each security should always be 0.

Manage tax payer information ​

The tax payer store can be managed using fully interactive shell. The navigation is organized using ↑↓ arrows, enter key to confirm the choice and escape key to either return to previous choice or quit, depending on the context. Run the following command to start interactive shell:

sh
portfelj tax-payer interactive

TIP

If you prefer a semi-interactive shell, run portfelj tax-payer --help to find out more.