beancount查询语言如何查询Document指令?
How to query Document directives in beancount query language?
我非常喜欢从文本文件进行复式记账并使用 beancount:https://github.com/beancount/beancount
使用 beancount 查询语言,我可以轻松地从我的文本文件创建报告(例如税收)。
在 beancount 中,可以在交易报表中添加文档链接(例如收据的 PDF),如
2020-02-04 * "Google" "Server" #tax
document: "2020-02-04 3688657551.pdf"
Liabilities:ErsteBank:Credit -30.40 EUR
Expenses:Professional:Server 30.40 EUR
年底时,我使用以下查询获取所有与税收相关的费用:
SELECT
account, date, number as value, currency, description
FROM
year = 2020
WHERE
account ~ "Expenses:"
AND 'tax' IN tags
ORDER BY date, account, betrag
是否可以在查询中包含文档指令的文件名,即“2020-02-04 3688657551.pdf”?
@罗伯特,
尝试使用 any_meta('document')
中简要介绍的 post.
分类帐:
2020-01-01 open Liabilities:ErsteBank:Credit
2020-01-01 open Expenses:Professional:Server
option "operating_currency" "EUR"
2020-02-04 * "Google" "Server" #tax
document: "2020-02-04 3688657551.pdf"
Liabilities:ErsteBank:Credit -30.40 EUR
Expenses:Professional:Server 30.40 EUR
查询:
SELECT
account, date, number as value, payee, any_meta('document') as document
FROM
year = 2020
WHERE
account ~ "Expenses:"
AND 'tax' IN tags
ORDER BY date, account
结果:
account
date
value
payee
document
Expenses:Professional:Server
2020-02-04
30.40
Google
2020-02-04 3688657551.pdf
我非常喜欢从文本文件进行复式记账并使用 beancount:https://github.com/beancount/beancount 使用 beancount 查询语言,我可以轻松地从我的文本文件创建报告(例如税收)。
在 beancount 中,可以在交易报表中添加文档链接(例如收据的 PDF),如
2020-02-04 * "Google" "Server" #tax
document: "2020-02-04 3688657551.pdf"
Liabilities:ErsteBank:Credit -30.40 EUR
Expenses:Professional:Server 30.40 EUR
年底时,我使用以下查询获取所有与税收相关的费用:
SELECT
account, date, number as value, currency, description
FROM
year = 2020
WHERE
account ~ "Expenses:"
AND 'tax' IN tags
ORDER BY date, account, betrag
是否可以在查询中包含文档指令的文件名,即“2020-02-04 3688657551.pdf”?
@罗伯特,
尝试使用 any_meta('document')
中简要介绍的 post.
分类帐:
2020-01-01 open Liabilities:ErsteBank:Credit
2020-01-01 open Expenses:Professional:Server
option "operating_currency" "EUR"
2020-02-04 * "Google" "Server" #tax
document: "2020-02-04 3688657551.pdf"
Liabilities:ErsteBank:Credit -30.40 EUR
Expenses:Professional:Server 30.40 EUR
查询:
SELECT
account, date, number as value, payee, any_meta('document') as document
FROM
year = 2020
WHERE
account ~ "Expenses:"
AND 'tax' IN tags
ORDER BY date, account
结果:
account | date | value | payee | document |
---|---|---|---|---|
Expenses:Professional:Server | 2020-02-04 | 30.40 | 2020-02-04 3688657551.pdf |