eikek / docspell

Assist in organizing your piles of documents, resulting from scanners, e-mails and other sources with miminal effort.
https://docspell.org
GNU Affero General Public License v3.0
1.66k stars 127 forks source link

[Feature] Add simple functions to query language results #2027

Open davidclemens opened 1 year ago

davidclemens commented 1 year ago

I'll try to explain by example:

I have invoices that I can submit to my insurance to get them refunded. Each invoice has amongst others the following custom fields:

The insurance wants invoices to be submitted in batches. Submissions must total at least 100,00€.

I can easily find the invoices that I need to remind myself to submit with the following query: (& f:eingereicht_beihilfe="false")

However, this is annoying if the grand total of the unsubmitted invoices does not exceed 100,00€ yet. I'd love to be able to only show the results of the above query, if the sum of their custom fields invoice_total is greater than 100,00€.

Some functions would be needed, like:

The results of these functions are already displayed in the UI header.

Would this be possible somehow? Thanks for looking into this and this great software!

eikek commented 1 year ago

Hi @davidclemens thank you for this proposal. I think this would be very valuable indeed! It might be a bit tricky to do, but possible. The values are shown in the ui, but it is not integrated into the query yet. It probably means to do some tweaking so the query doesn't get too slow.