I normally use only 2 beanquery reports:
- *Balance sheet / net worth - like* (shows what I have on a
specific date)
- *P&L / income-statement like* - (shows what I earned and what I
spent in certain period)
I also convert them to single currency
*Balance sheet / net worth - like* - like report to show net worth on a
specific date looks like this:
query = f"""
SELECT account, convert(SUM(position),'{currency}',{target_date}) as
amount
where date <= {target_date} AND account ~ 'Assets|Liabilities'
"""
*P&L / income-statement like* - (shows what I earned and what I spent in
certain period)
query = f"""
SELECT account, sum(convert(position, 'EUR', date)) as amount
WHERE account ~ 'Expenses|Income' and date >= {date_a} and date <= {
date_b}
"""
Note, that *Balance sheet / net worth - *like report uses conversion rate
at the date for which the report is produced.
However the *P&L / income-statement - *like report I uses conversion rate
at the date of transaction. This is inline with business accounting
practices as well as with common sense (at least my one).
This approach leaves one open question, that when we deal with different
currencies/commodities, which are converted to each other over the
accounting period then the* P&L report *does not explain the difference in
changes in *Net worth*
In another words *net_worth(dateA) - net_worth(dateB)* is not equal to
the *income_statement(dateA+1, dateB) *
*Note*: above takes into account, that income is negative in PTA
So, you never really sure why your net worth has changed
This is because unrealized gains are not taken into account.
This seems to be in general unresolved issue with all the major PTA tools (e.g.
see this discussion
<https://www.reddit.com/r/plaintextaccounting/comments/19c1xv7/gainstrack_a_more_accessible_plaintextaccounting/>
in
Reddit, where someone came with the report, but it works only for his own
PTA language)
But this is not an issue with PTA, as all the data is there. The issue is
that there is no report to extract these unrealized gain
I am now working of the script, which calculates the unrealized gains and
in this case the above formula works always.
On Monday, March 25, 2024 at 11:58:13 PM UTC+1 fin wrote:
> John Lee wrote:
>
> > I'm new to beancount (but not to PTA, though rusty). I should have read
> the docs for v3 first, but I was surprised to see there's no bean-report in
> v3.
> >
> > What do people use to get e.g. a balance report? Same question for
> whatever other reports people regularly find useful?
> >
> > I see there's beanquery split out into a separate repo. Do people really
> use that just to get a balance report? (I don't mean to suggest that's bad
> if that's the way people do it, I just suspect I'm missing something)
>
> a good question and one that will be followed by me. :)
>
> the two reports i use constantly right now are balance (bal)
> and networth (netw). i haven't had time to worry about writing
> either of those using the query language because i'd like to
> finish my conversion efforts before the spring planting season
> gets here (i'm not sure i'll get all of it done, but i am
> making progress :) ).
>
> that said, perhaps someone else has already written them?
>
>
> fin
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/4167ad41-d197-44a5-9b6b-7c27cc3ed2efn%40googlegroups.com.