Skip to content

Commit

Permalink
move to beancount/beanquery
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Jun 1, 2024
1 parent 1244297 commit 0ed9f3a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions example/dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ dashboards:
queries:
- bql: |
SELECT year, month,
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month - 1 day')) AS value
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month') - INTERVAL('1 day')) AS value
WHERE account_sortkey(account) ~ '^[01]'
GROUP BY year, month
link: /beancount/balance_sheet/?time={time}
Expand Down Expand Up @@ -209,8 +209,8 @@ dashboards:
queries:
- bql: &portfolio_bql |
SELECT year, month,
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month - 1 day')) AS market_value,
CONVERT(COST(LAST(balance)), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month - 1 day')) AS book_value
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month') - INTERVAL('1 day')) AS market_value,
CONVERT(COST(LAST(balance)), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month') - INTERVAL('1 day')) AS book_value
WHERE account ~ '^Assets:' AND currency != '{{ledger.ccy}}'
GROUP BY year, month
link: /beancount/balance_sheet/?time={time}
Expand Down Expand Up @@ -1039,14 +1039,14 @@ dashboards:
queries:
- bql: |
SELECT year, month,
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month - 1 day')) AS value
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month') - INTERVAL('1 day')) AS value
WHERE account_sortkey(account) ~ '^[01]'
GROUP BY year, month
link: /beancount/balance_sheet/?time={time}
# ignore onetime income and expenses, for example winning the lottery or wedding expenses
- bql: |
SELECT year, month,
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month - 1 day')) AS value
CONVERT(LAST(balance), '{{ledger.ccy}}', DATE_TRUNC('month', FIRST(date)) + INTERVAL('1 month') - INTERVAL('1 day')) AS value
WHERE account_sortkey(account) ~ '^[01]' AND NOT 'wedding' IN tags AND NOT 'weddinggift' IN tags
GROUP BY year, month
type: echarts
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
dependencies = [
"fava>=1.26.1",
"pyyaml>=6.0.1",
"beanquery @ git+https://github.com/andreasgerstmayr/beanquery@add-last_day-function",
"beanquery @ git+https://github.com/beancount/beanquery",
]
readme = "README.md"
requires-python = ">= 3.8"
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ babel==2.14.0
beancount==2.3.6
# via beanquery
# via fava
beanquery @ git+https://github.com/andreasgerstmayr/beanquery@add-last_day-function
beanquery @ git+https://github.com/beancount/beanquery@6df80214d1c1f8aabdba0af732e5e1a36f631e43
# via fava-dashboards
beautifulsoup4==4.12.3
# via beancount
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ babel==2.14.0
beancount==2.3.6
# via beanquery
# via fava
beanquery @ git+https://github.com/andreasgerstmayr/beanquery@add-last_day-function
beanquery @ git+https://github.com/beancount/beanquery@6df80214d1c1f8aabdba0af732e5e1a36f631e43
# via fava-dashboards
beautifulsoup4==4.12.3
# via beancount
Expand Down

0 comments on commit 0ed9f3a

Please sign in to comment.