diff --git a/src/main/java/de/deadlocker8/budgetmaster/templates/TemplateController.java b/src/main/java/de/deadlocker8/budgetmaster/templates/TemplateController.java index e4749937537862d81f7c26432595c8307b769df9..a29f6371bde15cf45837290a18f07897a3a7a4f4 100644 --- a/src/main/java/de/deadlocker8/budgetmaster/templates/TemplateController.java +++ b/src/main/java/de/deadlocker8/budgetmaster/templates/TemplateController.java @@ -125,6 +125,11 @@ public class TemplateController extends BaseController } final Template template = templateOptional.get(); + + // set ID to null, otherwise the transaction form is prefilled with the template ID and saving the transaction + // may then override an existing transactions if the ID is also already used in transactions table + template.setID(null); + templateService.prepareTemplateForNewTransaction(template, true); boolean isPayment = true;