summaryrefslogtreecommitdiff
path: root/src/post.cc
Commit message (Collapse)AuthorAgeFilesLines
* has_tag and get_tag now take an 'inherit' parameterJohn Wiegley2010-06-181-8/+10
|
* Individual postings may each have their own payeeJohn Wiegley2010-06-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Report error context in expressions more preciselyJohn Wiegley2010-06-131-4/+8
|
* Completely reworked argument passing in expressionsJohn Wiegley2010-06-131-53/+45
|
* Expression evaluations now have a "type context"John Wiegley2010-06-131-28/+12
| | | | | | | | | Thus, an expression can know if the context in which it's being evaluated requires a string, and if so, determine it's output accordingly. For example: account ; returns the full name of the posting's account account.total ; here the context is SCOPE, so account is an obj
* Added a new scope_value() inline helper functionJohn Wiegley2010-06-131-2/+2
|
* account(NAME) function can lookup account objectsJohn Wiegley2010-06-131-1/+16
| | | | | | For example, just the word "account" returns the name of the current posting's account, but account("Expenses:Food") returns the actual account object, so that it's total may be accessed.
* Improved value expression function 'commodity'John Wiegley2010-06-121-8/+15
| | | | | | Without arguments -- and in a posting -- it is equivalent to "commodity(amount)". Otherwise, it returns the commodity symbol of its argument.
* Store metadata values as value_t instead of stringJohn Wiegley2010-06-121-6/+6
|
* Untabified all source filesJohn Wiegley2010-06-111-68/+68
|
* Fixed interaction with -V/X and grouped postingsJohn Wiegley2010-06-091-0/+17
| | | | | | | | | | 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
* Empty notes and tags now return null valuesJohn Wiegley2010-05-301-4/+8
|
* Created new valexpr variable display_accountJohn Wiegley2010-05-221-8/+24
| | | | | | | | | Where display_account might be '(Expenses:Food)', account will always be 'Expenses:Food'. account is now used by all matching and query operations, while display_account is used in the various report outputs (besides balance, which never distinguished virtual accounts). Fixes F2832452-4521-49A3-B854-F4E12CC4D82E
* Changed the report generated by the csv commandJohn Wiegley2010-05-221-2/+12
| | | | | | | | | | | Fields are now: Date,Code,Payee,Account,Commodity,Total,State,Note Instead of outputting amounts potentially as $1,000.00 (which was an error anyway), the output is now: $,1000.00. This makes the commodity available in a separate field, and removes display of thousands markers. Also, european formatting is always off.
* Added account_id and xact_id valexpr vars for postsJohn Wiegley2010-05-181-0/+36
| | | | | account_id is the "whicheth" number for that posting within its account. The xact_id is within its transaction.
* Added any() and all() value expression macrosJohn Wiegley2010-05-081-0/+48
| | | | | | | | | | | | | | | | | | | | 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.
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Some minor refactoring of the textual parserJohn Wiegley2010-02-051-0/+14
|
* Added actual_date() methods for itemsJohn Wiegley2010-02-051-0/+12
|
* Added historical support for single-letter valexprsJohn Wiegley2009-11-141-2/+26
|
* Moving the #include of unistring.h into format.hJohn Wiegley2009-11-101-1/+0
|
* Whitespace fixJohn Wiegley2009-11-101-4/+4
|
* Fixes to the value expression parser and evaluatorJohn Wiegley2009-11-101-18/+19
|
* account_amount() is now account().amountJohn Wiegley2009-11-101-37/+39
|
* XML reporting now works via the "xml" commandJohn Wiegley2009-11-091-0/+95
|
* Added support for Boost.Regex w/ ICUJohn Wiegley2009-11-071-1/+1
| | | | | This allows for correct searching of UTF-8 encoded strings, such as lower-case versions of Russian words to find mixed-case words.
* If a posting's amount is null, return 0LJohn Wiegley2009-11-051-0/+6
|
* 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)
* Added "reported posts" into account xdataJohn Wiegley2009-11-021-0/+6
| | | | | | | | | 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.
* A posting's note includes its parent xact's noteJohn Wiegley2009-11-011-0/+11
|
* Removed most #if 0 blocks and callout commentsJohn Wiegley2009-10-311-2/+2
|
* Renamed two methods, for consistency's sakeJohn Wiegley2009-10-271-1/+1
|
* Made the id function available in post contextsJohn Wiegley2009-10-271-0/+22
|
* Fixed many compiler warnings from g++ 4.4John Wiegley2009-10-251-1/+2
|
* Restored --percent option, added baseline testJohn Wiegley2009-06-211-0/+2
|
* Restored pricesdb command and --pricesdb-format optionJohn Wiegley2009-06-181-0/+6
|
* Enabled use of pre-compiled headers by defaultJohn Wiegley2009-03-101-0/+2
|
* Changed the way that account balances are computedJohn Wiegley2009-03-061-2/+3
|
* Enriched the behavior of post_t::add_to_valueJohn Wiegley2009-03-051-3/+21
| | | | | The new behavior will be used in future by some pending topic branches I'm working on.
* Renamed some flags and members in post_tJohn Wiegley2009-03-051-10/+8
|
* Reduced the #include dependency tree to a minimumJohn Wiegley2009-03-041-2/+3
|
* Gather account details in a details_t structureJohn Wiegley2009-03-031-2/+2
|
* Added a new "account_amount" valexpr functionJohn Wiegley2009-03-031-0/+31
| | | | At the moment, it's only useful during parsing.
* Changed "priced" to "cost_calculated" for clarityJohn Wiegley2009-02-271-4/+4
|
* Fixed bugs relating to sign and rounding of costsJohn Wiegley2009-02-271-3/+9
|
* Fixed the way item state is parsed and managedJohn Wiegley2009-02-271-11/+0
|
* The -B, -G, -V reports now show rounding amountsJohn Wiegley2009-02-261-2/+10
| | | | | | | | | 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.
* Fix for sensitive compilation environments.Eugene Morozov2009-02-251-1/+1
|
* Output "@ AMOUNT" cost in the print reportJohn Wiegley2009-02-241-11/+24
|