Commit 9c9270fd authored by Cristian Oneț's avatar Cristian Oneț
Browse files

BUG: 289363 - When duplicating a scheduled transaction make sure that we set a...

BUG: 289363 - When duplicating a scheduled transaction make sure that we set a valid next due date if the original next due date is invalid.
parent edece5d1
......@@ -4292,6 +4292,9 @@ void KMyMoneyApp::slotScheduleDuplicate(void)
sch.clearId();
sch.setLastPayment(QDate());
sch.setName(i18nc("Copy of scheduled transaction name", "Copy of %1", sch.name()));
// make sure that we set a valid next due date if the original next due date is invalid
if (!sch.nextDueDate().isValid())
sch.setNextDueDate(QDate::currentDate());
MyMoneyFileTransaction ft;
try {
......@@ -4303,7 +4306,7 @@ void KMyMoneyApp::slotScheduleDuplicate(void)
d->m_myMoneyView->slotScheduleSelected(sch.id());
} catch (MyMoneyException* e) {
KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to duplicate transaction(s): %1, thrown in %2:%3", e->what(), e->file(), e->line()));
KMessageBox::detailedSorry(0, i18n("Unable to duplicate scheduled transaction: '%1'", d->m_selectedSchedule.name()), e->what());
delete e;
}
}
......
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