summaryrefslogtreecommitdiff
path: root/src/account.cc
Commit message (Collapse)AuthorAgeFilesLines
* Account valexprs: earliest_checkin, latest_checkoutJohn Wiegley2012-03-131-3/+42
| | | | | Lets you access the earliest/latest checkin/checkout times for timelog entries in an account. Will be NULL if the account doesn't contain any.
* Added some missing DEBUG #if'sJohn Wiegley2012-03-071-0/+2
|
* Corrected several compile and link problemsJohn Wiegley2012-03-061-2/+4
|
* Removed an invalid assertionJohn Wiegley2012-03-051-1/+4
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Add "note" valexpr function to accountsJohn Wiegley2012-02-271-0/+6
|
* Fixes for variable shadowing (2/28)John Wiegley2012-02-171-24/+24
|
* Fixes for variable shadowing (1/28)John Wiegley2012-02-171-6/+6
|
* Cleanup whitespaceJohn Wiegley2011-08-181-1/+1
|
* Individual postings may each have their own payeeJohn Wiegley2010-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
|
* Completely reworked argument passing in expressionsJohn Wiegley2010-06-131-28/+22
|
* Expression evaluations now have a "type context"John Wiegley2010-06-131-1/+5
| | | | | | | | | 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-5/+3
|
* account_t::add_post resets family_details.gatheredJohn Wiegley2010-06-131-0/+14
|
* account(NAME) function can lookup account objectsJohn Wiegley2010-06-131-3/+18
| | | | | | 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.
* Untabified all source filesJohn Wiegley2010-06-111-35/+35
|
* Made lookup of an account's "cost" a calc errorJohn Wiegley2010-06-061-0/+6
|
* Added new "addr" value expression functionJohn Wiegley2010-06-031-0/+6
| | | | | It returns the address of the given object as an integer. This can be used to uniquely compare entities.
* Fixed two memory reference errorsJohn Wiegley2010-06-021-8/+3
|
* Temporary accounts were referenced after deletionJohn Wiegley2010-05-221-1/+17
| | | | Fixes D53C98E5-506D-4CE5-91A3-7666FD33B65B
* Added any() and all() value expression macrosJohn Wiegley2010-05-081-0/+34
| | | | | | | | | | | | | | | | | | | | 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'.
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Fixed assertion failure in -M -A bal reportJohn Wiegley2010-01-211-1/+1
|
* Added historical support for single-letter valexprsJohn Wiegley2009-11-141-1/+20
|
* Added has_xdata() methods for journal_t and xact_tJohn Wiegley2009-11-121-2/+11
|
* account.amount and .total return simplified valuesJohn Wiegley2009-11-101-2/+2
|
* Moved xdata clearing code into each type properJohn Wiegley2009-11-051-0/+9
|
* Segregated symbols into 5 separate namespacesJohn Wiegley2009-11-041-1/+5
| | | | | | | | | | | | | | | | | | | | | 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/+15
| | | | | | | | | 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.
* Improved the way account temporaries are managedJohn Wiegley2009-11-011-4/+3
|
* Increased size of buffer used to split account namesJohn Wiegley2009-11-011-1/+1
|
* Add a position_t object for tracking item positionsJohn Wiegley2009-10-301-1/+1
| | | | It is also optional, which is useful for generated items.
* Added some additional assertion tests re: tempsJohn Wiegley2009-10-281-1/+3
|
* Renamed two methods, for consistency's sakeJohn Wiegley2009-10-271-6/+6
|
* Added a new "cleared" reportJohn Wiegley2009-10-271-0/+10
| | | | | | This is a balance report with three columns: Current balance | Cleared balance | Last cleared date
* Redid the way temporaries are handled in filteringJohn Wiegley2009-10-271-13/+22
|
* Restored --percent option, added baseline testJohn Wiegley2009-06-211-0/+15
|
* Refinement to display of account balancesJohn Wiegley2009-06-151-2/+2
| | | | Fixes 5A03CFC3-1A76-4F93-A1FE-555F98438C5A
* Enabled use of pre-compiled headers by defaultJohn Wiegley2009-03-101-0/+2
|
* Rewrote the balance report again, to fix --depthJohn Wiegley2009-03-081-2/+2
|
* Revised the ways statistics are computedJohn Wiegley2009-03-061-11/+32
| | | | | | | It is no longer done in calc_posts, but recursively on each account. This allows value expressions to ask statistical questions, like "earliest cleared posting?" (TBD) from any specific account, computed lazily.
* Changed the way that account balances are computedJohn Wiegley2009-03-061-20/+137
|
* Gather account details in a details_t structureJohn Wiegley2009-03-031-6/+6
|
* Normalized how account totals are calculatedJohn Wiegley2009-03-031-37/+11
|
* The -B, -G, -V reports now show rounding amountsJohn Wiegley2009-02-261-0/+9
| | | | | | | | | 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-2/+2
|
* Fixed the --gain option for balance reportsJohn Wiegley2009-02-251-0/+1
|
* Create a new interactive_t helper classJohn Wiegley2009-02-211-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of this class is much like Emacs' (interactive) form: it allows a value expression function to declare exactly how many arguments, and of what type, it intends to receive. It then offers type-safe access to theese arguments in a consistent manner. An example value expression function definition in C++: value_t fn_foo(call_scope_t& scope) { // We expect a string, an integer, and an optional date interactive_t args(scope, "sl&d"); std::cout << "String = " << args.get<string>(0) << "Integer = " << args.get<long>(1) << std::endl; if (args.has(2)) // was a date provided? std::cout << "Date = " << args.get<date_t>(2) << std::endl; return NULL_VALUE; } There is also an in_context_t<T> template, which finds the context type T in the current scope hierarchy. The in_context_t then also acts as a smart pointer to reference this context object, in addition to serving the same duty as interactive_t. This combination of intent is solely for the sake of brevity. value_t fn_bar(call_scope_t& scope) { in_context_t<account_t> env(scope, "sl&d"); std::cout << "Account name = " << env->fullname() << "String arg = " << env.get<string>(0) << std::endl; return NULL_VALUE; } As you can see here, 'env' acts as a smart pointer to the required context, and an object to extract the typed arguments.
* If an account's aggregate amount is null, return 0John Wiegley2009-02-191-1/+4
|