summaryrefslogtreecommitdiff
path: root/src/report.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Use more general scrub valexpr function in formatsJohn Wiegley2009-02-211-1/+8
|
* Create a new interactive_t helper classJohn Wiegley2009-02-211-23/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Made --leeway a synonym for --price-expJohn Wiegley2009-02-211-0/+1
|
* Added --start-of-week option, used with --weeklyJohn Wiegley2009-02-211-0/+1
| | | | | For example, --start-of-week=monday can be used to report weeks that begin on Mondays.
* Handle reporting widths that are too smallJohn Wiegley2009-02-211-1/+2
|
* Added a new --exact optionJohn Wiegley2009-02-211-0/+1
| | | | | | | | | The purpose of this option is that usually when you do a --monthly periodic report, you see dates ranges from the first day of each month, to the last day. With --exact, the first day of each range will be the date of the first transaction found in that range, and likewise with the end of the range. Essentially it "contracts" the reported period dates to reflect the exact begin and end dates.
* Restored --forecast, now also --forecast-whileJohn Wiegley2009-02-211-1/+1
|
* Restored the --base optionJohn Wiegley2009-02-201-1/+5
|
* Added more option baseline tests, enabled --dowJohn Wiegley2009-02-201-1/+1
|
* Removed unused --cache optionJohn Wiegley2009-02-201-2/+2
|
* Restored the --basis optionJohn Wiegley2009-02-201-6/+18
|
* Added --no-total optionJohn Wiegley2009-02-201-2/+3
| | | | This simply omits the final total in the balance report, nothing more.
* Rewrote the equity command, which is working againJohn Wiegley2009-02-201-27/+27
| | | | | | The old implementation used an account formatter, and was very specialized. The new is done as a transaction filter, and works along with everything else, eliminating bugs special to the equity report.
* Allow for sorting of the balance reportJohn Wiegley2009-02-191-2/+2
| | | | | | Sorting is repeated at each level of the hierarchy, unless --flat was specified in which case it applies to the entire applicable accounts list.
* Added a new --columns= optionJohn Wiegley2009-02-191-0/+1
|
* The sequence -M -p 2004 now equals -p 2004 -MJohn Wiegley2009-02-191-1/+1
|
* Restored the -j and -J optionsJohn Wiegley2009-02-191-0/+7
|
* Moved init of options to the options themselvesJohn Wiegley2009-02-191-52/+0
|
* Improved how register reports are formattedJohn Wiegley2009-02-191-33/+34
| | | | | | | | | | | | As a result, --wide is working again, and --wide-register-format has been removed. Also, the following new options are recognized, for controlling per-column formatting: --date-width NUM --payee-width NUM --account-width NUM --amount-width NUM --total-width NUM
* Added --flat option, to flatten the balance reportJohn Wiegley2009-02-171-4/+6
|
* Removed the %*| special char, for %*(" ")John Wiegley2009-02-171-2/+2
|
* The option --cost is now an alias for --basisJohn Wiegley2009-02-171-2/+1
|
* Added new --set-acount and --set-payee optionsJohn Wiegley2009-02-161-1/+3
| | | | | | These fully generalize the previous --payee-as-account and such options, which, for example, is now implemented to be the same as saying, "--set-account payee".
* Added several new reporting optionsJohn Wiegley2009-02-161-1/+4
| | | | | | | | | | | | | | | To help with gathering specific reports: - --payee-as-account copies the entry's payee field to the account, allowing the subtotal report to show unique payees for each period. - --comm-as-account copies the transaction's amount's commodity to the account. - --code-as-account copies the entry's code to the account Also created aliases for some of these options, for conistency's sake: - --commodity-as-payee is now an alias for --comm-as-payee - --commodity-as-account is now an alias for --comm-as-account
* Accept --first/--last as synonyms for --head/--tailJohn Wiegley2009-02-161-0/+2
|
* Made "stat" a synonym for the "stats" commandJohn Wiegley2009-02-161-1/+1
|
* Moved around some functions for clarityJohn Wiegley2009-02-161-18/+2
|
* The -n option for bal command is working againJohn Wiegley2009-02-161-1/+1
| | | | | The fix was that when appending new predicates, enclosed both sides of the AND with parentheses.
* Made several of the filters more context awareJohn Wiegley2009-02-151-14/+19
| | | | | This resolves certain issues where value expressions were not being looked up within their full context.
* Don't apply all filters for account-wise reportsJohn Wiegley2009-02-151-1/+1
| | | | This creates its own problems; instead, only most are used.
* Print stripped amounts in the print reportJohn Wiegley2009-02-151-2/+2
|
* Normalized handling of several report optionsJohn Wiegley2009-02-151-1/+1
|
* Re-enabled the --format (-F) optionJohn Wiegley2009-02-151-10/+16
|
* The "xact" variable now returns null for accountsJohn Wiegley2009-02-151-0/+5
|
* item_predicate now operates on scope_tJohn Wiegley2009-02-151-2/+2
| | | | This means item_predicate is no longer a template.
* chain_xact_handlers now always operators the sameJohn Wiegley2009-02-151-3/+3
| | | | | | Previously, account-wise reports used a subset of the total number of transaction filters, but this could cause confusing results, and made some reports immpossible (such as account-wise monthly averages).
* Removed the %! formatting code, as it does nothingJohn Wiegley2009-02-151-6/+6
|
* Changed the semantics of the "prices" reportJohn Wiegley2009-02-131-2/+1
| | | | | | | | | | | | | | | The prices report now uses the following scheme: PAYEE -> name of commodity of price ACCOUNT -> name of commodity of item AMOUNT -> price DATE -> date of pricing However, the report does not show the payee. The only reason the payee is set is to enable clever querying. For example: ledger prices gold # show all known prices for GOLD ledger prices @gold # show all known prices *in* GOLD
* The formatting code no longer justifies valuesJohn Wiegley2009-02-131-2/+2
| | | | | This is done in the value code, which knows -- based on the value's type -- how best to apply the justification.
* Don't print an xact's amount if it was calculatedJohn Wiegley2009-02-131-4/+4
| | | | | That is, if the user didn't enter an amount for that transaction in their ledger journal, don't print one out either.
* Added a "reload" command, for use at the REPLJohn Wiegley2009-02-131-0/+2
| | | | | | | Created a new function, session_t::reread_journal_files, which throws away all previous state data and reads in the same files again. This is needed to allow Emacs to communicate with Ledger via the REPL, so that it tell Ledger when it has made changes to the user's data file.
* Changed print report to use format_dateJohn Wiegley2009-02-131-1/+2
| | | | Otherwise, Ledger was unable to parse what it had printed.
* Added a new valexpr function: format_dateJohn Wiegley2009-02-131-0/+10
| | | | | | | | | This can be used to format dates with a specific pattern, such as: format_date(entry.date, "%Y/%m/%d") This is used by the print command to ensure that Ledger is able to parse back what it prints.
* Restored the "prices" command.John Wiegley2009-02-121-9/+13
|
* Turned on the "emacs" command and budgeting, though neither are tested yet.John Wiegley2009-02-121-2/+5
|
* Properly handle UTF-8 characters in commodity strings.John Wiegley2009-02-121-2/+3
|
* Rewrote the "entry" command. It's ALIVE!John Wiegley2009-02-111-6/+10
|
* Wired up the "entry" command from 2.x, though it still needs to be ported.John Wiegley2009-02-101-1/+18
|
* Wrote the beginnings of a new "stats" command.John Wiegley2009-02-101-0/+5
|
* Removed reference to session_t from the iterators module.John Wiegley2009-02-091-2/+2
|