Commit graph

93 commits

Author SHA1 Message Date
John Wiegley
7cd37b1d50 Moving the #include of unistring.h into format.h 2009-11-10 18:43:38 -05:00
John Wiegley
6cdb79e2a6 XML reporting now works via the "xml" command 2009-11-09 03:42:35 -05:00
John Wiegley
2c80227339 Added basic foundation for XML reporting 2009-11-09 02:17:26 -05:00
John Wiegley
5e3f3d7f47 Report sought magnitude when balancing errors occur 2009-11-05 17:43:28 -05:00
John Wiegley
09ace752d6 Added missing call to _dup() in value_t::in_place_cast 2009-11-05 05:11:50 -05:00
John Wiegley
7ca80112fc Change the value_t::POINTER type to value_t::SCOPE
scope_t pointers are the only kind that are ever stored in value
objects, so there was no need to make it generic and use boost::any.
2009-10-30 17:57:29 -04:00
John Wiegley
432be9e989 Removed unnused parameter to value_t::print 2009-10-27 22:25:13 -04:00
John Wiegley
aae134f692 Fixed a display issue with the balance report 2009-10-27 19:01:55 -04:00
John Wiegley
12616dd030 Fixed an error with post-simplified math 2009-10-27 17:30:34 -04:00
John Wiegley
3ea7fbd5f6 If doing math between amount and balance, simplify 2009-10-27 08:30:59 -04:00
John Wiegley
1f379eff70 Fixed some debug code 2009-10-27 08:30:59 -04:00
John Wiegley
a8768587c8 Allow any amount to be multipled by another
The result carries the commodity of the first amount, or the second if
the first had no commodity.
2009-10-27 08:30:59 -04:00
John Wiegley
4bdc0a663c Added debug code 2009-10-27 08:30:59 -04:00
John Wiegley
fc84eeb358 Rewrote the way date and time I/O is managed 2009-10-25 05:01:47 -04:00
John Wiegley
588f2ef2f5 Fixed many compiler warnings from g++ 4.4 2009-10-25 05:01:39 -04:00
John Wiegley
bad1b13680 value_t::dump now faithfully represents strings 2009-06-28 16:00:29 +01:00
John Wiegley
2ef1934bb0 Restored --price option, added baseline test
This option reports only in terms of the annotated price of the
commodities involved, otherwise it reports the amounts themselves.  It
can be used in conjunction with other reports, as it applies to the
displayed amounts, not the actual amounts being calculated.
2009-06-26 17:15:35 +01:00
John Wiegley
991e3a3eaf Split commodity.h/cc into three files
commodity.h - code for commodity_t
annotate.h  - commodity annotations
pool.h      - commodity pool management
2009-06-24 16:43:46 +01:00
John Wiegley
fe6055bf16 value_t::in_place_unround wasn't doing it in-place 2009-06-21 18:35:48 +01:00
John Wiegley
86dfc1e0be The -X option now accepts price settings
For example, if you had 100 AU (onces of gold) and wanted to report it
in dollars, but at a price of $997 per ounce, you could now easily say:

  ledger bal -X '$,AU=$997'
2009-06-18 18:50:49 +01:00
John Wiegley
298a4faef3 Move amount colorization deeper into the core
This is necessary in order to redden negative amounts correctly under
all circumstances, such as component amounts of a multi-commodity
balance.

Fixes 727B2DF8-A2A1-4716-9C15-547F20D5F933
2009-06-16 16:57:10 +01:00
John Wiegley
981dc41eb7 Allow integers to be multiplied with amounts
Fixes other part of 04C5E1CA-1B39-4214-81C7-FD5AA785308F
2009-06-15 17:52:20 +01:00
John Wiegley
110f0b8023 Enabled use of pre-compiled headers by default 2009-03-10 17:02:03 -04:00
John Wiegley
c11d325712 Reduced the #include dependency tree to a minimum 2009-03-04 23:53:43 -04:00
John Wiegley
2d63c9364a Changed many assert() calls to VERIFY() 2009-03-04 04:29:10 -04:00
John Wiegley
478998b4e9 Added a "null" value for value expressions 2009-03-03 13:36:23 -04:00
John Wiegley
fbb0d25831 Gave round/unround/truncate all in_place_ variants 2009-02-27 02:15:27 -04:00
John Wiegley
f09c3906a2 Print better error msg if evaluating mask as bool 2009-02-26 05:35:57 -04:00
John Wiegley
74e569e220 Added a truncated() method for amounts and values
When an amount is truncated, it drops all of the extra precision and
becomes exactly the value would have seen were it printed.
2009-02-26 00:10:08 -04:00
John Wiegley
247cf58bfa Allow sequences to be rounded and unrounded
The result is that every member of the sequence has the given operation
applied.
2009-02-25 23:42:31 -04:00
John Wiegley
238bd7f8a5 Marked all strings needing internationalization
These strings are now collected automagically in the file po/ledger.pot.
If you'd like to produce a translation, just run this command after
building Ledger:

    msginit -l LOCALE -o LANG.po -i po/ledger.pot

Where LOCALE is a string like de or en_GB, and LANG is a short
descriptive word for your language.

Then send me this .po file so I can commit it to the Ledger sources
(alternatively, you could maintain the file in a fork on GitHub), and
setup the build script to format and install your new message catalog
during a "make install".
2009-02-25 03:51:42 -04:00
John Wiegley
c4207a79d7 Allow any two amount values to be divided 2009-02-24 14:55:05 -04:00
John Wiegley
9a44b8a547 Allow sequences to be compared to 0
It is true if every member of the sequence passes the test.
2009-02-23 14:49:03 -04:00
John Wiegley
f96daf5fde Corrects to code that compares balances to zero 2009-02-23 14:46:30 -04:00
John Wiegley
7b7814d466 Expr (a,b)+(c,d) is now equivalent to (a+c,b+d) 2009-02-23 14:41:11 -04:00
John Wiegley
27fc3a3d43 A sequence is false if all it contains is false 2009-02-23 14:38:36 -04:00
John Wiegley
ea418c7fbc Allow date and datetime values to inter-convert 2009-02-22 22:22:54 -04:00
John Wiegley
ea75613760 --exchange option now accepts multiple commodities
They must be separated by a comma, and all whitespace is ignored.
2009-02-22 17:51:11 -04:00
John Wiegley
e124811d8a Added --exchange (-x) option
This is like -V, except it lets you specify the goal commodity to report
in terms of, for example:

    reg -x CAD
2009-02-22 04:51:11 -04:00
John Wiegley
04fd1ae24c Fixed the way values are justified for printing 2009-02-22 04:51:11 -04:00
John Wiegley
640279c65d Allow balances to be rounded and unrounded 2009-02-22 04:51:11 -04:00
John Wiegley
8ca91c1196 Allow balance values to be compared < or > 0 2009-02-21 22:00:00 -04:00
John Wiegley
aeea1cb3e1 Fixed a memory leak in value_t::storage_t 2009-02-21 03:48:02 -04:00
John Wiegley
4fe4a33bf8 Justify integers correctly when printing 2009-02-21 00:45:54 -04:00
John Wiegley
c87882076b Allow date and datetime values to be formatted into strings 2009-02-20 18:33:02 -04:00
John Wiegley
2694335e54 Simplify account total values before comparison
This way, if two account values are BALANCE types containing only a
single AMOUNT, then it will do the sorting comparison of the amounts --
since otherwise balances are ignored for the purposes of sorting.
2009-02-19 21:57:17 -04:00
John Wiegley
7fb328707c Fixed another sort issue 2009-02-19 17:27:05 -04:00
John Wiegley
1d85e992ca A key fix to the ways accounts were sorted
Comparing integer < amount was doing the reverse comparison.
2009-02-19 17:20:36 -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
1fa3c1956f Moved amount_t::right_justify to simply ::justify 2009-02-19 01:22:22 -04:00