Honour date-format for lot dates

Fixes bug #383
This commit is contained in:
Martin Michlmayr 2014-05-13 00:03:39 -04:00
parent e367cfd895
commit 0c9e188cfb
7 changed files with 35 additions and 6 deletions

View file

@ -206,7 +206,7 @@ void annotation_t::print(std::ostream& out, bool keep_base,
if (date &&
(! no_computed_annotations || ! has_flags(ANNOTATION_DATE_CALCULATED)))
out << " [" << format_date(*date, FMT_WRITTEN) << ']';
out << " [" << format_date(*date, FMT_PRINTED) << ']';
if (tag &&
(! no_computed_annotations || ! has_flags(ANNOTATION_TAG_CALCULATED)))

View file

@ -46,7 +46,7 @@ test equity --lot-prices
Equity:Opening Balances 3.80 GBP
end test
test equity --lots
test equity --lots --date-format %Y/%m/%d
2011/03/05 Opening Balances
Assets:Bank -3.80 GBP
Assets:Broker 2 AAA {0.90 GBP} [2011/03/04]

View file

@ -549,7 +549,7 @@ D 1.00G
Assets:Tajer:Items "Orb of Deception" 1 @ 155G
Assets:Tajer
test reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lot-dates
test reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lot-dates --date-format %Y/%m/%d
133.98G
158.85G
0

View file

@ -5,7 +5,7 @@ D 1.0000s
Assets:Gruulmorg 248720c @ 10.051463493s
Equity:Gold -5000000s
test reg --format '%(justify(scrub(total_expr), 40, 40, true))\n' --lots
test reg --format '%(justify(scrub(total_expr), 40, 40, true))\n' --lots --date-format %Y/%m/%d
1339829c {1.86590975416s} [2006/03/14]
1339829c {1.86590975416s} [2006/03/14]
248720c {10.051463493s} [2006/03/14]

View file

@ -549,7 +549,7 @@ D 1.00G
Assets:Tajer:Items "Orb of Deception" 1 @ 155G
Assets:Tajer
test reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lots
test reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lots --date-format %Y/%m/%d
133.98G
158.85G
0

View file

@ -3,6 +3,6 @@
Income:Dividends:Vanguard:VMMXX $-0.35
test reg --register-format='%(amount)\n'
0.350 VMMXX {$1.00} [2007/02/02]
0.350 VMMXX {$1.00} [07-Feb-02]
$-0.35
end test

29
test/regress/383.test Normal file
View file

@ -0,0 +1,29 @@
--input-date-format %Y:%m:%d
D 1000.00 GBP
2014:05:12 * Test
Assets:Investments 100 AA {2.00 GBP} [2014:01:01] @@ 200.00 GBP
Equity:Opening balance
test bal Assets:Investments --lots --date-format %Y.%m.%d
100 AA {2.00 GBP} [2014.01.01] Assets:Investments
end test
test bal Assets:Investments --lots --date-format %Y/%m/%d
100 AA {2.00 GBP} [2014/01/01] Assets:Investments
end test
test bal Assets:Investments --lots --date-format %Y:%m:%d
100 AA {2.00 GBP} [2014:01:01] Assets:Investments
end test
test bal Assets:Investments --lots --date-format %Y-%m-%d
100 AA {2.00 GBP} [2014-01-01] Assets:Investments
end test
test bal Assets:Investments --lots --date-format %g-%b-%d
100 AA {2.00 GBP} [14-Jan-01] Assets:Investments
end test