Commit acf951af authored by Thomas Baumgart's avatar Thomas Baumgart
Browse files

Improve schedule information report

Don't show the splits twice and for a simple transaction only show one
line.

BUG: 395977
FIXED-IN: 5.0.7
parent a7a1d723
......@@ -212,6 +212,9 @@ void ObjectInfoTable::constructScheduleTable()
QList<MyMoneySplit> splits = transaction.splits();
QList<MyMoneySplit>::const_iterator split_it = splits.constBegin();
for (; split_it != splits.constEnd(); ++split_it) {
if ((*split_it).id() == split.id()) {
continue;
}
TableRow splitRow;
ReportAccount splitAcc((*split_it).accountId());
......@@ -240,9 +243,16 @@ void ObjectInfoTable::constructScheduleTable()
}
//add the split only if it matches the text or it matches the main split
if (m_config.match((*split_it))
|| transaction_text)
m_rows += splitRow;
if (m_config.match((*split_it)) || transaction_text) {
// only add separate rows when we have a split transaction
// otherwise, we simply copy the category to the
// already added row and go on
if (splits.count() > 2) {
m_rows += splitRow;
} else {
m_rows.last()[ctCategory] = splitRow [ctCategory];
}
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment