summaryrefslogtreecommitdiff
path: root/src/xact.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Added some DEBUG statementsJohn Wiegley2012-03-051-0/+2
|
* When deleting a post from an xact, remove it from its accountJohn Wiegley2012-03-051-0/+2
|
* Refactored the notion of "the current parsing context"John Wiegley2012-03-011-2/+4
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Renamed actual/effective dates to primary/auxiliaryJohn Wiegley2012-02-281-3/+3
|
* Added a TODO commentJohn Wiegley2012-02-271-0/+2
|
* OptimizationsJohn Wiegley2012-02-271-3/+4
|
* Implement the "tag" metadata directiveJohn Wiegley2012-02-271-3/+3
|
* Fixed the scoping of auto xact predicatesJohn Wiegley2012-02-271-4/+6
|
* Whitespace fixJohn Wiegley2012-02-271-3/+2
|
* The "id" of an item now maps to its UUIDJohn Wiegley2012-02-271-27/+0
|
* Removed unneeded break statementsJohn Wiegley2012-02-171-1/+0
|
* Cleanup whitespaceJohn Wiegley2011-08-181-3/+3
|
* Corrected a transient display order flawJohn Wiegley2011-03-281-1/+10
| | | | This was harmless, but affected the testability of results.
* Price annotation no longer inject an implied costJohn Wiegley2010-06-221-21/+7
| | | | | | | | | | | | | | | | | | | | | | | 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}
* Don't do cost finalization for auto/period xactsJohn Wiegley2010-06-221-48/+50
|
* Corrected a major flaw in the transaction finalizerJohn Wiegley2010-06-211-2/+3
| | | | | | 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.
* If a posting's price has an annotation tag, save itJohn Wiegley2010-06-201-25/+33
|
* Changes for building with Visual Studio 2008John Wiegley2010-06-151-1/+1
|
* Revised how Ledger handles the "current year"John Wiegley2010-06-141-10/+5
| | | | | 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.
* Fixed several misplaced parenthesesJohn Wiegley2010-06-131-2/+2
|
* Report error context in expressions more preciselyJohn Wiegley2010-06-131-2/+2
|
* 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
|