Skip to content
Snippets Groups Projects
Commit 96cd7b94 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#338 - invert "ignore" options --> dont use "not"

parent bb998e0d
No related branches found
No related tags found
No related merge requests found
......@@ -80,8 +80,8 @@ public class TemplateController extends BaseController
public String postNormal(@RequestParam(value = "templateName") String templateName,
@ModelAttribute("NewTransaction") Transaction transaction,
@RequestParam(value = "isPayment", required = false) boolean isPayment,
@RequestParam(value = "ignoreCategory") Boolean ignoreCategory,
@RequestParam(value = "ignoreAccount") Boolean ignoreAccount)
@RequestParam(value = "includeCategory") Boolean includeCategory,
@RequestParam(value = "includeAccount") Boolean includeAccount)
{
transactionService.handleAmount(transaction, isPayment);
transactionService.handleTags(transaction);
......@@ -91,7 +91,7 @@ public class TemplateController extends BaseController
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "templateName must not be empty");
}
templateService.createFromTransaction(templateName, transaction, ignoreCategory, ignoreAccount);
templateService.createFromTransaction(templateName, transaction, includeCategory, includeAccount);
return "redirect:/templates";
}
......
......@@ -43,15 +43,15 @@ public class TemplateService implements Resetable
{
}
public void createFromTransaction(String templateName, Transaction transaction, boolean ignoreCategory, boolean ignoreAccount)
public void createFromTransaction(String templateName, Transaction transaction, boolean includeCategory, boolean includeAccount)
{
final Template template = new Template(templateName, transaction);
if(ignoreCategory)
if(!includeCategory)
{
template.setCategory(null);
}
if(ignoreAccount)
if(!includeAccount)
{
template.setAccount(null);
}
......
......@@ -246,8 +246,8 @@ search.in.description=Beschreibung
search.in.category=Kategorie
search.in.tags=Tags
template.checkbox.ignore.category=Kategorie nicht übernehmen
template.checkbox.ignore.account=Konto nicht übernehmen
template.checkbox.include.category=Kategorie übernehmen
template.checkbox.include.account=Konto übernehmen
# ABOUT
about=Über {0}
......
......@@ -246,8 +246,8 @@ search.in.description=Description
search.in.category=Category
search.in.tags=Tags
template.checkbox.ignore.category=Omit selected category
template.checkbox.ignore.account=Omit selected account
template.checkbox.include.category=Include category
template.checkbox.include.account=Include account
# ABOUT
about=About {0}
......
......@@ -67,8 +67,8 @@ function saveAsTemplate()
let form = document.getElementsByName('NewTransaction')[0];
form.appendChild(createAdditionalHiddenInput('templateName', templateName));
form.appendChild(createAdditionalHiddenInput('ignoreCategory', document.getElementById('ignore-category').checked));
form.appendChild(createAdditionalHiddenInput('ignoreAccount', document.getElementById('ignore-account').checked));
form.appendChild(createAdditionalHiddenInput('includeCategory', document.getElementById('include-category').checked));
form.appendChild(createAdditionalHiddenInput('includeAccount', document.getElementById('include-account').checked));
// replace form target url
form.action = $('#buttonCreateTemplate').attr('data-url');
......
......@@ -12,14 +12,14 @@
</div>
<div class="col s12">
<label>
<input id="ignore-category" type="checkbox">
<span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.ignore.category')}</span>
<input id="include-category" type="checkbox" checked="checked">
<span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.include.category')}</span>
</label>
</div>
<div class="col s12">
<label>
<input id="ignore-account" type="checkbox" checked="checked">
<span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.ignore.account')}</span>
<input id="include-account" type="checkbox">
<span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.include.account')}</span>
</label>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment