gnc-import-tx.cpp (gnucash-5.0.tar.bz2) | : | gnc-import-tx.cpp (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 808 | skipping to change at line 808 | |||
{ | { | |||
/* All amount columns may appear more than once. The net amount | /* All amount columns may appear more than once. The net amount | |||
* needs to be recalculated rather than just reset if one column | * needs to be recalculated rather than just reset if one column | |||
* is unset. */ | * is unset. */ | |||
for (auto col_it = m_settings.m_column_types.cbegin(); | for (auto col_it = m_settings.m_column_types.cbegin(); | |||
col_it < m_settings.m_column_types.cend(); | col_it < m_settings.m_column_types.cend(); | |||
col_it++) | col_it++) | |||
if (*col_it == old_type) | if (*col_it == old_type) | |||
{ | { | |||
auto col_num = col_it - m_settings.m_column_types.cbegin(); | auto value = std::string(); | |||
auto value = std::get<PL_INPUT>(m_parsed_lines[row]).at(col_ | auto col_num = static_cast<uint32_t>(col_it - m_settings.m_c | |||
num); | olumn_types.cbegin()); | |||
if (col_num < std::get<PL_INPUT>(m_parsed_lines[row]).size() | ||||
) | ||||
value = std::get<PL_INPUT>(m_parsed_lines[row]).at(col_n | ||||
um); | ||||
split_props->add (old_type, value); | split_props->add (old_type, value); | |||
} | } | |||
} | } | |||
} | } | |||
if ((new_type > GncTransPropType::TRANS_PROPS) && (new_type <= GncTransPropT ype::SPLIT_PROPS)) | if ((new_type > GncTransPropType::TRANS_PROPS) && (new_type <= GncTransPropT ype::SPLIT_PROPS)) | |||
{ | { | |||
/* All amount columns may appear more than once. The net amount | /* All amount columns may appear more than once. The net amount | |||
* needs to be recalculated rather than just reset if one column | * needs to be recalculated rather than just reset if one column | |||
* is set. */ | * is set. */ | |||
if (is_multi_col_prop(new_type)) | if (is_multi_col_prop(new_type)) | |||
{ | { | |||
split_props->reset(new_type); | split_props->reset(new_type); | |||
/* For Deposits and Withdrawal we have to sum all columns with this property */ | /* For Deposits and Withdrawal we have to sum all columns with this property */ | |||
for (auto col_it = m_settings.m_column_types.cbegin(); | for (auto col_it = m_settings.m_column_types.cbegin(); | |||
col_it < m_settings.m_column_types.cend(); | col_it < m_settings.m_column_types.cend(); | |||
col_it++) | col_it++) | |||
if (*col_it == new_type) | if (*col_it == new_type) | |||
{ | { | |||
auto col_num = col_it - m_settings.m_column_types.cbegin(); | auto value = std::string(); | |||
auto value = std::get<PL_INPUT>(m_parsed_lines[row]).at(col_ | auto col_num = static_cast<uint32_t>(col_it - m_settings.m_c | |||
num); | olumn_types.cbegin()); | |||
if (col_num < std::get<PL_INPUT>(m_parsed_lines[row]).size() | ||||
) | ||||
value = std::get<PL_INPUT>(m_parsed_lines[row]).at(col_n | ||||
um); | ||||
split_props->add (new_type, value); | split_props->add (new_type, value); | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
auto value = std::get<PL_INPUT>(m_parsed_lines[row]).at(col); | auto value = std::string(); | |||
if (col < std::get<PL_INPUT>(m_parsed_lines[row]).size()) | ||||
value = std::get<PL_INPUT>(m_parsed_lines[row]).at(col); | ||||
split_props->set(new_type, value); | split_props->set(new_type, value); | |||
} | } | |||
} | } | |||
m_multi_currency |= split_props->get_pre_trans()->is_multi_currency(); | m_multi_currency |= split_props->get_pre_trans()->is_multi_currency(); | |||
} | } | |||
void | void | |||
GncTxImport::set_column_type (uint32_t position, GncTransPropType type, bool for ce) | GncTxImport::set_column_type (uint32_t position, GncTransPropType type, bool for ce) | |||
{ | { | |||
if (position >= m_settings.m_column_types.size()) | if (position >= m_settings.m_column_types.size()) | |||
End of changes. 3 change blocks. | ||||
7 lines changed or deleted | 19 lines changed or added |