Commit graph

1118 commits

Author SHA1 Message Date
John Wiegley
66a26252df Corrected error message text to be consistent 2010-05-30 02:15:45 -06:00
John Wiegley
51115f0a91 Updated to Boost 1.43 2010-05-27 21:35:41 -06:00
John Wiegley
04461f49fd Optimized amount_t::in_place_truncate 2010-05-26 00:58:04 -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
847a5e4e73 Optimized several "in_place" function in balance_t 2010-05-23 15:23:19 -06:00
John Wiegley
efcede3ca5 Fix to an interaction between --period and --sort
Fixes 3AAB00ED-9904-4380-8988-16506B0AFE08
2010-05-23 01:11:27 -06:00
John Wiegley
834d223c27 Do not generate names with double underscores
Fixes 6A4AFDC2-DE87-48A5-A17D-B04120EE1F62
2010-05-23 00:37:54 -06:00
John Wiegley
3fab2e1333 For Boost 1.35 and earlier, use is_regular
Fixes 0F17CB7F-A000-4F99-8471-739948AD575F
2010-05-23 00:34:26 -06:00
John Wiegley
7bd0170d51 print honors --columns, --account,amount-width 2010-05-22 23:34:12 -06:00
John Wiegley
0f3e7e3e7f The print command now honors use of --date-format 2010-05-22 22:05:03 -04:00
John Wiegley
c645ac1de7 If FMT_CUSTOM is given, and no format, use FMT_PRINTED 2010-05-22 22:04:26 -04:00
John Wiegley
37a3f27ef2 Corrected handling of context stack in the parser
Fixes F4A477E6-C4F6-43B1-ABCC-4DC325C2869A
2010-05-22 21:35:28 -04:00
John Wiegley
b5c9be4d29 Created new valexpr variable display_account
Where display_account might be '(Expenses:Food)', account will always be
'Expenses:Food'.  account is now used by all matching and query
operations, while display_account is used in the various report outputs
(besides balance, which never distinguished virtual accounts).

Fixes F2832452-4521-49A3-B854-F4E12CC4D82E
2010-05-22 21:35:03 -04:00
John Wiegley
9557a9d955 A minor fix to transaction auto-balancing
It allows transactions like the following to auto-balance:

  1999/08/16 Sell AAPL
      Assets:Broker                    $585
      Expense:Broker:Commissions        $15
      Assets:Broker                -10 AAPL {$30} @ $60
      Income:Capital Gains
2010-05-22 21:35:03 -04:00
John Wiegley
a7c28aa200 Added new option --prepend-width
This is useful for making sure that the column containing the results of
--prepend-format is a consistent width throughout the report (including
those lines where it is not applied).

Fixes 64F9D913-75E1-4830-A3D9-29B72442E68B
2010-05-22 21:35:03 -04:00
John Wiegley
db5418c838 Made a peculiar error slightly more verbose 2010-05-22 21:35:03 -04:00
John Wiegley
925b70d5c6 Ommitting args to the entry command print nothing 2010-05-22 21:35:03 -04:00
John Wiegley
a3482606dc Improved error reporting in the expression parser
Fixes 15A80F68-F233-49D9-AF0C-9908BB6903BA
2010-05-22 21:35:03 -04:00
John Wiegley
3e1ec40551 Report an error for incorrect dates like 2010/04/32
Fixes EF57C685-2C18-49A1-9A8C-FB3BE6F99C41
2010-05-22 21:35:02 -04:00
John Wiegley
d397d5a2fc Made the output from --options better looking 2010-05-22 21:35:02 -04:00
John Wiegley
33aa0cc3a6 Changed the report generated by the csv command
Fields are now:

  Date,Code,Payee,Account,Commodity,Total,State,Note

Instead of outputting amounts potentially as $1,000.00 (which was an
error anyway), the output is now: $,1000.00.  This makes the commodity
available in a separate field, and removes display of thousands markers.
Also, european formatting is always off.
2010-05-22 21:35:02 -04:00
John Wiegley
02e7825516 Option --count sums payees, account, commodities 2010-05-22 21:35:02 -04:00
John Wiegley
de3803d027 Added new commands: acounts, payees, commodities
These three reports simply dump an unordered list (with the exception of
payees) shows all accounts, payees, and commodities represented in a
given report.  This can be used to easily generate per-entity report,
for example:

  ledger payees | \
  while read payee; do \
    echo ; echo $payee ; \
    ledger reg payee "$payee" ; \
  done
2010-05-22 21:35:02 -04:00
John Wiegley
a596727d3d Interpolate uses of $account in automated postings
Fixes 5CB52887-408E-48F0-8798-3C640D0295B3
2010-05-22 21:35:02 -04:00
John Wiegley
68056c1948 Guard against NULL value passed to "end" directive
Fixes 89233B6D-CB21-4162-98E3-BE38B9336070
2010-05-22 21:35:01 -04:00
John Wiegley
8d4de77836 emacs command was referencing uninitialized values
Fixes 7B54CF80-45A4-4D50-A8D3-63272D60FA1B
2010-05-22 21:34:58 -04:00
John Wiegley
57abfd7ef8 Temporary accounts were referenced after deletion
Fixes D53C98E5-506D-4CE5-91A3-7666FD33B65B
2010-05-22 21:33:47 -04:00
John Wiegley
47bfe58ab3 Added account_id and xact_id valexpr vars for posts
account_id is the "whicheth" number for that posting within its
account.  The xact_id is within its transaction.
2010-05-18 17:37:27 -04:00
John Wiegley
cb047c013d A string was not terminated with a NUL. 2010-05-12 03:12:31 -04:00
John Wiegley
04cfa7ab71 Added more iterator methods to call_scope_t 2010-05-08 02:24:36 -04:00
John Wiegley
4ec54b86f8 Added any() and all() value expression macros
any() matches an expression against every post in a transaction or
account, and returns true if any of them are true.  all() tests if all
are true.  For example:

  ledger -l 'account =~ /Expense/ & any(account =~ /MasterCard/)' reg

This reports every posting affecting an Expense account (regex match),
but only if some other posting in the same transaction affects the
MasterCard account.

Both functions also take a second boolean argument.  If it is false, the
"source" posting is not considered.  For example:

  ledger -l 'any(/x/, false)'

This matches any posting where a *different* posting in the same
transaction contains the letter 'x'.
2010-05-08 02:06:06 -04:00
John Wiegley
d5f8c3bc57 Added O_EXPAND operator, to handle macros 2010-05-08 02:02:10 -04:00
John Wiegley
713f308d0f interactive_t now takes an "X" for expressions 2010-05-08 02:01:59 -04:00
John Wiegley
8acdb85a91 Added a simple print() value expression function
This is really for debugging more than anything else.
2010-05-08 02:01:23 -04:00
John Wiegley
2d28b34ff3 Allow expr_t& to be passed in a value_t 2010-05-08 02:00:35 -04:00
John Wiegley
4028f0bcb4 print command correctly prints amount expressions 2010-05-07 23:16:45 -04:00
John Wiegley
d0460b0692 The --invert option now works with "convert" 2010-05-07 22:57:55 -04:00
John Wiegley
8dd362b57c The include directive now supports file globbing
This only happens at the base filename, not for any of the directory
names for now.
2010-03-17 02:40:42 -04:00
John Wiegley
36b616da5e Added new --meta and --meta-width options
The usages are:

  --meta=<TAG>        prepend value of TAG before every line
  --meta-width=<NUM>  force the meta column to be NUM wide
  --meta=<TAG>:<NUM>  shortcut that also applies --meta-width
2010-03-17 02:20:08 -04:00
John Wiegley
d7b8095c3d Tags were not being set properly on postings 2010-03-17 02:18:46 -04:00
John Wiegley
0e34d08b8d The --pivot=X option now only matches the tag "X" 2010-03-17 00:56:21 -04:00
John Wiegley
01c3eb8547 Improved the new implementation of "print" 2010-03-17 00:49:14 -04: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
2f9ea39869 Short-circuit --head handler when count is reached 2010-03-16 14:20:09 -04:00
John Wiegley
7e719c42dc Extended regexp syntax for "payee" and "capture" 2010-03-10 03:56:34 -05:00
John Wiegley
25c72d6e23 Commented out the date limiter in the lookup code 2010-03-10 03:56:20 -05:00
John Wiegley
9a0ae50ce7 When deriving, don't carry over the code or not 2010-03-10 03:56:08 -05:00
John Wiegley
94c30dcf7f Cleaned up the intelligent lookup algorithm a bit 2010-03-10 01:42:25 -05:00
John Wiegley
4858725377 Corrected a debug string 2010-03-10 01:42:03 -05:00
John Wiegley
1bf0220f24 Added experimental account lookup logic
This is used by the "xact" command, and the CSV importer.  It is very
slow O(xacts*records).
2010-03-08 01:11:55 -05:00