diff options
author | John Wiegley <johnw@newartisans.com> | 2005-05-27 03:47:53 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:10 -0400 |
commit | 65bfc5756cbc18b411f5999e373d500cef976cdd (patch) | |
tree | 8244f9989237049df15a62b927ae236502f11814 | |
parent | e42c5c794f95386d749b3852f2ac6b87984e3962 (diff) | |
download | fork-ledger-65bfc5756cbc18b411f5999e373d500cef976cdd.tar.gz fork-ledger-65bfc5756cbc18b411f5999e373d500cef976cdd.tar.bz2 fork-ledger-65bfc5756cbc18b411f5999e373d500cef976cdd.zip |
(qif_parser_t::parse): Propogate commodity flags when parsing amounts
from a QIF file.
-rw-r--r-- | qif.cc | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -92,15 +92,25 @@ unsigned int qif_parser_t::parse(std::istream& in, break; case 'T': - case '$': + case '$': { in >> line; xact->amount.parse(line); + + unsigned long flags = xact->amount.commodity().flags; + unsigned short prec = xact->amount.commodity().precision; + if (! def_commodity) def_commodity = commodity_t::find_commodity("$", true); xact->amount.set_commodity(*def_commodity); + + def_commodity->flags |= flags; + if (prec > def_commodity->precision) + def_commodity->precision = prec; + if (c == '$') xact->amount.negate(); break; + } case 'C': if (in.peek() == '*') { |