Commit graph

1431 commits

Author SHA1 Message Date
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
John Wiegley
e070cdfc8d The CSV reader now auto-correlates fields by regex 2010-03-08 01:11:55 -05:00
John Wiegley
8fef868929 Added find() and operator[] to unistring 2010-03-08 01:11:55 -05:00
John Wiegley
75b7294a6d Rewrite the "print" command as a custom function
There ended up being too many corner cases for the generalized formatter
to handle.
2010-03-08 01:11:48 -05:00
John Wiegley
7e79cd82cd Corrected a case for value < value 2010-03-06 00:58:05 -05:00
John Wiegley
93e0d8c67a Abstracted an sha1sum() function 2010-03-06 00:57:56 -05:00
John Wiegley
b90ce78906 Fixed a problem with the "quoted" valexpr function 2010-03-05 22:14:14 -05:00
John Wiegley
fe95280492 Added some preliminary code for convert CSV to Ledger 2010-03-05 22:14:14 -05:00
John Wiegley
3318722089 Added new "payee" and "capture" directives
The payee directive allows for transformation of payee names during the
parsing of a Ledger file.  This means you can record the payee name in
one form, but always have it reported in another form.  The syntax is
(and will be):

payee PAYEE_NAME  REGEXP

or

payee PAYEE_NAME
  REGEXP1
  REGEXP2
  ...

The account directive sets the account automatically based on the payee
iff the base account name is Unknown.  For example, if you have a bunch
of transaction in Expenses:Unknown, you can assign accounts for several
automatically using:

account ACCOUNT_NAME  PAYEE_REGEXP

or

account ACCOUNT_NAME
  PAYEE_REGEXP1
  PAYEE_REGEXP2
  ...
2010-03-05 22:14:14 -05:00
John Wiegley
fd4fa8a114 Change an exception test to a plain if 2010-03-05 22:14:14 -05:00
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
192972f854 Renamed the "args" command to "query" 2010-03-04 13:37:08 -05:00
John Wiegley
69da18cd30 Some minor refactoring of the textual parser 2010-02-05 00:00:40 -05:00
John Wiegley
40eae8bf94 Reformatted a comment 2010-02-05 00:00:40 -05:00
John Wiegley
313c88a656 Added post_t::compare_by_date_and_sequence comparator 2010-02-05 00:00:40 -05:00
John Wiegley
6870c54644 Refactored some comparison helper classes 2010-02-05 00:00:38 -05:00
John Wiegley
9d61d3d621 Added actual_date() methods for items 2010-02-05 00:00:29 -05:00
John Wiegley
b78e22d52b Added a "seq" sequence property for all items
This indicates the absolute parsing order of every transaction and
posting.  It is 0 for generated items.
2010-02-04 18:23:52 -05:00
John Wiegley
428a2b4019 Improved the behavior of pivot reports 2010-02-04 04:12:19 -05:00
John Wiegley
1413085977 Added a --pivot=TAG option
This is equivalent to the following:

  --account='"TAG:" + tag(/TAG/)'
2010-02-02 17:07:05 -05:00
John Wiegley
a56a1db662 When creating temporary accounts, transfer flags 2010-02-02 16:25:46 -05:00
John Wiegley
b76aea7c0b Added a debug statement for report.predicate 2010-02-02 16:25:31 -05:00
John Wiegley
0be486c58b Fixed assertion failure in -M -A bal report 2010-01-21 04:59:45 -05:00
John Wiegley
d406aeb85d Guard against divide by zero error in -A reg report 2010-01-21 04:57:15 -05:00
John Wiegley
61edd3d8f4 Fixed account display bug in the balance report 2010-01-21 04:55:11 -05:00
John Wiegley
590ba76bd1 Restore "-p this" option (aka -p 'this month') 2010-01-21 04:33:56 -05:00
John Wiegley
67ce17e249 Guard against using an uninitialized value
Fixes DDB54BB8-8C1C-4129-A137-07A38068F3BE
2010-01-18 03:41:20 -05:00
John Wiegley
d176abf625 Fix for date parsing when no year is given 2010-01-16 21:12:13 -05:00
John Wiegley
f1a2a5a18d Cost of a post with neg. amount should be negative 2009-12-07 21:23:50 -05:00
John Wiegley
6d0ab845ea Allow relative includes in the current directory 2009-12-07 20:43:17 -05:00
John Wiegley
72aa0e0e44 Added some debugging code related to boost::regex 2009-11-25 04:40:03 -05:00
John Wiegley
2c90c10db1 Added support for a "fixed" directive
It lets you specify a fixed cost for a duration of a ledger file, for
example:

  fixed ecu $2

  2008/01/01 income
      assets🏦checking  1 ecu
      income:salary

  end fixed

This is equivalent to:

  2008/01/01 income
      assets🏦checking  1 ecu {=$2}
      income:salary
2009-11-25 04:39:59 -05:00
John Wiegley
a7424c1df9 Added a trim() value expression function 2009-11-25 02:48:58 -05:00
John Wiegley
4141afbfae * and | now comment chars, for the sake of Org-mode 2009-11-25 02:36:32 -05:00
Aristid Breitkreuz
6df3ea10f7 Added options: --unrealized-gains and --unrealized-losses
These options allow the user to specify what accounts names should be
used for these two types of accounts.  They are optional, and default
to:

  --unrealized-gains "Equity:Unrealized Gains"
  --unrealized-losses "Equity:Unrealized Losses"

These are intended to be set in one's ~/.ledgerrc file.
2009-11-24 05:08:28 -05:00
John Wiegley
11a217a481 Very minor but easy optimization for symbol_scope_t
Lots of symbol_scope_t throwaway objects get created during value
expression calculation, and 99% of them are never used.  Therefore, the
std::map which each contains is now within an optional<> wrapper, so
that no constructor happens unless one is actually used.
2009-11-24 04:14:34 -05:00
John Wiegley
b1d6ea876c Don't migrate commodity details from pricing entries 2009-11-24 03:25:46 -05:00
John Wiegley
68c3a9cfb7 Whitespace fix 2009-11-24 01:27:54 -05:00