Commit graph

55 commits

Author SHA1 Message Date
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
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
5a2644c1b7 -V/-X options now take price history into account 2010-05-30 20:49:50 -06:00
John Wiegley
04461f49fd Optimized amount_t::in_place_truncate 2010-05-26 00:58:04 -06: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
4e30fcdf40 Many improvements to Ledger's Python bindings 2009-11-19 22:24:24 -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
e8ea2d4938 Automated postings defer amount expression calculation
This allows for value expressions to be used which reference the
incoming posting, for example:

  = Income:Clients:
    (Liabilities:Taxes:VAT1)  (floor(amount) * 1)
    (Liabilities:Taxes:VAT2)  0.19

  2009/07/27 * Invoice
    Assets:Bank:Checking                           $1,190.45
    Income:Clients:ACME_Inc

The automated posting for VAT1 will use the floored amount multiplied by
a factor, while the posting for VAT2 multiples the whole amount as
before.
2009-11-11 04:22:37 -05:00
John Wiegley
39532bdf35 Automated transactions now use report query syntax
This returns their behavior back very close to what 2.x accepts.
2009-11-10 02:44:16 -05:00
John Wiegley
c3535d06c8 Redesigned the expr_t, predicate_t, query_t classes 2009-11-09 02:06:06 -05:00
John Wiegley
5e3f3d7f47 Report sought magnitude when balancing errors occur 2009-11-05 17:43:28 -05:00
John Wiegley
0a9cc833ad Added a regression test relating to forecasting 2009-11-02 01:59:43 -05:00
John Wiegley
4a249d6172 Fixed issues with period strings like "2009/10" 2009-11-02 01:59:24 -05:00
John Wiegley
3a0879aff0 Added "reported posts" into account xdata
This is necessary because sometimes, a post from one account will get
reported as though it were in another account (this happens with
--budget, to show child account postings within their parent account).
In that case, the account needs to remember which postings have been
reported as being within it, so that it can add these amounts to its own
total in the balance report.
2009-11-02 01:40:07 -05:00
John Wiegley
4db60bb464 Added several new regression tests 2009-11-02 01:21:45 -05:00
John Wiegley
307b63be77 Fixed baseline tests relating to earlier changes 2009-11-02 00:32:34 -05:00
John Wiegley
55f5868380 Setting --date-format in ~/.ledgerrc works again 2009-10-29 00:52:51 -04:00
John Wiegley
18a1c8a3fb No more trailing spaces in the print report 2009-10-28 01:43:04 -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
f161aea8ce Removed reliance on strptime/strftime
The code now uses Boost's input and output facets for times and dates.
This ensures completely consistency regarding timezones and times, and
fixes the regression test that was broken while I was away coding in
London (where it was GMT-0 and I didn't notice the difference between
local and GMT).
2009-10-11 05:19:01 -04:00
John Wiegley
e8f315f00d Correctly align amounts formatted as "%12(amount)" 2009-06-28 15:53:46 +01:00
John Wiegley
4574c30fcf The --download option is now fully restored 2009-06-26 16:52:41 +01:00
John Wiegley
4253c2a35d Allow uncommoditized amounts to be used as costs 2009-06-18 16:10:08 +01:00
John Wiegley
8121e0b178 Added regression test for period range fix 2009-06-18 01:23:06 +01:00
John Wiegley
cb2e596725 The --revalued option now honors the -e terminus 2009-06-17 16:54:02 +01:00
John Wiegley
3a926da4cb When --end is used, set a "terminus" date
This means that final balance valuations (with -V or -X) will be done in
terms of the date given to --end, rather than based on the current day.

Fixes 647D5DB9-DBBB-47C8-80CE-F3F70E3B0253
2009-06-16 18:49:27 +01:00
John Wiegley
849e4b2fbb Added test for D943AE0F-44EA-47EE-BA85-AFC513E039EB 2009-06-16 18:29:26 +01:00
John Wiegley
9655f43bed Added test for 5FBF2ED8-EEAA-440E-AED5-67401B107E44 2009-06-16 18:28:05 +01:00
John Wiegley
94467e5b7f Fixed a problem with accounts and trailing spaces
This issue is caused by having a single space at the end of a posting
that has neither an amount nor a note.

Fixes C523E23F-CFAC-4A53-B0C6-21226640E763
2009-06-16 17:05:28 +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
995c94ef17 Added several new regression tests 2009-06-16 16:43:44 +01:00
John Wiegley
463f741ed2 Allow an amount to be zero, even if cost is non-zero
The only real change is that exchanges of zero-amount will not result in
any exchange at all, just the "motions".

Fixes 6DAB9FE3-1399-4727-9AB1-FE413FB85A03
2009-06-16 16:23:58 +01:00
John Wiegley
3c692a94d4 Fixed a problem in the 'entry' command
It was selecting virtual transactions during auto-posting lookup.

Fixes 793F6BF0-9CDE-4741-967A-2CEA697476B4
2009-06-16 16:22:17 +01:00
John Wiegley
63080a7275 Added two new regression tests
These prove Simon's recent balance report bugs.
2009-03-15 22:35:06 -04:00
John Wiegley
16c77af9c9 If 2+ child accounts are shown, show the parent
Also, also show a final balance if there are multiple accounts
displayed, even if that final balance is zero.
2009-03-15 21:31:06 -04:00
John Wiegley
a2ed6bc95d Patched some date-sensitive tests 2009-03-02 04:49:03 -04:00
John Wiegley
56693fab9b Separator in "balance" now part of format string 2009-02-27 16:23:36 -04:00
John Wiegley
b72568270b Added a new regression test for 13965214 2009-02-24 14:34:22 -04:00
John Wiegley
ba1f1fe70e Renamed a regression test, for consistency's sake 2009-02-24 12:29:11 -04:00
John Wiegley
944c63e6f2 The Great Renaming, Part II
The last commit did not contain the majority of changes because of a
slight mishap.  This contains the real changeset.
2009-02-23 19:07:30 -04:00
John Wiegley
a0a014b334 Allow $FILE in regression test error output match 2009-02-23 17:39:52 -04:00
John Wiegley
3c18d3054f Restored the --base option 2009-02-20 23:42:48 -04:00
John Wiegley
b94512e4cc Added several more option baseline tests 2009-02-20 18:15:43 -04:00