Commit graph

45 commits

Author SHA1 Message Date
John Wiegley
2ac996d916 Shorten debug comment 2012-11-23 16:54:03 -06:00
John Wiegley
4681e58d7f Converted the Ledger build system to use CMake 2012-05-20 04:48:05 -05:00
John Wiegley
a38ed141c1 Switched to Boost.PropertyTree for XML generation 2012-05-18 01:31:01 -06:00
John Wiegley
f4f3058b8c Switch to using Boost.Format 2012-05-14 21:44:00 -06:00
John Wiegley
fcabd64a89 Whitespace fix 2012-04-04 02:26:34 -05:00
John Wiegley
902ab72eb4 Forgot to copy two members in post_t's copy-ctor 2012-03-28 03:02:31 -05:00
John Wiegley
22505d9527 Always call TRACE_CTOR at the end of constructors 2012-03-20 02:10:40 -05:00
John Wiegley
cfe8142b2b Access to checkin/checkout of timelog entries 2012-03-13 03:41:00 -05:00
John Wiegley
59cbcf703c post_t's copy constructor wasn't copying xdata_ 2012-03-13 00:03:56 -05:00
John Wiegley
c9f7195936 Added the notion of "virtual costs" 2012-03-09 01:28:20 -06:00
John Wiegley
76f97a63da Added parsing support for the many value directives 2012-03-07 05:20:42 -06:00
John Wiegley
e2afc783db Increased file copyrights to 2012 2012-02-29 22:32:23 -06:00
John Wiegley
656e46e182 Renamed actual/effective dates to primary/auxiliary 2012-02-28 03:02:16 -06:00
John Wiegley
20f4ccde96 Added some debug code 2011-02-10 23:00:36 -05:00
John Wiegley
2f50e30b89 Scopes can now provide a description of themselves
This isn't being used yet, but it likely will to improve the information
presented to users if their value expressions fail to compile or
evaluate.
2010-06-24 19:53:59 -04:00
John Wiegley
b80be82b8d has_tag and get_tag now take an 'inherit' parameter 2010-06-18 02:19:39 -04:00
John Wiegley
31e8ed7587 Individual postings may each have their own payee
If a posting has the metadata field "Payee" set to a string, that will
be used as the payee name for that posting.  This affects the register
report, the payees report, and the --by-payee option.

This is useful because sometimes I send, say, 4 checks at a time to my
bank.  So on my bank statement, this is all just one amount:

   2010-06-17 Sample
     Assets:Bank        $400.00
     Income:Check1     $-100.00
     Income:Check2     $-100.00
     Income:Check3     $-100.00
     Income:Check4     $-100.00

Though it's important that the Assets:Bank posting be a single posting
of $400 value, I'd like for income reports to show whom each check came
from.  Now I can say:

   2010-06-17 Sample
     Assets:Bank        $400.00
     Income:Check1     $-100.00  ; Payee: Person One
     Income:Check2     $-100.00  ; Payee: Person Two
     Income:Check3     $-100.00  ; Payee: Person Three
     Income:Check4     $-100.00  ; Payee: Person Four

When I report this, it appears as:

10-Jun-17 Sample             Assets:Bank             $400.00     $400.00
          Person One         Income:Check1          $-100.00     $300.00
          Person Two         Income:Check2          $-100.00     $200.00
          Person Three       Income:Check3          $-100.00     $100.00
          Person Four        Income:Check4          $-100.00           0

This shows that they are all in the same transaction (which is why the
date is not repeated), but they have different payees.
2010-06-17 23:42:23 -04:00
John Wiegley
28c65cda51 Store metadata values as value_t instead of string 2010-06-12 14:55:18 -04:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
685b12d8d3 Allow fixated costs, as well as prices
You can now establish a fixated price automatically by way of a fixated
cost.  The syntax for this is:

  2009/11/01 Sample
      Assets                1 apple @ =$0.10
      Equity
2010-06-10 12:29:58 -04:00
John Wiegley
fc09b69fb7 Fixed interaction with -V/X and grouped postings
With -s, -M/Y/D, -n, and a few other flags, postings get "grouped" into
meta-transactions that contain more postings than before.  In all these
cases, -V use the date of the *earliest* posting in that group, which
makes little sense and caused breakages with -J.  It now uses the latest
date.

Fixes #197 / 68EAF363-D0FE-4127-866E-A5AEBACB65D6
2010-06-09 02:22:50 -04:00
John Wiegley
63c7ba0322 Make --anon work with the print command
Fixes #226 / C1C1E731-D991-40ED-BE43-8ED55585386C
2010-06-05 02:46:22 -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
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
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
69da18cd30 Some minor refactoring of the textual parser 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
9d61d3d621 Added actual_date() methods for items 2010-02-05 00:00:29 -05:00
John Wiegley
d12c7e08c6 Removed post_t::xdata_t::ptr, which is not used 2009-11-14 06:11:18 -05:00
John Wiegley
0068ac8fc0 Made ~post_t virtual 2009-11-12 05:08:43 -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
6cdb79e2a6 XML reporting now works via the "xml" command 2009-11-09 03:42:35 -05:00
John Wiegley
394c7bd8df Removed a bunch of empty comments 2009-11-08 14:59:11 -05:00
John Wiegley
78e6770c4c Segregated symbols into 5 separate namespaces
The different namespaces are:

  Function      Value expression functions, which receive a "context"
  Option        Command-line options
  Precommand    Commands which are invoked before reading the journal
  Command       Commands which are invoked after reading the journal
  Directive     Directives that occur at column 0 in a data file

This greatly eases the ability for Python uses to add intercept hooks to
change how the basic Ledger module functions.  An example of what should
be possible soon:

  import ledger

  def my_foo_handler(value):
      print "--foo received:", value

  ledger.add_handler(ledger.Option, "foo=", my_foo_handler)
2009-11-04 20:40:48 -05:00
John Wiegley
b14c814fec Whitespace fix 2009-11-04 20:40:42 -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
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
1fd4387b67 Restored pricesdb command and --pricesdb-format option 2009-06-18 01:49:49 +01:00
John Wiegley
a2c7312080 Renamed some flags and members in post_t 2009-03-05 22:39:32 -04:00
John Wiegley
cbd66ba1c9 Changed "priced" to "cost_calculated" for clarity 2009-02-27 15:32:38 -04:00
John Wiegley
06365aac05 Fixed the way item state is parsed and managed 2009-02-27 02:35:51 -04:00
John Wiegley
d58797e98c The -B, -G, -V reports now show rounding amounts
This way, if the running total is off by a penny or two due to rounding
of one or more commodities in the account, the user will see it.

This commit also reorganizes the testing code a bit, which I did after
adding the ninth test series (ConfirmTests), to validate the new
rounding code.
2009-02-26 03:16:39 -04:00
John Wiegley
eb364f4183 Improved the way that entries are balanced 2009-02-24 03:03:04 -04:00
John Wiegley
625b94cf04 Switched from using POST_AUTO to ITEM_GENERATED 2009-02-24 02:23:20 -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