Query on date metadata

50 views
Skip to first unread message

jfbu...@gmail.com

unread,
Jun 7, 2019, 6:01:22 AM6/7/19
to Beancount

Hi,

I'm recording supplier bills like that :

2019-08-20 * "Peinture et cloison, facture 324 du 15.8.2019"
    Expenses:Amenagements                               4500 CHF
    Liabilities:Suppliers:Peintre
    due_date: 2019-08-30


I want a query showing me payables wich are now due, so i could do payments in time:

I tried a query like : select date, description, position, balance  where any_meta('due_date') > today()

but it fails with "TypeError: '>' not supported between instances of 'NoneType' and 'datetime.date'"

Any hint to help me doing something in that spirit would be appreciated.


Martin Blais

unread,
Jun 7, 2019, 9:18:48 PM6/7/19
to Beancount
There's on way to do that right now.
- There's no option to supply a default argument (and the type system is insufficient to make that easy to add)
- There's no short-circuit evaluation (so WHERE any_meta(...) != NULL and any_meta(...) > TODAY() will not work).
I'm afraid you have to resort to a Python script for now.




--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/e3d1a189-4178-48ab-9342-9a40319435aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jean-Francois Burdet

unread,
Jun 10, 2019, 7:36:58 AM6/10/19
to bean...@googlegroups.com
Hi Martin,
Thanks for your answer.

I'll use python script, this will be just fine in a cron job.

You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/EjoZfJsULrs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages