Commit graph

96 commits

Author SHA1 Message Date
John Wiegley
8ed4f3562f Added more option baseline tests, enabled --dow 2009-02-20 19:36:28 -04:00
John Wiegley
01d8d28024 Removed unused --cache option 2009-02-20 16:32:44 -04:00
John Wiegley
95a3788fa7 Restored the --basis option 2009-02-20 15:41:49 -04:00
John Wiegley
31feaad105 Added --no-total option
This simply omits the final total in the balance report, nothing more.
2009-02-20 15:41:49 -04:00
John Wiegley
c1b25fcf86 Rewrote the equity command, which is working again
The old implementation used an account formatter, and was very
specialized.  The new is done as a transaction filter, and works along
with everything else, eliminating bugs special to the equity report.
2009-02-20 02:53:54 -04:00
John Wiegley
9805abbf2b Allow for sorting of the balance report
Sorting is repeated at each level of the hierarchy, unless --flat was
specified in which case it applies to the entire applicable accounts
list.
2009-02-19 16:53:25 -04:00
John Wiegley
5b897a12fc Added a new --columns= option 2009-02-19 14:42:18 -04:00
John Wiegley
39bdbbe053 The sequence -M -p 2004 now equals -p 2004 -M 2009-02-19 14:26:08 -04:00
John Wiegley
1f1a83c083 Restored the -j and -J options 2009-02-19 13:40:48 -04:00
John Wiegley
b684783eff Moved init of options to the options themselves 2009-02-19 13:29:15 -04:00
John Wiegley
a8e73064cf Improved how register reports are formatted
As a result, --wide is working again, and --wide-register-format has
been removed.  Also, the following new options are recognized, for
controlling per-column formatting:

    --date-width NUM
    --payee-width NUM
    --account-width NUM
    --amount-width NUM
    --total-width NUM
2009-02-19 01:36:21 -04:00
John Wiegley
4ec2dfeef1 Added --flat option, to flatten the balance report 2009-02-17 21:19:31 -04:00
John Wiegley
07f4aefdfd Removed the %*| special char, for %*(" ") 2009-02-17 17:58:50 -04:00
John Wiegley
67fd38e073 The option --cost is now an alias for --basis 2009-02-17 06:51:40 -04:00
John Wiegley
72cdb41727 Added new --set-acount and --set-payee options
These fully generalize the previous --payee-as-account and such options,
which, for example, is now implemented to be the same as saying,
"--set-account payee".
2009-02-16 20:50:20 -04:00
John Wiegley
15bfeb3cb1 Added several new reporting options
To help with gathering specific reports:

 - --payee-as-account copies the entry's payee field to the account,
   allowing the subtotal report to show unique payees for each period.
 - --comm-as-account copies the transaction's amount's commodity to the
   account.
 - --code-as-account copies the entry's code to the account

Also created aliases for some of these options, for conistency's sake:

 - --commodity-as-payee is now an alias for --comm-as-payee
 - --commodity-as-account is now an alias for --comm-as-account
2009-02-16 18:11:23 -04:00
John Wiegley
b7f2a95c1f Accept --first/--last as synonyms for --head/--tail 2009-02-16 17:25:19 -04:00
John Wiegley
89c01e74e6 Made "stat" a synonym for the "stats" command 2009-02-16 04:51:23 -04:00
John Wiegley
4365d9e3fc Moved around some functions for clarity 2009-02-16 04:10:22 -04:00
John Wiegley
b5a972d1a0 The -n option for bal command is working again
The fix was that when appending new predicates, enclosed both sides of
the AND with parentheses.
2009-02-16 02:51:09 -04:00
John Wiegley
8c2a70e197 Made several of the filters more context aware
This resolves certain issues where value expressions were not being
looked up within their full context.
2009-02-15 23:00:16 -04:00
John Wiegley
14ffc2b31a Don't apply all filters for account-wise reports
This creates its own problems; instead, only most are used.
2009-02-15 22:57:23 -04:00
John Wiegley
a64a069a77 Print stripped amounts in the print report 2009-02-15 21:27:28 -04:00
John Wiegley
780ce4a5d0 Normalized handling of several report options 2009-02-15 21:14:54 -04:00
John Wiegley
484b498c14 Re-enabled the --format (-F) option 2009-02-15 21:08:36 -04:00
John Wiegley
e861c312ac The "xact" variable now returns null for accounts 2009-02-15 21:05:59 -04:00
John Wiegley
78e57ac4cf item_predicate now operates on scope_t
This means item_predicate is no longer a template.
2009-02-15 20:56:48 -04:00
John Wiegley
5d4ac67920 chain_xact_handlers now always operators the same
Previously, account-wise reports used a subset of the total number of
transaction filters, but this could cause confusing results, and made
some reports immpossible (such as account-wise monthly averages).
2009-02-15 20:45:09 -04:00
John Wiegley
20475478a4 Removed the %! formatting code, as it does nothing 2009-02-15 16:42:14 -04:00
John Wiegley
a87ed245d7 Changed the semantics of the "prices" report
The prices report now uses the following scheme:

    PAYEE   -> name of commodity of price
    ACCOUNT -> name of commodity of item
    AMOUNT  -> price
    DATE    -> date of pricing

However, the report does not show the payee.  The only reason the payee
is set is to enable clever querying.  For example:

    ledger prices gold        # show all known prices for GOLD
    ledger prices @gold       # show all known prices *in* GOLD
2009-02-13 19:30:53 -04:00
John Wiegley
326cbea4c7 The formatting code no longer justifies values
This is done in the value code, which knows -- based on the value's type
-- how best to apply the justification.
2009-02-13 19:27:37 -04:00
John Wiegley
b345a45c9b Don't print an xact's amount if it was calculated
That is, if the user didn't enter an amount for that transaction in
their ledger journal, don't print one out either.
2009-02-13 18:33:28 -04:00
John Wiegley
70344b82e7 Added a "reload" command, for use at the REPL
Created a new function, session_t::reread_journal_files, which throws
away all previous state data and reads in the same files again.  This is
needed to allow Emacs to communicate with Ledger via the REPL, so that
it tell Ledger when it has made changes to the user's data file.
2009-02-13 05:24:28 -04:00
John Wiegley
60019dc4b4 Changed print report to use format_date
Otherwise, Ledger was unable to parse what it had printed.
2009-02-13 02:09:19 -04:00
John Wiegley
f6b93a3f5a Added a new valexpr function: format_date
This can be used to format dates with a specific pattern, such as:

    format_date(entry.date, "%Y/%m/%d")

This is used by the print command to ensure that Ledger is able to parse
back what it prints.
2009-02-13 02:04:09 -04:00
John Wiegley
8ee8af3bfb Restored the "prices" command. 2009-02-12 04:57:19 -04:00
John Wiegley
c328b1b3b2 Turned on the "emacs" command and budgeting, though neither are tested yet. 2009-02-12 03:30:57 -04:00
John Wiegley
6f2e3b8864 Properly handle UTF-8 characters in commodity strings. 2009-02-12 02:34:39 -04:00
John Wiegley
1a030da55d Rewrote the "entry" command. It's ALIVE! 2009-02-11 19:14:23 -04:00
John Wiegley
44518bc640 Wired up the "entry" command from 2.x, though it still needs to be ported. 2009-02-10 22:37:05 -04:00
John Wiegley
af3be5f964 Wrote the beginnings of a new "stats" command. 2009-02-10 15:57:34 -04:00
John Wiegley
47567307ce Removed reference to session_t from the iterators module. 2009-02-09 17:41:55 -04:00
John Wiegley
6ca01af594 Fixed the use of --effective and --date-format (-y). 2009-02-09 17:27:54 -04:00
John Wiegley
37a1989ca0 Added a new --collapse-if-zero option. 2009-02-09 15:07:28 -04:00
John Wiegley
02110394b4 Use the report's amount_expr everywhere that computes an xact's amount. 2009-02-09 14:53:29 -04:00
John Wiegley
3ee3b8f327 Recompile the amount_expr before summing account totals. 2009-02-09 14:51:45 -04:00
John Wiegley
2d5ad7dee8 Added support for value expression definitions.
Example:

  ] expr f(x) := x + 100
  ] expr f(100)
  200
2009-02-08 04:30:05 -04:00
John Wiegley
f7f5ed3d0f Added stub for --pending report flag. 2009-02-08 03:02:02 -04:00
John Wiegley
ffba456113 Several fixes to get the state flags to appear right in "print". 2009-02-07 23:30:40 -04:00
John Wiegley
f857e10ce2 Whitespace fix to the print report. 2009-02-07 22:50:27 -04:00