MadWalnut / firefly-iii-dkb-csv-fix

Prepares a CSV file from DKB for import into Firefly III
Other
8 stars 0 forks source link

Example importconfig.json for firefly data importer #4

Closed Richard-Rumpel closed 8 months ago

Richard-Rumpel commented 9 months ago

Hey, can somebody provide an example configuration file for the firefly data importer ? Thanks a lot :)

MadWalnut commented 8 months ago

I haven't tested this thoroughly, but this seems to work for the new banking format:

{
    "version": 3,
    "source": "ff3-importer-1.4.3",
    "created_at": "2024-02-16T00:32:52+01:00",
    "date": "d.m.y",
    "default_account": 1,
    "delimiter": "semicolon",
    "headers": true,
    "rules": true,
    "skip_form": false,
    "add_import_tag": true,
    "roles": [
        "date_book",
        "date_transaction",
        "_ignore",
        "account-name",
        "opposing-name",
        "description",
        "_ignore",
        "account-iban",
        "amount",
        "sepa_ci",
        "sepa_db",
        "internal_reference"
    ],
    "do_mapping": [
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
    ],
    "mapping": [],
    "duplicate_detection_method": "classic",
    "ignore_duplicate_lines": true,
    "unique_column_index": 0,
    "unique_column_type": "internal_reference",
    "flow": "file",
    "content_type": "csv",
    "custom_tag": "",
    "identifier": "0",
    "connection": "0",
    "ignore_spectre_categories": false,
    "grouped_transaction_handling": "",
    "use_entire_opposing_address": false,
    "map_all_data": false,
    "accounts": [],
    "date_range": "",
    "date_range_number": 30,
    "date_range_unit": "d",
    "date_not_before": "",
    "date_not_after": "",
    "nordigen_country": "",
    "nordigen_bank": "",
    "nordigen_requisitions": [],
    "nordigen_max_days": "90",
    "conversion": false,
    "ignore_duplicate_transactions": true
}

It does not seem to pick up the opposing account correctly on incoming transactions (outgoing works fine). It puts my name in the opposing account field. According to the documentation this should switch dynamically, but it doesn't for me... Can anyone confirm? Currently I'm just using a rule as a workaround.

Otherwise it works fine so far. Since the new banking does not support a time ranged export, I just export everything and use the duplicate detection of the importer to filter out lines that were already imported.

Let me know if this config works for you, then I will update official config here.

Until I update this script, you need to remove the first 4 lines of the CSV file manually, see #2. Only then the above config will work. Do not use the script in this repo, it will not work with the new format.

mrwsl commented 8 months ago

Thank you for sharing your configuration file. Did you map the value for account name?

I get a (2)transactions.0.source_id: [a] Could not find a valid source account when searching for ID "0" or name "redacted". (original value: "(not found)") for every entry of my CSV, although I have rules set up in firefly.

MadWalnut commented 8 months ago

No, I did not map the account name. Try setting default_account in the JSON above to the ID of your DKB account. To find the ID in Firefly go to Accounts -> Asset Accounts -> DKB. Now at the end of the URL there should be a numeric value. For me it is 1 because DKB was the first account I created in Firefly. For you it may be different.

mrwsl commented 8 months ago

Thanks, I messed something up. Your config is working, and I don't have the issue with the opposing account field.

MadWalnut commented 8 months ago

@herrwusel Perfect. So just to confirm, you removed everything until "Buchungsdatum", so the first 4 lines?

If yes I will update the README in the official repo with this information because that is where people will probably look first and currently the text there is outdated. I will then keep this repo here as the old legacy converter, in case someone needs to import old files.

mrwsl commented 8 months ago

Exactly, removing the first four lines, using your config and some use case specific mapping was enough for me.

MadWalnut commented 8 months ago

Thank you. I have opened a pull request in the main repo.