diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-25 04:32:30 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-25 04:39:59 -0500 |
commit | 2c90c10db17a1e379639f2aa5e7c47fcb351d9f7 (patch) | |
tree | 136adb3762bfbc58f28667b74a9aa2eca4ae431a /src/quotes.cc | |
parent | a7424c1df9b565e77ff25fee46f8a79d2638f42c (diff) | |
download | fork-ledger-2c90c10db17a1e379639f2aa5e7c47fcb351d9f7.tar.gz fork-ledger-2c90c10db17a1e379639f2aa5e7c47fcb351d9f7.tar.bz2 fork-ledger-2c90c10db17a1e379639f2aa5e7c47fcb351d9f7.zip |
Added support for a "fixed" directive
It lets you specify a fixed cost for a duration of a ledger file, for
example:
fixed ecu $2
2008/01/01 income
assets:bank:checking 1 ecu
income:salary
end fixed
This is equivalent to:
2008/01/01 income
assets:bank:checking 1 ecu {=$2}
income:salary
Diffstat (limited to 'src/quotes.cc')
-rw-r--r-- | src/quotes.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quotes.cc b/src/quotes.cc index ffe2142a..f892e93f 100644 --- a/src/quotes.cc +++ b/src/quotes.cc @@ -75,7 +75,7 @@ commodity_quote_from_script(commodity_t& commodity, if (char * p = std::strchr(buf, '\n')) *p = '\0'; DEBUG("commodity.download", "downloaded quote: " << buf); - if (optional<price_point_t> point = + if (optional<std::pair<commodity_t *, price_point_t> > point = commodity_pool_t::current_pool->parse_price_directive(buf)) { if (commodity_pool_t::current_pool->price_db) { #if defined(__GNUG__) && __GNUG__ < 3 @@ -86,12 +86,12 @@ commodity_quote_from_script(commodity_t& commodity, std::ios_base::out | std::ios_base::app); #endif database << "P " - << format_datetime(point->when, FMT_WRITTEN) + << format_datetime(point->second.when, FMT_WRITTEN) << " " << commodity.symbol() - << " " << point->price + << " " << point->second.price << std::endl; } - return point; + return point->second; } } else { DEBUG("commodity.download", |