best way to check that no implicit conversions are happening?

8 views
Skip to first unread message

Will Robinson

unread,
Nov 12, 2023, 3:03:20 PM11/12/23
to hle...@googlegroups.com
Hi there,

The below file passes a "check -s". But I am looking for a check that forces me to uncomment the commented-out lines, such that the accounting equation actually balances. I can achieve this by simply removing the "@@" directives on the first two lines of the test transaction. But is there any other way to force this check while still having the "@@" lines?

Thanks,
Will

account assets
account revenues:capitalgain
account equity
account equity:conversion

commodity $1,000.00
commodity 1,000.00 ABC
commodity 1,000.00 XYZ

2023-11-12 Initial equity
        assets  100 ABC
        equity  -100 ABC

2023-11-12 Test
        assets  -100 ABC @@ $5000
        assets  50 XYZ @@ $6000
        ; equity:conversion  100 ABC
        ; equity:conversion  -$5000
        ; equity:conversion  -50 XYZ
        ; equity:conversion  $6000
        revenues:capitalgain  -$1000  ; portion that is a capital gain (negative) or loss (positive) on the disposed ABC


--
Will Robinson (willro...@gmail.com)

Simon Michael

unread,
Nov 12, 2023, 5:47:36 PM11/12/23
to hle...@googlegroups.com
Hi, I think not - only one you'd make yourself by checking that bse report has a zero total. Perhaps such a check should be added ?

(relatedly, I'm not happy with the naming of the check command's "balanced" checks. 

On Nov 12, 2023, at 12:03, Will Robinson <willro...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hledger/CAAOg-Bd47XbEAEiH0MLohRyVQ5-yKtrr8S1qwi8cON16s-yYqA%40mail.gmail.com.

Simon Michael

unread,
Nov 12, 2023, 5:47:55 PM11/12/23
to hle...@googlegroups.com


Will Robinson

unread,
Nov 12, 2023, 6:37:28 PM11/12/23
to hle...@googlegroups.com
It seems like it would have to be that the "bse" report total matches the "is" report total, no?



--
Will Robinson (willro...@gmail.com)

Simon Michael

unread,
Nov 12, 2023, 7:01:04 PM11/12/23
to hle...@googlegroups.com
Ah well yes, or after closing revenues/expenses to equity (hledger close --retain).

On Nov 12, 2023, at 15:37, Will Robinson <willro...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages