summaryrefslogtreecommitdiff
path: root/src/account.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Added --flat option, to flatten the balance reportJohn Wiegley2009-02-171-8/+15
|
* Rewrote how the balance command displays accountsJohn Wiegley2009-02-171-17/+39
| | | | | | | | The previous method bent over backwards to try and avoid multiple passes through the account tree, but the result was a horribly complicated mess that never ceased to dredge up obscure bugs. The new scheme is a very, very simple two-pass algorithm, with multiple subpasses during the second pass for refining the output based on the report options.
* If an account's "total" is empty, return 0John Wiegley2009-02-151-1/+4
|
* Added account(_base) accessors to account_tJohn Wiegley2009-02-151-0/+12
|
* Added 'count' and 'subcount' props for accountsJohn Wiegley2009-02-151-1/+21
|
* Removed "total_cost" valexpr, and value_t::costJohn Wiegley2009-02-151-7/+0
| | | | | Since cost reports are now calculated by setting the amount_ expression, there is no need to track a separate "total cost" entity.
* Use the report's amount_expr everywhere that computes an xact's amount.John Wiegley2009-02-091-7/+4
|
* Moved get_partial_name from format.cc into account_t, where it belongs.John Wiegley2009-02-081-18/+22
|
* Refer to empty expression operators as simply NULL.John Wiegley2009-02-071-1/+1
|
* Whitespace fix.John Wiegley2009-02-051-0/+2
|
* Largely removed all of Ledger's use of global variables, for the REPL's sake.John Wiegley2009-02-041-7/+29
|
* Removed the global references to session->report.John Wiegley2009-02-031-4/+4
|
* Inspired by Omari Norman, I've rewritten main.cc so it's easy to approach.John Wiegley2009-01-311-2/+2
|
* Increased copyright range to include 2009.John Wiegley2009-01-201-1/+1
|
* Added a function for account_t to get the account's total cost.John Wiegley2009-01-191-0/+7
|
* Factored common parts of entry_t and xact_t into new item_tJohn Wiegley2008-09-191-4/+3
|
* If a value expression lookup on an account object fails, defer to the currentJohn Wiegley2008-09-181-1/+3
| | | | session object. Transactions and entries already do this.
* Don't use single code format characters anymore. Access to object detailsJohn Wiegley2008-09-181-11/+5
| | | | will now always be done with "%(identifier)".
* Added the "depth" value expression function for accounts.John Wiegley2008-08-141-0/+9
|
* The balance report is working again.John Wiegley2008-08-101-2/+7
|
* Basic balance reports are working again!John Wiegley2008-08-101-20/+58
|
* Moved around most of the files so that source code is in src/, documentationJohn Wiegley2008-08-051-0/+198
is in doc/, etc.