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

All splits in a scheduled transaction reference the same payee

BUG: 438328
FIXED-IN: 5.1.2

note: no need to cherry-pick to master as master will eventually allow
to modify the payee on a split basis.
parent 366ef68d
Pipeline #64947 passed with stage
in 7 minutes and 57 seconds
......@@ -196,6 +196,17 @@ public:
m_editor->createTransaction(t, m_schedule.transaction(), m_schedule.transaction().splits().isEmpty() ? MyMoneySplit() : m_schedule.transaction().splits().front(), false);
}
// make sure all splits in the scheduled transaction
// reference the same payee
if (t.splitCount() > 1) {
const auto payeeId = t.splits().first().payeeId();
for (auto split : t.splits()) {
if (split.payeeId() != payeeId) {
split.setPayeeId(payeeId);
t.modifySplit(split);
}
}
}
t.clearId();
t.setEntryDate(QDate());
return t;
......
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