Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/converter/mymoneystatementreader.cpp
Show First 20 Lines • Show All 552 Lines • ▼ Show 20 Line(s) | |||||
553 | { | 553 | { | ||
554 | MyMoneyFile* file = MyMoneyFile::instance(); | 554 | MyMoneyFile* file = MyMoneyFile::instance(); | ||
555 | QString currency = file->baseCurrency().id(); | 555 | QString currency = file->baseCurrency().id(); | ||
556 | QString security; | 556 | QString security; | ||
557 | 557 | | |||
558 | if (!p_in.m_strCurrency.isEmpty()) { | 558 | if (!p_in.m_strCurrency.isEmpty()) { | ||
559 | security = p_in.m_strSecurity; | 559 | security = p_in.m_strSecurity; | ||
560 | currency = p_in.m_strCurrency; | 560 | currency = p_in.m_strCurrency; | ||
561 | } else if (d->securitiesBySymbol.contains(p_in.m_strSecurity)) | 561 | } else if (d->securitiesBySymbol.contains(p_in.m_strSecurity)) { | ||
562 | security = d->securitiesBySymbol[p_in.m_strSecurity].id(); | 562 | security = d->securitiesBySymbol[p_in.m_strSecurity].id(); | ||
563 | else if (d->securitiesByName.contains(p_in.m_strSecurity)) | 563 | currency = file->security(file->security(security).tradingCurrency()).id(); | ||
564 | } else if (d->securitiesByName.contains(p_in.m_strSecurity)) { | ||||
564 | security = d->securitiesByName[p_in.m_strSecurity].id(); | 565 | security = d->securitiesByName[p_in.m_strSecurity].id(); | ||
565 | else | 566 | currency = file->security(file->security(security).tradingCurrency()).id(); | ||
567 | } else | ||||
566 | return; | 568 | return; | ||
567 | 569 | | |||
568 | MyMoneyPrice price(security, | 570 | MyMoneyPrice price(security, | ||
569 | currency, | 571 | currency, | ||
570 | p_in.m_date, | 572 | p_in.m_date, | ||
571 | p_in.m_amount, i18n("Prices Importer")); | 573 | p_in.m_amount, p_in.m_sourceName.isEmpty() ? i18n("Prices Importer") : p_in.m_sourceName); | ||
572 | MyMoneyFile::instance()->addPrice(price); | 574 | MyMoneyFile::instance()->addPrice(price); | ||
573 | } | 575 | } | ||
574 | 576 | | |||
575 | void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Security& sec_in) | 577 | void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Security& sec_in) | ||
576 | { | 578 | { | ||
577 | // For a security entry, we will just make sure the security exists in the | 579 | // For a security entry, we will just make sure the security exists in the | ||
578 | // file. It will not get added to the investment account until it's called | 580 | // file. It will not get added to the investment account until it's called | ||
579 | // for in a transaction. | 581 | // for in a transaction. | ||
▲ Show 20 Lines • Show All 954 Lines • Show Last 20 Lines |