Commit graph

335 commits

Author SHA1 Message Date
John Wiegley
82e43fe125 If fixated price commodities are mixed, show them
For example, if a Ledger file contains transactions with the use of both
EUR and EUR {=PRICE}, then regular reports will always show the
{=PRICE}, disabling the by-name commodity merging that takes place.  In
brief, fixated and non-fixated commodities are now non-mergable.

If a file contains all of one, or all of the other, they will still be
merged, since these separate usages do not conflict the way that fixated
and non-fixated together do.
2010-06-20 20:29:53 -04:00
John Wiegley
fa36fef4fa Regression test for last commit 2010-06-20 17:09:07 -04:00
John Wiegley
6770380b6d Subsantial fixes and improvements to budgeting
1. A bounded budget "from DATE to DATE" will now generate entries
    throughout that entire range, if it is triggered.

 2. An unbounded budget begins, as before, in the timeframe of the
    reported posting which triggered it, but now continues until the
    present date.
2010-06-19 16:07:59 -04:00
John Wiegley
b819475a93 Fix to the way simplified regressions tests are read 2010-06-19 16:06:15 -04:00
John Wiegley
7995e16762 Corrected a bug in report query parsing 2010-06-19 14:02:44 -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
36ed7f744f Created a script to check commenting coverage 2010-06-15 21:32:05 -04:00
John Wiegley
35ca4f0bb0 Ensure that all options are tested and documented 2010-06-15 18:19:54 -04:00
John Wiegley
34fcc62b4d Removed unused --unsorted option 2010-06-15 04:34:16 -04:00
John Wiegley
fa263e729c Tests run in parallel with using acprep -jX make
This is done using the multiprocessing library in Python 2.6.  If that's
unavailable, this feature does nothing.
2010-06-15 01:49:18 -04:00
John Wiegley
c367dcab82 Improved algorithm for abbreviating account names 2010-06-14 07:20:23 -04:00
John Wiegley
d11ff33074 Made >>>2 and === optional in regression tests 2010-06-14 07:18:49 -04:00
John Wiegley
e78af146e8 Corrected bug with forecasting date bounded xacts 2010-06-13 23:41:50 -04:00
John Wiegley
b1b4e2aadf Add support for typed metadata
The metadata construct 'Key: Value' is now just a special case for
'Key:: "Value"'.  Another after a :: in metadata setting is parsed as a
full value expression and typed as such.  For example:

  ; Key:: $400 + $500

  ledger -l 'tag("Key") < $1000'
2010-06-12 15:43:00 -04:00
John Wiegley
a1fc3c5cfe The --anon option now randomizes its effect 2010-06-12 14:43:40 -04:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
c28fad384c The --anon option now anonymizes commodities
Fixes #227 / 1C90D8AF-830E-43C2-A5B7-D382F68EBDE3
2010-06-09 07:47:45 -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
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
c85cf0d810 Fixed the way prices and costs are print'd 2010-06-07 08:32:14 -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
89f0cbc7e0 Added a 'speedtest' Makefile target 2010-06-07 05:08:24 -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
946534b102 A little bit of code cleanup 2010-06-04 02:23:04 -04:00
John Wiegley
0f1afdb3a7 Minor optimization of amount_t::operator* 2010-06-03 05:47:12 -04:00
John Wiegley
cbc0a125c0 Correct display of amounts with keep_precision
Fixes #167 / 1D275740-D1A6-42B7-BDE4-F2F85E30CE8E
2010-06-02 06:24:25 -04:00
John Wiegley
f68b4d0f0f Remove redundant code in LedgerHarness.py 2010-06-02 05:03:51 -04:00
John Wiegley
5cdd36f358 Further improved parsing of query expressions
Fixes #210 / D4C2DD6F-8967-4FFC-BBBC-A941F9C53475
2010-06-01 18:33:13 -04:00
John Wiegley
038c24357e Changed --european option to --decimal-comma
Fixes #211 / 1736ACA5-5DE6-4826-AEB4-DB5B2A2217AC
2010-06-01 17:56:41 -04:00
John Wiegley
654c842348 -G option now takes price history into account 2010-05-30 21:58:05 -06:00
John Wiegley
5a2644c1b7 -V/-X options now take price history into account 2010-05-30 20:49:50 -06:00
John Wiegley
4f3b39e22c Empty notes and tags now return null values 2010-05-30 03:01:11 -06:00
John Wiegley
04461f49fd Optimized amount_t::in_place_truncate 2010-05-26 00:58:04 -06:00
John Wiegley
dd8f4ce88f Added a new baseline test for the print command 2010-05-23 17:04:00 -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
91f839e827 Do not implicitly sort register output
The switches the default back to the same as 2.x, which is --unsorted.
2010-03-17 00:49:11 -04:00
John Wiegley
75b7294a6d Rewrite the "print" command as a custom function
There ended up being too many corner cases for the generalized formatter
to handle.
2010-03-08 01:11:48 -05:00
John Wiegley
ac9a84463d Fixed tests relative to recent --pivot change 2010-02-04 04:23:27 -05:00
Aristid Breitkreuz
a3338a2a67 Added baseline tests for unrealized options
This includes another baseline test for --unrealized, and also new ones
for --unrealized-gains and --unrealized-losses.
2009-11-25 04:50:36 -05:00
John Wiegley
a84c42fc17 Fixed regression tests relating to b1d6ea876c 2009-11-24 04:15:21 -05:00
John Wiegley
eab95ad55b Fixed a regression test due to changes in amount.h 2009-11-20 23:41:53 -05:00
John Wiegley
4e6ec09e4d Updated test/input/sample.dat 2009-11-20 18:29:49 -05:00
John Wiegley
ef5c0b37d5 Added baseline test for "sample.dat" contents 2009-11-20 18:24:22 -05:00
John Wiegley
4e30fcdf40 Many improvements to Ledger's Python bindings 2009-11-19 22:24:24 -05:00
John Wiegley
63fee4c837 Added an --unrealized option, for use with bal -V
When this option is on, then in balance report which show market values,
any gains or losses in value will be balanced into a pair of accounts
called Equity:Unrealized Gains and Equity:Unrealized Losses.
2009-11-19 02:00:10 -05:00
John Wiegley
e4b3f0bb3a The new period parser is passing all tests 2009-11-18 05:45:48 -05:00
John Wiegley
c28d828d8e Renamed date_interval_t::end to finish 2009-11-17 21:51:51 -05:00
John Wiegley
b2c426abae Fixed one of the ExprTests 2009-11-15 22:13:53 -05:00
John Wiegley
ee93b5c740 Added baseline test for reg -n 2009-11-14 02:32:18 -05:00
John Wiegley
c182b7051b Renamed the pricesdb command to pricedb 2009-11-12 01:43:57 -05:00