summaryrefslogtreecommitdiffstats
path: root/kmymoney2/converter/mymoneystatementreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/converter/mymoneystatementreader.cpp')
-rw-r--r--kmymoney2/converter/mymoneystatementreader.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/kmymoney2/converter/mymoneystatementreader.cpp b/kmymoney2/converter/mymoneystatementreader.cpp
index 6756767..c08dcff 100644
--- a/kmymoney2/converter/mymoneystatementreader.cpp
+++ b/kmymoney2/converter/mymoneystatementreader.cpp
@@ -664,6 +664,10 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
if(!t_in.m_price.isZero()) {
s1.setPrice(t_in.m_price);
} else {
+ if(t_in.m_shares.isZero()) {
+ KMessageBox::information(0, i18n("This imported statement contains investment transactions with no share amount. These transactions will be ignored."), i18n("No share amount provided"), TQString("BlankAmount"));
+ return;
+ }
s1.setPrice(((t_in.m_amount - t_in.m_fees) / t_in.m_shares).convert(MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision())));
}