summaryrefslogtreecommitdiff
path: root/src/xact.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Completely reworked argument passing in expressionsJohn Wiegley2010-06-131-15/+10
|
* Added support for assert, check and expr directivesJohn Wiegley2010-06-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Removed an unused functionJohn Wiegley2010-06-131-7/+0
|
* Automated xacts may now contain "deferred tags"John Wiegley2010-06-131-2/+24
| | | | | | | | | | | | | | | | 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.
* Store metadata values as value_t instead of stringJohn Wiegley2010-06-121-1/+1
|
* Untabified all source filesJohn Wiegley2010-06-111-234/+234
|
* Several corrections to transaction finalizationJohn Wiegley2010-06-101-5/+13
|
* gain/loss posting based on a virtual should also beJohn Wiegley2010-06-101-1/+6
|
* Allow fixated costs, as well as pricesJohn Wiegley2010-06-101-0/+6
| | | | | | | | | 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
* Fixed minor rounding issue with priced commoditiesJohn Wiegley2010-06-091-4/+6
|
* Simplified some debug codeJohn Wiegley2010-06-061-4/+2
|
* Allow opt -NDEBUG build to complete without warningsJohn Wiegley2010-06-041-0/+2
|
* Empty notes and tags now return null valuesJohn Wiegley2010-05-301-1/+1
|
* A minor fix to transaction auto-balancingJohn Wiegley2010-05-221-45/+40
| | | | | | | | | | 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
* Interpolate uses of $account in automated postingsJohn Wiegley2010-05-221-2/+8
| | | | Fixes 5CB52887-408E-48F0-8798-3C640D0295B3
* Added any() and all() value expression macrosJohn Wiegley2010-05-081-0/+38
| | | | | | | | | | | | | | | | | | | | 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'.
* Rewrite the "print" command as a custom functionJohn Wiegley2010-03-081-2/+2
| | | | | There ended up being too many corner cases for the generalized formatter to handle.
* Abstracted an sha1sum() functionJohn Wiegley2010-03-061-6/+1
|
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Many improvements to Ledger's Python bindingsJohn Wiegley2009-11-191-6/+7
|
* Changed a use of balance_error to amount_errorJohn Wiegley2009-11-141-1/+1
|
* Memoize results from the fast predicate matcherJohn Wiegley2009-11-141-1/+16
| | | | | This gains another 15% for the parser, again with a very simple change that has no impact if the fast predicate matcher fails to work.
* Spot optimization for simple automated xact exprsJohn Wiegley2009-11-141-2/+65
| | | | | | This reduces parsing time in the optimized build by 25%, and was a safe, easy patch. If the "quick predicate evaluator" fails, we disable it from that point on go back to what the standard code does.
* Added has_xdata() methods for journal_t and xact_tJohn Wiegley2009-11-121-0/+9
|
* Transactions now verified after applying auto xactsJohn Wiegley2009-11-111-0/+57
| | | | | This way you cannot violate the balancing rules, not even by adding a stray posting via an automated transaction.
* Automated postings defer amount expression calculationJohn Wiegley2009-11-111-18/+29
| | | | | | | | | | | | | | | | | 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.
* Fixed automated posts not appearing in bal reportsJohn Wiegley2009-11-101-0/+1
|
* Fix for automated amount multipliers and null amountsJohn Wiegley2009-11-091-1/+3
|
* XML reporting now works via the "xml" commandJohn Wiegley2009-11-091-0/+59
|
* Renamed journal_t::basket to bucketJohn Wiegley2009-11-071-2/+2
|
* Report sought magnitude when balancing errors occurJohn Wiegley2009-11-051-15/+17
|
* Moved xdata clearing code into each type properJohn Wiegley2009-11-051-0/+7
|
* Segregated symbols into 5 separate namespacesJohn Wiegley2009-11-041-2/+6
| | | | | | | | | | | | | | | | | | | | | 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)
* Fixed copy constructors for transactionsJohn Wiegley2009-11-011-2/+2
|
* Removed excessive validity check from xact_t::validJohn Wiegley2009-11-011-4/+0
|
* Fix to xact_t::valid()John Wiegley2009-11-011-1/+1
|
* Removed most #if 0 blocks and callout commentsJohn Wiegley2009-10-311-4/+0
|
* Add a position_t object for tracking item positionsJohn Wiegley2009-10-301-2/+2
| | | | It is also optional, which is useful for generated items.
* Added some additional assertion tests re: tempsJohn Wiegley2009-10-281-4/+11
|
* Support balancing of postings with integer amountsJohn Wiegley2009-10-271-1/+6
|
* Use the WRITTEN date format for idstringsJohn Wiegley2009-10-271-1/+1
|
* Redid the way temporaries are handled in filteringJohn Wiegley2009-10-271-1/+1
|
* Made the id function available in post contextsJohn Wiegley2009-10-271-19/+35
|
* New valexpr functions: id, idstring, magnitudeJohn Wiegley2009-10-251-0/+39
| | | | | | id returns a unique SHA1 id of a transaction. idstring is the string that the SHA1 is based on. magnitude is the sum of the positive side of a transaction.
* Split commodity.h/cc into three filesJohn Wiegley2009-06-241-3/+4
| | | | | | commodity.h - code for commodity_t annotate.h - commodity annotations pool.h - commodity pool management
* Fixes to the 'xact' command (used to be 'entry')John Wiegley2009-06-191-2/+8
|
* Enabled use of pre-compiled headers by defaultJohn Wiegley2009-03-101-0/+2
|
* Changed the way that account balances are computedJohn Wiegley2009-03-061-10/+6
|
* Reduced the #include dependency tree to a minimumJohn Wiegley2009-03-041-2/+2
|
* Cured several harmless compiler warningsJohn Wiegley2009-03-041-0/+4
|