Commit graph

136 commits

Author SHA1 Message Date
John Wiegley
63712728e1 Properly handle metadata tags on auto-postings 2012-11-12 02:30:04 -06:00
John Wiegley
29359f3a87 Account names in auto-xacts can be format strings 2012-11-12 02:30:04 -06:00
Craig Earls
14dcb27777 Implemented Bug551 Automatic Transactions are cleared base on parent 2012-10-23 13:07:39 -07:00
John Wiegley
8869566331 Fixed a subtle memory overwrite
Fixes #608
2012-06-27 16:55:46 -05: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
ee641f353c Resolve some issues with proof builds 2012-04-15 01:17:01 -05:00
John Wiegley
1e572d508d Add 'data' member to account/journal objects 2012-04-13 15:16:27 -05:00
John Wiegley
cee47cc495 Simplified some code in xact.cc 2012-03-23 16:59:06 -05:00
John Wiegley
2605d8a711 Improved error reporting for bad account names
Fixes #374
2012-03-16 04:29:35 -05:00
John Wiegley
c9f7195936 Added the notion of "virtual costs" 2012-03-09 01:28:20 -06:00
John Wiegley
7bb83173da Added some missing DEBUG #if's 2012-03-07 08:34:15 -06:00
John Wiegley
1e18536a8c Deferred notes were being processed too late 2012-03-07 05:37:49 -06:00
John Wiegley
76f97a63da Added parsing support for the many value directives 2012-03-07 05:20:42 -06:00
John Wiegley
69b25d367e Call register_account for posts created by auto xacts 2012-03-07 05:19:46 -06:00
John Wiegley
71d0033b6f Corrected several compile and link problems 2012-03-06 23:04:27 -06:00
John Wiegley
ff9cf572fe Added (disabled) code to stop sorting generated balancing postings 2012-03-05 17:49:11 -06:00
John Wiegley
46b124a649 Added some DEBUG statements 2012-03-05 17:47:44 -06:00
John Wiegley
121d878a0c When deleting a post from an xact, remove it from its account 2012-03-05 15:42:45 -06:00
John Wiegley
944e580825 Refactored the notion of "the current parsing context" 2012-03-01 03:31:28 -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
196816d5aa Added a TODO comment 2012-02-27 12:38:14 -06:00
John Wiegley
3ed09fc85b Optimizations 2012-02-27 11:52:27 -06:00
John Wiegley
2ec35ea6e9 Implement the "tag" metadata directive 2012-02-27 05:02:25 -06:00
John Wiegley
ee530f9433 Fixed the scoping of auto xact predicates 2012-02-27 04:08:39 -06:00
John Wiegley
9449ca2c80 Whitespace fix 2012-02-27 03:55:02 -06:00
John Wiegley
0efdc0cf6f The "id" of an item now maps to its UUID 2012-02-27 02:31:08 -06:00
John Wiegley
8887fe9fa9 Removed unneeded break statements 2012-02-17 15:09:32 -06:00
John Wiegley
f0791bbd72 Cleanup whitespace 2011-08-18 14:48:38 -04:00
John Wiegley
af94c94a6f Corrected a transient display order flaw
This was harmless, but affected the testability of results.
2011-03-28 01:53:15 -04:00
John Wiegley
266dee564f Price annotation no longer inject an implied cost
Consider the following transaction:

  2010-06-22 Sample
      Assets:Brokerage       10 AAPL {$30}
      Assets:Brokerage

Previously, this would have been equivalent to:

  2010-06-22 Sample
      Assets:Brokerage       10 AAPL @ $30
      Assets:Brokerage

However, this is not always what the user expects to happen.  When @ is
not being used, the transaction should reflect a mere transfer of
commodities.  This is now how it works, and thus the above transaction
is now equivalent to the following instead:

  2010-06-22 Sample
      Assets:Brokerage       10 AAPL {$30}
      Assets:Brokerage      -10 AAPL {$30}
2010-06-22 20:56:35 -04:00
John Wiegley
1f3dba7756 Don't do cost finalization for auto/period xacts 2010-06-22 20:53:05 -04:00
John Wiegley
d792cc0ffc Corrected a major flaw in the transaction finalizer
When a transaction has two commodities, but also a null posting, no
attempt should be made to resolve the costs in terms of the primary
commodity.
2010-06-21 17:44:19 -04:00
John Wiegley
6420390d36 If a posting's price has an annotation tag, save it 2010-06-20 18:50:44 -04:00
John Wiegley
968a6f3c0a Changes for building with Visual Studio 2008 2010-06-15 05:14:00 -04:00
John Wiegley
dcffd218a1 Revised how Ledger handles the "current year"
Now when the Y directive sets the current year for a region, it affects
everything, as if the clock really were set back to that year.
2010-06-14 03:23:09 -04:00
John Wiegley
e3f228bd5b Fixed several misplaced parentheses 2010-06-13 19:56:10 -04:00
John Wiegley
2ea075dc4f Report error context in expressions more precisely 2010-06-13 18:39:26 -04:00
John Wiegley
ea1642b3f9 Completely reworked argument passing in expressions 2010-06-13 05:02:14 -04:00
John Wiegley
6ef755c133 Added support for assert, check and expr directives
These can occur in many places:

  ; Within an automated transaction, the assert is evaluated every time
  ; a posting is matched, with the expression context set to the
  ; matching posting.
  = /Food/
    assert account("Expenses:Food").total >= $100

  2010-06-12 Sample
    Expenses:Food                $100
    Assets:Checking

  ; At file scope, the expression is evaluated with "global" scope.
  assert account("Expenses:Food").total == $100

  ; At the top of a transction, the assertion's scope is the
  ; transaction.  After a posting, the scope is that posting.  Note
  ; however that account totals are only adjusted after successful
  ; parsing of a transaction, which means that all the assertions below
  ; are true, even though it appears as though the middle posting should
  ; affect the total immediately (which is not the case).
  2010-06-12 Sample 2
    assert account("Expenses:Food").total == $100
    Expenses:Food                $50
    assert account("Expenses:Food").total == $100
    Assets:Checking
    assert account("Expenses:Food").total == $100
2010-06-13 01:03:48 -04:00
John Wiegley
6f56a7443f Removed an unused function 2010-06-13 01:03:48 -04:00
John Wiegley
8d2fce1ae8 Automated xacts may now contain "deferred tags"
For example, consider the following automated transaction:

  = /Food/
    ; Next Date:: date + 10
    (Expenses:Tax)                1.00
    ; Next Date:: date + 20

This will add a metadata field named 'Next Date' to the _matching
posting_, with a value that is 10 days later than that posting.  It will
also generate a new posting for that transaction, whose amount is the
same as the matching posting.  Further, it will add a 'Next Date'
metadata tag to the _generated posting_ whose value is 20 days later
than the date of the matching posting.
2010-06-13 01:03:48 -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
ab749742d9 Several corrections to transaction finalization 2010-06-10 16:33:46 -04:00
John Wiegley
3e05dce72e gain/loss posting based on a virtual should also be 2010-06-10 14:45:44 -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
158b9c92fd Fixed minor rounding issue with priced commodities 2010-06-09 03:39:17 -04:00