Bug 799592 - "No transactions found" when importing CSV transactions

Before this when changing the base account to one with a new currency
the new currency was added to the old base account's currency in the
alternate currencies vector instead of replacing it.

To avoid that re-parse the the splits from scratch when replacing the
base account.
pull/2080/head
John Ralls 1 year ago
parent 940085a017
commit 1e6b5a1095

@ -182,6 +182,7 @@ void GncTxImport::base_account (Account* base_account)
return;
}
auto base_account_is_new = m_settings.m_base_account == nullptr;
m_settings.m_base_account = base_account;
if (m_settings.m_base_account)
@ -192,10 +193,17 @@ void GncTxImport::base_account (Account* base_account)
set_column_type(col_type_it - m_settings.m_column_types.begin(),
GncTransPropType::NONE);
/* Set default account for each line's split properties */
for (auto line : m_parsed_lines)
std::get<PL_PRESPLIT>(line)->set_account (m_settings.m_base_account);
if (base_account_is_new)
{
/* Set default account for each line's split properties */
for (auto line : m_parsed_lines)
std::get<PL_PRESPLIT>(line)->set_account (m_settings.m_base_account);
}
else
{
/* Reparse all of the lines with the new base account's commodity. */
tokenize(false);
}
}
}

Loading…
Cancel
Save