diff options
-rw-r--r-- | config.cc | 2 | ||||
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | format.cc | 2 | ||||
-rw-r--r-- | main.cc | 6 |
4 files changed, 9 insertions, 2 deletions
@@ -44,6 +44,7 @@ config_t::config_t() prices_format = ("%[%Y/%m/%d %H:%M:%S %Z] %-8A " "%10t %10(@vmin(t)) %10(@vmax(t)) %12T\n"); #endif + pricesdb_format = "P %[%Y/%m/%d %H:%M:%S] %A %t\n"; show_collapsed = false; show_subtotal = false; @@ -981,6 +982,7 @@ void export_config() .def_readwrite("write_xact_format", &config_t::write_xact_format) .def_readwrite("equity_format", &config_t::equity_format) .def_readwrite("prices_format", &config_t::prices_format) + .def_readwrite("pricesdb_format", &config_t::pricesdb_format) .def_readwrite("date_format", &config_t::date_format) .def_readwrite("sort_string", &config_t::sort_string) .def_readwrite("amount_expr", &config_t::amount_expr) @@ -40,6 +40,7 @@ struct config_t std::string write_xact_format; std::string equity_format; std::string prices_format; + std::string pricesdb_format; std::string date_format; std::string sort_string; std::string amount_expr; @@ -329,7 +329,7 @@ void format_t::format(std::ostream& out_str, const details_t& details) const break; case element_t::SOURCE: - if (details.entry) { + if (details.entry && details.entry->journal) { int idx = details.entry->src_idx; for (strings_list::iterator i = details.entry->journal->sources.begin(); i != details.entry->journal->sources.end(); @@ -248,6 +248,8 @@ int parse_and_report(int argc, char * argv[], char * envp[]) command = "E"; else if (command == "prices") command = "P"; + else if (command == "pricesdb") + command = "D"; else if (command == "reconcile") command = "R"; else @@ -317,6 +319,8 @@ int parse_and_report(int argc, char * argv[], char * envp[]) format = &config.equity_format; else if (command == "P") format = &config.prices_format; + else if (command == "D") + format = &config.pricesdb_format; else if (command == "w") format = &config.write_xact_format; else @@ -368,7 +372,7 @@ def vmax(d, val):\n\ if (command == "e") walk_transactions(new_entry->transactions, *formatter); - else if (command == "P") + else if (command == "P" || command == "D") walk_commodities(commodity_t::commodities, *formatter); else if (command == "R") reconcile_account(*journal, *journal->master, value_t(long(0))); |