summaryrefslogtreecommitdiff
path: root/src/account.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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.