Re: Expressions in ledger, query interface

2020-05-11 Thread Martin Michlmayr
* John Wiegley  [2020-05-11 21:34]:
> This is correct. In fact, you can directly determine the differences using
> these two debugging commands (which are probably undocumented?):

They are actually documented under PRE-COMMANDS in the man page.

-- 
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/20200512043934.GH21225%40jirafa.cyrius.com.


Re: Expressions in ledger, query interface

2020-05-11 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

MM> So the command line expects a "query", which can be a regex, @regex,
MM> %regex. Or you can add an expression with "expr EXPRESSION". Anything else
MM> that is allowed as a query? (And is "query" the right word, or what are
MM> those things that are not expressions?)

MM> And options like -l expect an expression.

This is correct. In fact, you can directly determine the differences using
these two debugging commands (which are probably undocumented?):

  ledger expr a and b
  ledger query a and b

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/m2imh14vpz.fsf%40newartisans.com.


Re: Expressions in ledger, query interface

2020-05-11 Thread Martin Michlmayr
As a follow-up, I don't think most of these expressions are properly
covered in the test suite.

If someone were to add such test cases, what would the naming
convention be?  baseline/expr-<>.test?

-- 
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/20200512024717.GD21225%40jirafa.cyrius.com.


Re: How do you categorize dividends vs wages?

2020-05-11 Thread psionl0
Wages are a tax deductible expense but dividends are not. So I make 
dividends a sub-category of "equity". Note that there is no need to include 
the payee name in either the wage or dividend payment names since you can 
use the payee name to filter your reports.

Typical entries might be:
2020/05/11 Johnny Smith
   Expenses:Wages $ 500.00
   Liabilities:Tax Deducted   $ -90.00
   Bank:Checking Account $ -410.00

2020/05/11 Ima Owner
   Equity:Dividends   $ 250.00
   Bank:Checking Account $ -250.00

To check Johnny Smith's wage payments you simply need something like

ledger -f file.dat reg Wages and @"Johnny Smith" -b 2020/01/01

You can get a summary of all of the transactions for Johnny Smith in the 
usual way:

ledger -f file.dat bal @"Johnny Smith" -b 2020/01/01

Ditto for checking Ima Owner's dividend payments.

-- 

--- 
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/056d366b-130f-4c51-8b53-3537b709d8f4%40googlegroups.com.


Expressions in ledger, query interface

2020-05-11 Thread Martin Michlmayr
I'm trying to understand something about the query interface.
Options like -l allow things like -l "amount > 100".

I can also specify the same without -l but then I need to
add "expr".

So I guess "amount > 100" is an expression in ledger lingo.

But then you can also specify queries on the command line
like /a/.  I think this is a shorthand for "expr account =~ /a/".
Is that correct?

And @foo is a shorthand for the expression "payee =~ /foo/"

So the command line expects a "query", which can be a regex, @regex,
%regex.  Or you can add an expression with "expr EXPRESSION".
Anything else that is allowed as a query?  (And is "query" the
right word, or what are those things that are not expressions?)

And options like -l expect an expression.

Is this correct?

-- 
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/20200512023003.GA23872%40jirafa.cyrius.com.