Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to not create tags for empty imports #988

Closed
AndreiGavriliu opened this issue Nov 8, 2017 · 6 comments
Closed

Ability to not create tags for empty imports #988

AndreiGavriliu opened this issue Nov 8, 2017 · 6 comments
Assignees
Labels
enhancement Requests for enhancements of existing stuff. fixed Bugs that are fixed (in a coming release).
Milestone

Comments

@AndreiGavriliu
Copy link

I am running Firefly III version 4.6.10

Description of my issue:

I have created a cronjob, which automatically downloads and imports transactions from the bank into FF.
I did create a check to see if the import file is empty (contains only headers) to skip the import. FF however, creates a import tag even if all transactions in an import file have been skipped due to duplicates. Would it be possible to create an option to not create import tags for empty and/or skipped imports?

Either hard-code it into the workflow or add it as an option in the settings page

@simonsmiley
Copy link
Contributor

If I were you, I would do the duplicate checking in the cronjob, not in firefly. You have more knowledge about that than firefly does, so the results should be better. Use the timestamp, and last couple of transactions to make sure you only have new ones

@AndreiGavriliu
Copy link
Author

@simonsmiley, I did think about that, and I am modifying the data between the bank export and the import (transfer descriptions, asset and opposing IBAN, etc), however, the FF rules are easy to use and more visual (triggers, actions, priority, and so on)

@JC5
Copy link
Member

JC5 commented Nov 8, 2017

Checking for duplicates is fairly advanced in FF so it's OK to rely on it. As such, it's reasonable to ask not to create tags when nothing has been imported. Should be an easy fix.

JC5 added a commit that referenced this issue Nov 8, 2017
@JC5 JC5 self-assigned this Nov 8, 2017
@JC5 JC5 added enhancement Requests for enhancements of existing stuff. fixed Bugs that are fixed (in a coming release). labels Nov 8, 2017
@Aquariu
Copy link

Aquariu commented Nov 13, 2017

That's awesome ! I was also considering asking something like that. Like Gavu I have a daily import of transaction, except that my bank always give me a fixed number of transaction in the CSV file, so I can't easily skip the import.

Question:

  1. Is there (or, is it possible to have in the future) a command line parameter to skip tag creation during import (php artisan firefly:create-import) ? I would like to not create tags.
  2. Is there a way to massively delete old unused tags (even tags that have transactions linked to them without deleting the transactions) ?

Kind regards,
Olivier

@JC5
Copy link
Member

JC5 commented Nov 13, 2017

Hi Olivier,

  1. In the future, it will never generate a tag when importing 0 journals. Also not on the command line.
  2. Yes, you can delete tags without deleting the transaction. But there is no mass-delete for tags. I can write a query for you, but run it at your own risk 😉. Stay tuned.

@JC5 JC5 added this to the 4.6.11 milestone Nov 16, 2017
@JC5
Copy link
Member

JC5 commented Nov 18, 2017

This query will at least show you the unused tags:

select tags.id from tags
left join tag_transaction_journal ON tags.id = tag_transaction_journal.tag_id
where tags.user_id = 1
and tags.deleted_at is null 
and tag_transaction_journal.tag_id is null

You can then delete them by running

update tags SET deleted_at = NOW() where id IN (1,2,3,4)

@JC5 JC5 closed this as completed Nov 18, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests for enhancements of existing stuff. fixed Bugs that are fixed (in a coming release).
Projects
None yet
Development

No branches or pull requests

4 participants