Thanks to Chad Voegele, see mailing list ledger-cli@googlegroups.com:
Whenever I had a transaction such as
2010/09/10 * castle bar, nyc (beer)
the transaction.from_lnum function would recognize (beer) as the code
for the transaction which is incorrect since it comes at the end of
the line.
Message ID:
73e397f4-234e-46fe-87e5-45f86f934bf1@k30g2000vbn.googlegroups.com
By using
call LedgerToggleTransactionState(line('.'), ' *?')
the state of the transaction will toggle through:
no state -> * -> ? -> no state -> …
beginning at what ever state it currently has.
Adjust to your liking.
Thanks to Chad Voegele for the suggestion.
This allows you to set the effective date in a convenient way.
Maybe I will add date selection using calendar.vim by Yasuhiro
Matsumoto. Until then, you can map this to use today's date:
call LedgerSetDate(line('.'), 'effective')
To try this, map or call the following function:
LedgerSetTransactionState('') – removes state
LedgerSetTransactionState('*') – sets 'checked' state
…
The logic used to distinguish the different parts
of the first line of a transaction is rather basic
but proved to work so far.
Now instead of ledger reg expense -p "this month", you can say:
ledger reg expense for this month
And as a shorthand for "for until this month", you can just say "until
this month" or "since this month".
Consider the following transaction:
2010-06-22 Sample
Assets:Brokerage 10 AAPL {$30}
Assets:Brokerage
Previously, this would have been equivalent to:
2010-06-22 Sample
Assets:Brokerage 10 AAPL @ $30
Assets:Brokerage
However, this is not always what the user expects to happen. When @ is
not being used, the transaction should reflect a mere transfer of
commodities. This is now how it works, and thus the above transaction
is now equivalent to the following instead:
2010-06-22 Sample
Assets:Brokerage 10 AAPL {$30}
Assets:Brokerage -10 AAPL {$30}
For example:
ledger bal assets bold checking
Or you can use expressions:
ledger bal assets bold '=total > 1000'
This last is identical to saying:
ledger bal -l 'account =~ /assets/' --bold-if='total > 1000'