Re: Check balance of account and all its children

2022-05-07 Thread John Wiegley
> "JJ" == J J  writes:

JJ> O - The total of all postings seen so far, or the total of an account and
JJ> all its children.

I would just use "total". The O syntax is from the old version of value
expressions. Does that work?

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2fsllrv9q.fsf%40newartisans.com.


Re: Check balance of account and all its children

2022-04-14 Thread Martin Michlmayr
* J J  [2022-04-14 15:05]:
> O - The total of all postings seen so far, or the total of an account and 
> all its children.
> 
> So I am trying to write:
> *account Budget*
> *check O >= 0 * 

John, I looked at the source code and 'O' seems to exist, but I also
failed to make it work.  Any insights from you would be welcome.

My first theory was that the problem is that the "Budget" account on
its own was never used, but adding a $1 transaction to that account
didn't help.

-- 
Martin Michlmayr
https://www.cyrius.com/

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/YliiGLSRKLWdGAnB%40jirafa.cyrius.com.


Check balance of account and all its children

2022-04-14 Thread J J
 

I am trying to declare an account and check it's balance and all of its 
childrens' balances. Doc 
 says 

The check and assert directives warn or raise an error (respectively) if 
the given value expression evaluates to false within the context of any 
posting.

The doc for value expressions 
 
says

O - The total of all postings seen so far, or the total of an account and 
all its children.

So I am trying to write:
*account Budget*
*check O >= 0 * 

But I get no errors with this test:
*4/14 test*
*Budget:Travel$-1*
*Equity:Opening Balance $1 * 


What is the correct syntax to do this? I've tried other formats like:
*check O >= 0*
*check "O >= 0"*
*check expr = "O >= 0" * 

But I can't seem to get any of them to work. The documentation claims that 
the variable O contains *the total of an account and all its children*.  Is 
this the correct implementation? 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/ed27b670-fd7c-4f56-b459-5ed962ea0a8fn%40googlegroups.com.