Commit graph

95 commits

Author SHA1 Message Date
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -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
b848ace768 Allow opt -NDEBUG build to complete without warnings 2010-06-04 06:02:00 -04:00
John Wiegley
f76b271d24 Removed a redundant check 2010-06-03 23:18:18 -04:00
John Wiegley
e8bf3da053 Short-circuit annotated commodity valuation 2010-06-03 17:59:43 -04:00
John Wiegley
0f1afdb3a7 Minor optimization of amount_t::operator* 2010-06-03 05:47:12 -04:00
John Wiegley
3324e3472d Removed some debug code 2010-06-03 00:54:10 -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
75363003bd Throw an exception if mpfr_asprintf fails 2010-06-02 04:01:16 -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
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
4e30fcdf40 Many improvements to Ledger's Python bindings 2009-11-19 22:24:24 -05:00
John Wiegley
20c725df93 Made the amount_t::bigint_t refcount holder 32-bits
It was overflowing on a full register report of just 3M of data.
2009-11-14 06:25:27 -05:00
John Wiegley
afe87280e0 Added floored() and in_place_floor() methods 2009-11-11 03:39:53 -05:00
John Wiegley
acb69193d8 Added a few missing explicit instantiations 2009-11-10 20:57:08 -05:00
John Wiegley
687c71c71d Improved the numerical parser for basic amounts
1,00,000 now causes an error, for example, whereas before the commas
were largely ignored.
2009-11-10 00:10:25 -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
523d4243e8 Made --european more pervasive in its effect 2009-11-08 18:30:35 -05:00
John Wiegley
690e46117e Added Python interface for commodity_t 2009-11-02 21:55:53 -05:00
John Wiegley
3f8c126c79 Use is_annotated() method rather than "annotated" 2009-11-02 16:57:53 -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
20a6d51cf1 Renamed bigint_t::refc, for consistency with value_t 2009-10-29 05:37:39 -04:00
John Wiegley
a3a40994d2 Added some whitespace for clarity 2009-10-28 01:58:41 -04:00
John Wiegley
588f2ef2f5 Fixed many compiler warnings from g++ 4.4 2009-10-25 05:01:39 -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
1fad2ec7c1 More refactoring for --download 2009-06-24 18:08:56 +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
f83a1c8873 Restored --unround, added baseline test 2009-06-21 18:37:39 +01:00
John Wiegley
49f5465adb Temporarily stubbed out an inaccurate assert 2009-06-15 22:55:17 +01:00
John Wiegley
092bda1435 Don't increase precision so much when dividing
Slow the increase in internal precision when dividing amounts.

Use "--debug amount.convert" if you wish to see this logic in action, if
a case where incorrect rounding is suspected comes up.

Fixes B68FFB0D-A9A0-479C-A6C0-68853F229333
2009-06-15 17:52:38 +01:00
John Wiegley
d45b35798c Ignore attempts to annotate the null commodity
Fixes 04C5E1CA-1B39-4214-81C7-FD5AA785308F
2009-06-15 17:51:45 +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
1c7de0f9e4 Added "fixated commodity pricing"
If you put '=' before an annotated commodity's price, it will cause any
future market valuation of that commodity to use that price, and ignore
whatever changes may have happened since in the market price.  This can
be useful if you are tracking gas expenses based on a standard rate
which, although it changes over time, should not adjust the historical
valuation of how much the gas cost at the time it was purchased:

    2009/01/01 Payee
        Expenses:Gas                100 GAL {=$2}
        Liabilities:MasterCard        $-200
2009-03-02 16:39:26 -04:00
John Wiegley
38122c2224 Corrected warnings g++-4.3.3 was complaining about 2009-02-28 04:54:54 -04:00
John Wiegley
fb129fa7a1 Corrected a potential invalid memory access 2009-02-28 04:36:48 -04:00
John Wiegley
f881bf1319 Fix to amount unreduction (aka, 120m -> 2h) 2009-02-27 15:23:38 -04:00
John Wiegley
f7f07310f4 Be smarter about trimming off trailing zeroes 2009-02-27 13:58:30 -04:00
John Wiegley
6d315840a8 Don't propagate display flags from cost amounts 2009-02-27 02:39:54 -04:00
John Wiegley
fbb0d25831 Gave round/unround/truncate all in_place_ variants 2009-02-27 02:15:27 -04:00
John Wiegley
ecb1ca71c1 Refinements to amount_t validation code 2009-02-27 01:57:32 -04:00
John Wiegley
55a6d588ff Allow uncommoditized amounts to +/- with an amount
Thus, you can say "$100 + 10" to increase it by $10.
2009-02-25 23:40:15 -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
5ad9bc3951 Propagate commodity flags in costs sometimes
If a commodity has never been seen before, and it is used in a cost
amount, remember the display flags.
2009-02-24 15:18:57 -04:00