Commit graph

57 commits

Author SHA1 Message Date
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
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
04461f49fd Optimized amount_t::in_place_truncate 2010-05-26 00:58:04 -06:00
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
bd455c9874 Added string conversion op for amounts and balances 2009-11-20 23:23:22 -05:00
John Wiegley
4e30fcdf40 Many improvements to Ledger's Python bindings 2009-11-19 22:24:24 -05:00
John Wiegley
afe87280e0 Added floored() and in_place_floor() methods 2009-11-11 03:39:53 -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
c3535d06c8 Redesigned the expr_t, predicate_t, query_t classes 2009-11-09 02:06:06 -05:00
John Wiegley
b14c814fec Whitespace fix 2009-11-04 20:40:42 -05:00
John Wiegley
a757b19f51 Added serialization methods for most type
This allows journal_t objects to be completed serialized to disk and
deserialized.
2009-10-30 18:06:37 -04: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
c11d325712 Reduced the #include dependency tree to a minimum 2009-03-04 23:53:43 -04:00
John Wiegley
fbb0d25831 Gave round/unround/truncate all in_place_ variants 2009-02-27 02:15:27 -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
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
fc349389e3 Restored the --budget option 2009-02-20 23:12:23 -04:00
John Wiegley
f9607a57c1 Removed an unnecessary assert
It prevented the amount string "$1.00 " from being parsed.
2009-02-19 15:14:22 -04:00
John Wiegley
1fa3c1956f Moved amount_t::right_justify to simply ::justify 2009-02-19 01:22:22 -04:00
John Wiegley
e0e181d2af Made (un)reduce rvalue methods more consistent
They names were changed from reduce/unreduce to reduced/unreduced, since
they return the modified value.  This is more consistent with the naming
of rounded/rounded.
2009-02-12 20:44:46 -04:00
John Wiegley
6f2e3b8864 Properly handle UTF-8 characters in commodity strings. 2009-02-12 02:34:39 -04:00
John Wiegley
b662509ee9 amount_t::in_place_* now returns void. Added value_t::unreduce. 2009-02-07 22:50:19 -04:00
John Wiegley
4a28e1765c Fixed some #include ordering issues. 2009-02-07 19:36:51 -04:00
John Wiegley
2cdc83c94a Whitespace fix. 2009-02-07 18:43:12 -04:00
John Wiegley
a085f8e9ad Only initialize the amount_t module if it hasn't been already. 2009-02-06 03:30:45 -04:00
John Wiegley
2d941730b1 Largely removed all of Ledger's use of global variables, for the REPL's sake. 2009-02-04 19:55:27 -04:00
John Wiegley
24ef163ba5 Removed unneeded member variables. 2009-02-04 00:35:02 -04:00
John Wiegley
3434650848 Removed the binary caching code, and the XML, QIF and Gnucash parsers. 2009-02-03 12:22:10 -04:00
John Wiegley
1ece3f8b1c Added documentation stubs for all include files and classes. 2009-01-31 15:28:23 -04:00
John Wiegley
cce65b8dd2 Added a more efficient amount_t::operator==, which changed semantics slightly. 2009-01-31 04:58:16 -04:00
John Wiegley
5a44784817 Removed the special "one" variable, and added amount_t::inverted(). 2009-01-31 04:57:24 -04:00
John Wiegley
e9ff5caa13 Rationals based math is now passing the unit tests. 2009-01-31 04:25:05 -04:00
John Wiegley
5ec98f3ed3 Several corrections to the way rationals are handled. 2009-01-31 01:25:29 -04:00
John Wiegley
e0dd2cd0a4 Changed to using rational numbers instead of integer approximations.
As a result, dependency on the gdtoa was dropped, and dependency on mpfr was
added.
2009-01-30 19:30:16 -04:00
John Wiegley
6213dc5af8 Whitespace fix. 2009-01-30 19:28:53 -04:00
John Wiegley
f1257cbc3e Removed all dependency on gdtoa. 2009-01-30 16:19:31 -04:00
John Wiegley
9400435870 Updated comments and other whitespace changes. 2009-01-30 05:21:41 -04:00
John Wiegley
05c77351e4 Stopped using the generic "unsigned int" in favor of more specific types. 2009-01-29 18:23:57 -04:00
John Wiegley
9aaab88c61 Update Doxygen documentation. Still much more work to be done. 2009-01-29 02:24:42 -04:00
John Wiegley
8b75b5cbfb Revised the way that parsing flags get passed around. 2009-01-29 02:24:25 -04:00
John Wiegley
094c64b67c amount_t and commodity_t objects can now stream themselves to XML. 2009-01-28 20:49:44 -04:00
John Wiegley
79a7976600 Reorganized Ledger so that it builds as 7 separate libraries. This is mainly
to prove to myself that it has proper decoupling between prior code areas.
2009-01-25 01:10:05 -04:00
John Wiegley
887828a40c Increased copyright range to include 2009. 2009-01-20 01:53:31 -04:00
John Wiegley
dc91fdeff2 Added argument to amount_t::value() for request a market value in terms of a
specific commodity.
2009-01-19 17:47:46 -04:00
John Wiegley
60f9748da1 Create an unrounded global amount variable 'one' for creating inverse price
mappings.
2009-01-19 16:24:06 -04:00
John Wiegley
1921f01189 Change default precision extension back to 6, rather than rewriting all of the
unit tests.  6 was good enough.
2008-11-23 23:37:24 -04:00
John Wiegley
c172281858 Abstracted precision extension constant, and added a note that precision must
be handled differently, since paying attention to places after the decimal is
not enough.
2008-11-23 19:15:32 -04:00