Commit graph

264 commits

Author SHA1 Message Date
John Wiegley
aa9b07d79b Added --rich-data for 'convert', and SHA1 checksum checking 2012-02-26 15:45:15 -06:00
John Wiegley
4a18317e7c Added --auto-match option, for use with 'convert' 2012-02-26 02:16:09 -06:00
John Wiegley
c47350dce9 Corrected handling of nested definitions 2012-02-21 03:53:00 -06:00
John Wiegley
c3a9a7d2c5 Fixed many Clang type conversion warnings with static_cast 2012-02-17 15:17:52 -06:00
John Wiegley
41971c97dd Use value_t::to_long() 2012-02-17 15:17:05 -06:00
John Wiegley
8c4e145c57 Added round() and unround() valexpr functions 2011-10-24 15:22:18 -05:00
John Wiegley
f0791bbd72 Cleanup whitespace 2011-08-18 14:48:38 -04:00
John Wiegley
add6f6ca2a Removed unused variables 2011-08-18 14:46:36 -04:00
John Wiegley
cf35984971 Use Boost iterator_facade to create new iterators 2011-07-19 23:29:41 -05:00
John Wiegley
c2b5b1a516 Whitespace corrections 2011-02-10 23:00:41 -05:00
John Wiegley
2208ac1226 Fixes for compilation as C++0x code 2011-02-04 22:39:41 -05:00
John Wiegley
958a61ede5 New command: org, for displaying Org-mode tables 2010-12-22 15:34:06 -05:00
John Wiegley
dafe7c891a Added "top_amount" value expr function 2010-12-22 15:32:34 -05:00
John Wiegley
e162455ebb Minor simplifications to valexpr parser
The most significant change is the way CONS sequences are parsed, and
that now instead of =/:=, the operators are ==/=.
2010-09-05 01:38:47 -04:00
John Wiegley
61fcfd0698 The "print" valexpr function no longer adds spaces 2010-06-26 01:08:23 -04:00
John Wiegley
8a29c03490 Added "format" value expression function
This function evaluates formatting strings, returning a string.  For
example:

  format("%(amount)")

This is equivalent to "to_string(amount)".
2010-06-24 20:37:31 -04:00
John Wiegley
35da9ad466 Added "source" command, for executing valexpr files 2010-06-24 20:29:20 -04:00
John Wiegley
129b2de901 "only" now a report query modifier for --only
This fits with "show" and "bold", etc.
2010-06-24 00:30:18 -04:00
John Wiegley
e8e28c794b Added report query modifiers: for, since, until
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".
2010-06-22 21:56:19 -04:00
John Wiegley
3f899c93e6 Added new "bold" modifier to query expressions
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'
2010-06-22 03:20:24 -04:00
John Wiegley
81bf38584e Added new --bold-if option 2010-06-22 01:27:05 -04:00
John Wiegley
963161a817 bal was sometimes reporting empty accounts 2010-06-21 18:32:03 -04:00
John Wiegley
5da1e7756d Added new option --inject=KEY[,KEY...]
If you have a typed metadata key which contains an amount, you can use
--inject=KEY to inject a posting with that amount wherever a match
occurs.  There are two main forms of usage:

  2010-06-18 Sample
      ; Key:: $100
      Expenses:Food                $100.00
      Assets:Checking

The command would be:

  ledger reg --inject=Key

In the above, transactional form, a posting under the account "Key" will
be injected before the first posting reported for this transaction.
It's amount will be $100.  This only happens once for the whole
transaction.

It is also possible to associate the key with a posting:

  2010-06-18 Sample
      Expenses:Food                $100.00
      ; Key:: $100
      Assets:Checking

Now the injected posting is generated whenever that particular post is
reported.
2010-06-18 02:28:12 -04:00
John Wiegley
34fcc62b4d Removed unused --unsorted option 2010-06-15 04:34:16 -04:00
John Wiegley
dcffd218a1 Revised how Ledger handles the "current year"
Now when the Y directive sets the current year for a region, it affects
everything, as if the clock really were set back to that year.
2010-06-14 03:23:09 -04:00
John Wiegley
7146926fd5 Removed unneeded debug code 2010-06-13 05:25:36 -04:00
John Wiegley
ea1642b3f9 Completely reworked argument passing in expressions 2010-06-13 05:02:14 -04:00
John Wiegley
0555e7f61e Improved value expression function 'commodity'
Without arguments -- and in a posting -- it is equivalent to
"commodity(amount)".  Otherwise, it returns the commodity symbol of its
argument.
2010-06-12 14:58:44 -04:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
bea90a2b98 Fixed the "generate" command 2010-06-10 14:28:07 -04:00
John Wiegley
8637dd6ccf New display flag AMOUNT_PRINT_ELIDE_COMMODITY_QUOTES
This is used by reports like register and balance so that separated
commodities without spaces in them needed be surrounded by quotes.  It
will still occur in most other places.

Fixes #200 / F82CF11F-BFD9-4512-A562-202B04B68051
2010-06-09 06:45:07 -04:00
John Wiegley
fc09b69fb7 Fixed interaction with -V/X and grouped postings
With -s, -M/Y/D, -n, and a few other flags, postings get "grouped" into
meta-transactions that contain more postings than before.  In all these
cases, -V use the date of the *earliest* posting in that group, which
makes little sense and caused breakages with -J.  It now uses the latest
date.

Fixes #197 / 68EAF363-D0FE-4127-866E-A5AEBACB65D6
2010-06-09 02:22:50 -04:00
John Wiegley
be6cef93c4 A further simplification of -V and -X
With -X COMM, all values are computed in terms of COMM, regardless.

With -V, only secondary commodities will ever be computed, never
primaries.  Further, if a secondary commodities has an associated price,
the valuation is done in terms of that price's commodity.
2010-06-07 09:49:17 -04:00
John Wiegley
a4d4f99794 amount_t::print and value_t::print now use flags 2010-06-07 08:32:13 -04:00
John Wiegley
8bd362b5d1 Minor optimization of how non --empty is handled 2010-06-07 08:32:13 -04:00
John Wiegley
39f9854e2c Reworked the way that <Rounding> entries are shown
Fixes #188 / 53BCED29-F3B9-4E02-9A35-6C739ABB9662
2010-06-06 06:20:07 -04:00
John Wiegley
2c65b95e49 Made "expr" command a synonym for "parse" 2010-06-05 04:28:33 -04:00
John Wiegley
dbac09405f Added new command: "pricemap [DATE]"
This outputs the pricing relationship of commodities in your data file,
as of DATE (optional), using the DOT language.  If you have graphviz
installed, it can be viewed quite simply using:

  ledger pricemap | dotty -

Each relationship in the graph shows the conversion factor to exchange
one commodity for another, and the date at which this factor was
determined.
2010-06-04 02:53:18 -04:00
John Wiegley
946534b102 A little bit of code cleanup 2010-06-04 02:23:04 -04:00
John Wiegley
79fe46eae8 Don't use --pager or --color with --output 2010-06-02 04:55:45 -04:00
John Wiegley
df0edbd2dc Minor optimization 2010-05-31 15:13:04 -06:00
John Wiegley
647d4aac2f New: --group-by=EXPR and --group-title-format=FMT
The --group-by option allows for most reports to be split up into
sections based on the varying value of EXPR.  For example, to see
register subtotals by payee, use:

  ledger reg --group-by=payee -s

This works for separated balances too:

  ledger bal --group-by=payee

Another interesting possibility is seeing a register of all the accounts
affected by a related account:

  ledger reg -r --group-by=payee

The option --group-title-format can be used to add a separator bar to
the group titles.  The option --no-titles can be used to drop titles
altogether.
2010-05-30 02:47:40 -06:00
John Wiegley
a41d33fba3 Option --rounding inverted to --no-rounding 2010-05-30 02:47:40 -06:00
John Wiegley
f491979d55 Added new option: --no-titles 2010-05-30 02:42:36 -06:00
John Wiegley
7bddcd676b Added --rounding option, which is off by default
The purpose of this option is to add special "<Rounding>" postings, to
ensure that a regiter's running total is *always* the sum of its
postings.  Within --rounding, these adjustment postings are missing,
which was the behavior in Ledger 2.x.  It can be orders of magnitude
slower to turn it on for large reports with many commodities.
2010-05-23 15:45:51 -06:00
John Wiegley
efcede3ca5 Fix to an interaction between --period and --sort
Fixes 3AAB00ED-9904-4380-8988-16506B0AFE08
2010-05-23 01:11:27 -06:00
John Wiegley
a7c28aa200 Added new option --prepend-width
This is useful for making sure that the column containing the results of
--prepend-format is a consistent width throughout the report (including
those lines where it is not applied).

Fixes 64F9D913-75E1-4830-A3D9-29B72442E68B
2010-05-22 21:35:03 -04:00
John Wiegley
02e7825516 Option --count sums payees, account, commodities 2010-05-22 21:35:02 -04:00
John Wiegley
de3803d027 Added new commands: acounts, payees, commodities
These three reports simply dump an unordered list (with the exception of
payees) shows all accounts, payees, and commodities represented in a
given report.  This can be used to easily generate per-entity report,
for example:

  ledger payees | \
  while read payee; do \
    echo ; echo $payee ; \
    ledger reg payee "$payee" ; \
  done
2010-05-22 21:35:02 -04:00
John Wiegley
8acdb85a91 Added a simple print() value expression function
This is really for debugging more than anything else.
2010-05-08 02:01:23 -04:00