Bugfix Signature Path

master
Markus Kreth 3 years ago
parent b7cda146c2
commit 463b897df7
  1. 49
      .classpath
  2. 6
      .idea/workspace.xml
  3. 28
      .project
  4. 9
      .settings/org.eclipse.core.resources.prefs
  5. 5
      .settings/org.eclipse.jdt.apt.core.prefs
  6. 17
      .settings/org.eclipse.jdt.core.prefs
  7. 34
      pom.xml
  8. 3
      src/main/java/META-INF/MANIFEST.MF
  9. 324
      src/main/java/de/kreth/invoice/Localization_Properties.java
  10. 56
      src/main/java/de/kreth/invoice/Version_Properties.java
  11. 1
      src/main/java/de/kreth/invoice/business/ArticleBusiness.java
  12. 136
      src/main/java/de/kreth/invoice/report/InvoiceReportSource.java
  13. 2
      src/main/java/de/kreth/invoice/views/FooterComponent.java
  14. 6
      src/main/java/de/kreth/invoice/views/View.java
  15. 6
      src/main/java/de/kreth/invoice/views/article/ArticleDialog.java
  16. 13
      src/main/java/de/kreth/invoice/views/invoice/InvoiceDialog.java
  17. 13
      src/main/java/de/kreth/invoice/views/invoiceitem/InvoiceItemGrid.java
  18. 15
      src/main/java/de/kreth/invoice/views/invoiceitem/InvoiceItemOverviewComponent.java
  19. 14
      src/main/java/de/kreth/invoice/views/invoiceitem/InvoiceOverviewComponent.java
  20. 6
      src/main/resources/localization.properties

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/packaging">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PackageJsonUpdateNotifier">
<dismissed value="$PROJECT_DIR$/package.json" />
</component>
</project>

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>trainerinvoice</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

@ -1,9 +0,0 @@
eclipse.preferences.version=1
encoding//src/main/generated=UTF-8
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/main/resources/reports/mtv_gross_buchholz.jrxml=UTF-8
encoding//src/main/resources/reports/mtv_gross_buchholz_trainer.jrxml=UTF-8
encoding//src/packaging=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

@ -1,5 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations
org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests
org.eclipse.jdt.apt.reconcileEnabled=true

@ -1,17 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11

@ -187,12 +187,6 @@
<artifactId>jasperreports</artifactId> <artifactId>jasperreports</artifactId>
<version>6.19.1</version> <version>6.19.1</version>
</dependency> </dependency>
<!-- <dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.3</version>
</dependency>
-->
<dependency> <dependency>
<groupId>com.lowagie</groupId> <groupId>com.lowagie</groupId>
<artifactId>itext</artifactId> <artifactId>itext</artifactId>
@ -203,6 +197,11 @@
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<dependency>
<groupId>de.kreth.property2java</groupId>
<artifactId>PropertyToJavaGenerator</artifactId>
<version>2.0.1-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -217,25 +216,14 @@
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<!--
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<executions> <configuration>
<execution> <release>${java.version}</release>
<phase>generate-sources</phase> <showWarnings>true</showWarnings>
<goals> </configuration>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin> </plugin>
-->
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

@ -1,324 +0,0 @@
package de.kreth.invoice;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.function.UnaryOperator;
import javax.annotation.processing.Generated;
/**
* Property keys from localization.properties
*/
@Generated(date = "22.05.2022, 19:41:47", value = "de.kreth.property2java.Generator")
public enum Localization_Properties {
/**
* caption.invoiceitem.date = "Datum"
*/
CAPTION_INVOICEITEM_DATE ("caption.invoiceitem.date"),
/**
* caption.user.login = "Anmelden"
*/
CAPTION_USER_LOGIN ("caption.user.login"),
/**
* error.invoice.title.noitems = "Leere Abrechnung nicht erlaubt."
*/
ERROR_INVOICE_TITLE_NOITEMS ("error.invoice.title.noitems"),
/**
* caption.invoice.sum = "Summe"
*/
CAPTION_INVOICE_SUM ("caption.invoice.sum"),
/**
* caption.invoiceitem.participants = "Teilnehmer"
*/
CAPTION_INVOICEITEM_PARTICIPANTS ("caption.invoiceitem.participants"),
/**
* caption.invoiceitem.add = "Neuer Posten"
*/
CAPTION_INVOICEITEM_ADD ("caption.invoiceitem.add"),
/**
* caption.invoice.pattern = "Rechnung-{0}"
*/
CAPTION_INVOICE_PATTERN ("caption.invoice.pattern"),
/**
* caption.invoiceitem.start = "Beginn"
*/
CAPTION_INVOICEITEM_START ("caption.invoiceitem.start"),
/**
* caption.article.report = "Mit Trainer-Lizenz"
*/
CAPTION_ARTICLE_REPORT ("caption.article.report"),
/**
* caption.invoice.invoiceno = "Rechnungsnummer"
*/
CAPTION_INVOICE_INVOICENO ("caption.invoice.invoiceno"),
/**
* caption.invoiceitems = "Rechnungspositionen"
*/
CAPTION_INVOICEITEMS ("caption.invoiceitems"),
/**
* message.user.passwordmissmatch = "Passworter stimmen nicht überein!"
*/
MESSAGE_USER_PASSWORDMISSMATCH ("message.user.passwordmissmatch"),
/**
* label.delete = "Löschen"
*/
LABEL_DELETE ("label.delete"),
/**
* message.user.loginfailure = "Anmeldefehler! Falscher Name oder Passwort?"
*/
MESSAGE_USER_LOGINFAILURE ("message.user.loginfailure"),
/**
* caption.article.type.trainer = "Trainer"
*/
CAPTION_ARTICLE_TYPE_TRAINER ("caption.article.type.trainer"),
/**
* caption.invoiceitem.sumprice = "Betrag"
*/
CAPTION_INVOICEITEM_SUMPRICE ("caption.invoiceitem.sumprice"),
/**
* message.delete.text = "Soll {0} wirklich gelöscht werden?"
*/
MESSAGE_DELETE_TEXT ("message.delete.text"),
/**
* label.user.register = "Registrieren"
*/
LABEL_USER_REGISTER ("label.user.register"),
/**
* error.userdetails.bankname_empty = "Bankname darf nicht leer sein."
*/
ERROR_USERDETAILS_BANKNAME_EMPTY ("error.userdetails.bankname_empty"),
/**
* label.ok = "OK"
*/
LABEL_OK ("label.ok"),
/**
* label.open = "Öffnen"
*/
LABEL_OPEN ("label.open"),
/**
* label.discart = "Verwerfen"
*/
LABEL_DISCART ("label.discart"),
/**
* caption.article = "Artikel"
*/
CAPTION_ARTICLE ("caption.article"),
/**
* message.article.priceerror = "Bitte legen Sie den Preis fest."
*/
MESSAGE_ARTICLE_PRICEERROR ("message.article.priceerror"),
/**
* error.userdetails.iban_empty = "Iban darf nicht leer sein."
*/
ERROR_USERDETAILS_IBAN_EMPTY ("error.userdetails.iban_empty"),
/**
* message.user.create.success = "{0} erstellt!"
*/
MESSAGE_USER_CREATE_SUCCESS ("message.user.create.success"),
/**
* error.userdetails.prename_empty = "Vorname darf nicht leer sein."
*/
ERROR_USERDETAILS_PRENAME_EMPTY ("error.userdetails.prename_empty"),
/**
* error.invoice.text.noitems = "Bitte Posten für Rechnung auswählen."
*/
ERROR_INVOICE_TEXT_NOITEMS ("error.invoice.text.noitems"),
/**
* caption.invoiceitem.end = "Ende"
*/
CAPTION_INVOICEITEM_END ("caption.invoiceitem.end"),
/**
* caption.invoiceitem = ""
*/
CAPTION_INVOICEITEM ("caption.invoiceitem"),
/**
* caption.adress.zipcode = "Postleitzahl"
*/
CAPTION_ADRESS_ZIPCODE ("caption.adress.zipcode"),
/**
* caption.user.password = "Ihr Password:"
*/
CAPTION_USER_PASSWORD ("caption.user.password"),
/**
* caption.invoiceitem.name = "Rechnungsposition"
*/
CAPTION_INVOICEITEM_NAME ("caption.invoiceitem.name"),
/**
* message.delete.title = "Wirklich löschen?"
*/
MESSAGE_DELETE_TITLE ("message.delete.title"),
/**
* error.userdetails.zip_empty = "Postleitzahl darf nicht leer sein."
*/
ERROR_USERDETAILS_ZIP_EMPTY ("error.userdetails.zip_empty"),
/**
* message.invoiceitem.allfieldsmustbeset = "Start, Ende und Artikel müssen gesetzt sein!"
*/
MESSAGE_INVOICEITEM_ALLFIELDSMUSTBESET ("message.invoiceitem.allfieldsmustbeset"),
/**
* caption.invoices = "Rechnungen"
*/
CAPTION_INVOICES ("caption.invoices"),
/**
* caption.user.passwordconfirmation = "Password bestätigen:"
*/
CAPTION_USER_PASSWORDCONFIRMATION ("caption.user.passwordconfirmation"),
/**
* caption.adress.city = "Ort"
*/
CAPTION_ADRESS_CITY ("caption.adress.city"),
/**
* caption.invoice.printsignature = "Unterschrift drucken"
*/
CAPTION_INVOICE_PRINTSIGNATURE ("caption.invoice.printsignature"),
/**
* caption.article.title = "Titel"
*/
CAPTION_ARTICLE_TITLE ("caption.article.title"),
/**
* caption.article.price = "Stundenpreis"
*/
CAPTION_ARTICLE_PRICE ("caption.article.price"),
/**
* error.userdetails.adress_empty = "Adresse darf nicht leer sein."
*/
ERROR_USERDETAILS_ADRESS_EMPTY ("error.userdetails.adress_empty"),
/**
* caption.bank.iban = "IBAN"
*/
CAPTION_BANK_IBAN ("caption.bank.iban"),
/**
* caption.invoice.create = "Rechnung erstellen"
*/
CAPTION_INVOICE_CREATE ("caption.invoice.create"),
/**
* error.article.undefined = "Bitte Artikel anlegen."
*/
ERROR_ARTICLE_UNDEFINED ("error.article.undefined"),
/**
* caption.bank.bic = "BIC"
*/
CAPTION_BANK_BIC ("caption.bank.bic"),
/**
* caption.article.type.assistant = "Übungsleiter"
*/
CAPTION_ARTICLE_TYPE_ASSISTANT ("caption.article.type.assistant"),
/**
* error.userdetails.city_empty = "Ort darf nicht leer sein."
*/
ERROR_USERDETAILS_CITY_EMPTY ("error.userdetails.city_empty"),
/**
* label.cancel = "Abbrechen"
*/
LABEL_CANCEL ("label.cancel"),
/**
* message.user.create.failure = "Fehler beim Erstellen von Benutzer {0}! Ändern Sie den Benutzernamen oder fragen Sie nach dem Passwort. Detail: {1}"
*/
MESSAGE_USER_CREATE_FAILURE ("message.user.create.failure"),
/**
* caption.article.description = "Beschreibung"
*/
CAPTION_ARTICLE_DESCRIPTION ("caption.article.description"),
/**
* caption.user.loginname = "Anmeldename:"
*/
CAPTION_USER_LOGINNAME ("caption.user.loginname"),
/**
* message.article.error.invoiceexists = "Kann nicht geändert werden, da bereits Rechnungen bestehen. Bitte neuen Artikel anlegen."
*/
MESSAGE_ARTICLE_ERROR_INVOICEEXISTS ("message.article.error.invoiceexists"),
/**
* error.userdetails.surname_empty = "Nachname darf nicht leer sein."
*/
ERROR_USERDETAILS_SURNAME_EMPTY ("error.userdetails.surname_empty"),
/**
* label.close = "Schließen"
*/
LABEL_CLOSE ("label.close"),
/**
* caption.adress.street2 = "Adresse"
*/
CAPTION_ADRESS_STREET2 ("caption.adress.street2"),
/**
* caption.adress.street1 = "Adresse"
*/
CAPTION_ADRESS_STREET1 ("caption.adress.street1"),
/**
* caption.user.surname = "Nachname:"
*/
CAPTION_USER_SURNAME ("caption.user.surname"),
/**
* label.loggedin = "Angemeldet:"
*/
LABEL_LOGGEDIN ("label.loggedin"),
/**
* label.logout = "Abmelden"
*/
LABEL_LOGOUT ("label.logout"),
/**
* caption.user.prename = "Vorname:"
*/
CAPTION_USER_PRENAME ("caption.user.prename"),
/**
* caption.bank.name = "Bankname"
*/
CAPTION_BANK_NAME ("caption.bank.name"),
/**
* label.addarticle = "Neuer Artikel"
*/
LABEL_ADDARTICLE ("label.addarticle"),
/**
* label.preview = "Vorschau"
*/
LABEL_PREVIEW ("label.preview"),
/**
* message.invoiceitem.startbeforeend = "Ende darf nicht vor Start liegen."
*/
MESSAGE_INVOICEITEM_STARTBEFOREEND ("message.invoiceitem.startbeforeend"),
/**
* caption.articles = "Artikel"
*/
CAPTION_ARTICLES ("caption.articles"),
/**
* caption.invoice.invoicedate = "Rechnungsdatum"
*/
CAPTION_INVOICE_INVOICEDATE ("caption.invoice.invoicedate"),
/**
* caption.user.details = "Benutzer Details"
*/
CAPTION_USER_DETAILS ("caption.user.details"),
/**
* error.userdetails.username_empty = "Anmeldename darf nicht leer sein."
*/
ERROR_USERDETAILS_USERNAME_EMPTY ("error.userdetails.username_empty"),
/**
* label.store = "Speichern"
*/
LABEL_STORE ("label.store");
private final String value;
private Localization_Properties (String value) {
this.value = value;
}
/**
* Represented Key in property File.
* @return key
*/
public String getValue() {
return value;
}
/**
* Resolves the value for this key from the parameter function.
* <p>
* e.g. <code>Localization_Properties.getString(resBundle::getString)</code>
* @param resourceFunction {@link Properties#getProperty(String)} or {@link ResourceBundle#getString(String)}
* @return
*/
public String getString(UnaryOperator<String> resourceFunction) {
return resourceFunction.apply(value);
}
}

@ -1,56 +0,0 @@
package de.kreth.invoice;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.function.UnaryOperator;
import javax.annotation.processing.Generated;
/**
* Property keys from version.properties
*/
@Generated(date = "29.05.2022, 21:56:35", value = "de.kreth.property2java.Generator")
public enum Version_Properties {
/**
* project.version = "${project.version}"
*/
PROJECT_VERSION ("project.version"),
/**
* package_name = "${project.artifactId}-${project.version}.${project.packaging}"
*/
PACKAGE_NAME ("package_name"),
/**
* build.dateTime = "${timestamp}"
*/
BUILD_DATETIME ("build.dateTime"),
/**
* project.artifactId = "${project.artifactId}"
*/
PROJECT_ARTIFACTID ("project.artifactId");
private final String value;
private Version_Properties (String value) {
this.value = value;
}
/**
* Represented Key in property File.
* @return key
*/
public String getValue() {
return value;
}
/**
* Resolves the value for this key from the parameter function.
* <p>
* e.g. <code>Version_Properties.getString(resBundle::getString)</code>
* @param resourceFunction {@link Properties#getProperty(String)} or {@link ResourceBundle#getString(String)}
* @return
*/
public String getString(UnaryOperator<String> resourceFunction) {
return resourceFunction.apply(value);
}
}

@ -28,6 +28,7 @@ public class ArticleBusiness extends AbstractBusiness<Article> {
} }
public List<Article> findByUserId(Long id) { public List<Article> findByUserId(Long id) {
return articleRepository.findByUserId(id); return articleRepository.findByUserId(id);
} }

@ -99,77 +99,77 @@ public class InvoiceReportSource implements JRDataSource, JRDataSourceProvider {
@Override @Override
public Object getFieldValue(JRField jrField) throws JRException { public Object getFieldValue(JRField jrField) throws JRException {
switch (jrField.getName()) { switch (jrField.getName()) {
case FIELD_INVOICE_NO: case FIELD_INVOICE_NO:
return invoice.getInvoiceId(); return invoice.getInvoiceId();
case FIELD_INVOICE_DATE: case FIELD_INVOICE_DATE:
return invoice.getInvoiceDate(); return invoice.getInvoiceDate();
case FIELD_INVOICE_SUM: case FIELD_INVOICE_SUM:
return invoice.getSum(); return invoice.getSum();
case FIELD_USER_PRENAME: case FIELD_USER_PRENAME:
return invoice.getUser().getGivenName(); return invoice.getUser().getGivenName();
case FIELD_USER_SURNAME: case FIELD_USER_SURNAME:
return invoice.getUser().getFamilyName(); return invoice.getUser().getFamilyName();
case FIELD_BANK_NAME: case FIELD_BANK_NAME:
return invoice.getUser().getBank().getBankName(); return invoice.getUser().getBank().getBankName();
case FIELD_BANK_IBAN: case FIELD_BANK_IBAN:
return invoice.getUser().getBank().getIban(); return invoice.getUser().getBank().getIban();
case FIELD_BANK_BIC: case FIELD_BANK_BIC:
return invoice.getUser().getBank().getBic(); return invoice.getUser().getBank().getBic();
case FIELD_USER_ADRESS1: case FIELD_USER_ADRESS1:
return invoice.getUser().getAdress().getAdress1(); return invoice.getUser().getAdress().getAdress1();
case FIELD_USER_ADRESS2: case FIELD_USER_ADRESS2:
return invoice.getUser().getAdress().getAdress2(); return invoice.getUser().getAdress().getAdress2();
case FIELD_USER_ZIP: case FIELD_USER_ZIP:
return invoice.getUser().getAdress().getZip(); return invoice.getUser().getAdress().getZip();
case FIELD_USER_CITY: case FIELD_USER_CITY:
return invoice.getUser().getAdress().getCity(); return invoice.getUser().getAdress().getCity();
case FIELD_SIGNATURE_PATH: case FIELD_SIGNATURE_PATH:
return invoice.getSignImagePath(); return determineImagePath();
default: default:
break; break;
} }
if (currentItem != null) { if (currentItem != null) {
switch (jrField.getName()) { switch (jrField.getName()) {
case FIELD_ARTICLE_TITLE: case FIELD_ARTICLE_TITLE:
return currentItem.getTitle(); return currentItem.getTitle();
case FIELD_ARTICLE_DESCRIPTION: case FIELD_ARTICLE_DESCRIPTION:
return currentItem.getDescription(); return currentItem.getDescription();
case FIELD_ARTICLE_PRICE_PER_HOUR: case FIELD_ARTICLE_PRICE_PER_HOUR:
return currentItem.getPricePerHour(); return currentItem.getPricePerHour();
case FIELD_ITEM_START: case FIELD_ITEM_START:
return currentItem.getStart(); return currentItem.getStart();
case FIELD_ITEM_END: case FIELD_ITEM_END:
return currentItem.getEnd(); return currentItem.getEnd();
case FIELD_ITEM_DURATION_MINUTES: case FIELD_ITEM_DURATION_MINUTES:
return currentItem.getDurationInMinutes(); return currentItem.getDurationInMinutes();
case FIELD_ITEM_SUM: case FIELD_ITEM_SUM:
return currentItem.getSumPrice(); return currentItem.getSumPrice();
case FIELD_ITEM_PARTICIPANTS: case FIELD_ITEM_PARTICIPANTS:
return currentItem.getParticipants(); return currentItem.getParticipants();
case FIELD_ITEM_SPORTART: case FIELD_ITEM_SPORTART:
return currentItem.getSportArt() != null ? currentItem.getSportArt().getName() : "Trampolin"; return currentItem.getSportArt() != null ? currentItem.getSportArt().getName() : "Trampolin";
case FIELD_ITEM_SPORTSTAETTE: case FIELD_ITEM_SPORTSTAETTE:
return currentItem.getSportStaette() != null ? currentItem.getSportStaette().getName() return currentItem.getSportStaette() != null ? currentItem.getSportStaette().getName()
: "IGS Roderbruch"; : "IGS Roderbruch";
default: default:
break; break;
} }
} else { } else {
switch (jrField.getName()) { switch (jrField.getName()) {
case FIELD_ARTICLE_TITLE: case FIELD_ARTICLE_TITLE:
return article.getTitle(); return article.getTitle();
case FIELD_ARTICLE_DESCRIPTION: case FIELD_ARTICLE_DESCRIPTION:
return article.getDescription(); return article.getDescription();
case FIELD_ARTICLE_PRICE_PER_HOUR: case FIELD_ARTICLE_PRICE_PER_HOUR:
return article.getPricePerHour(); return article.getPricePerHour();
default: default:
break; break;
} }
} }
@ -178,6 +178,18 @@ public class InvoiceReportSource implements JRDataSource, JRDataSourceProvider {
return null; return null;
} }
private Object determineImagePath() {
String signImagePath = invoice.getSignImagePath();
if (signImagePath == null) {
return null;
}
Path of = Path.of(signImagePath);
if (!of.toFile().exists()) {
return null;
}
return of;
}
public static InvoiceReportSource create(Invoice invoice) { public static InvoiceReportSource create(Invoice invoice) {
InvoiceReportSource invoiceReportSource = new InvoiceReportSource(); InvoiceReportSource invoiceReportSource = new InvoiceReportSource();
invoiceReportSource.setInvoice(invoice); invoiceReportSource.setInvoice(invoice);

@ -88,6 +88,6 @@ public class FooterComponent extends FormLayout {
} }
private String getString(Version_Properties prop) { private String getString(Version_Properties prop) {
return prop.getString(VERSION::getProperty); return prop.getText();
} }
} }

@ -1,7 +1,5 @@
package de.kreth.invoice.views; package de.kreth.invoice.views;
import static de.kreth.invoice.Application.getString;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -157,9 +155,9 @@ public class View extends VerticalLayout implements BeforeEnterObserver {
Label name = new Label(user.getGivenName() + " " + user.getFamilyName()); Label name = new Label(user.getGivenName() + " " + user.getFamilyName());
Label email = new Label(user.getEmail()); Label email = new Label(user.getEmail());
Button openDetailDialog = new Button(getString(Localization_Properties.CAPTION_USER_DETAILS)); Button openDetailDialog = new Button(Localization_Properties.CAPTION_USER_DETAILS.getText());
openDetailDialog.addClickListener(ev -> openDetailDialog()); openDetailDialog.addClickListener(ev -> openDetailDialog());
Button openArticleDialog = new Button(getString(Localization_Properties.CAPTION_ARTICLES)); Button openArticleDialog = new Button(Localization_Properties.CAPTION_ARTICLES.getText());
openArticleDialog.addClickListener(ev -> openArticleDialog()); openArticleDialog.addClickListener(ev -> openArticleDialog());
FormLayout layout = new FormLayout(name, email, openDetailDialog, openArticleDialog); FormLayout layout = new FormLayout(name, email, openDetailDialog, openArticleDialog);
add(layout); add(layout);

@ -1,7 +1,5 @@
package de.kreth.invoice.views.article; package de.kreth.invoice.views.article;
import static de.kreth.invoice.Application.getString;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -88,10 +86,10 @@ public class ArticleDialog extends Dialog {
} }
}); });
Button closeButton = new Button(getString(Localization_Properties.LABEL_CLOSE), Button closeButton = new Button(Localization_Properties.LABEL_CLOSE.getText(),
ev -> close()); ev -> close());
deleteButton = new Button(getString(Localization_Properties.LABEL_DELETE), ev -> { deleteButton = new Button(Localization_Properties.LABEL_DELETE.getText(), ev -> {
business.delete(current); business.delete(current);
current = null; current = null;
binder.setBean(null); binder.setBean(null);

@ -1,6 +1,5 @@
package de.kreth.invoice.views.invoice; package de.kreth.invoice.views.invoice;
import static de.kreth.invoice.Application.getString;
import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICE_PRINTSIGNATURE; import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICE_PRINTSIGNATURE;
import static de.kreth.invoice.Localization_Properties.LABEL_CANCEL; import static de.kreth.invoice.Localization_Properties.LABEL_CANCEL;
import static de.kreth.invoice.Localization_Properties.LABEL_CLOSE; import static de.kreth.invoice.Localization_Properties.LABEL_CLOSE;
@ -113,7 +112,7 @@ public class InvoiceDialog extends Dialog {
itemGrid = new InvoiceItemGrid<>(); itemGrid = new InvoiceItemGrid<>();
printSignature = new Checkbox(getString(CAPTION_INVOICE_PRINTSIGNATURE)); printSignature = new Checkbox(CAPTION_INVOICE_PRINTSIGNATURE.getText());
if (InvoiceMode.VIEW_ONLY == pdfOpenLabel) { if (InvoiceMode.VIEW_ONLY == pdfOpenLabel) {
printSignature.setEnabled(false); printSignature.setEnabled(false);
} }
@ -125,18 +124,18 @@ public class InvoiceDialog extends Dialog {
invoice.setSignImagePath(null); invoice.setSignImagePath(null);
} }
}); });
okButton = new Button(getString(LABEL_STORE), ev -> close()); okButton = new Button(LABEL_STORE.getText(), ev -> close());
deleteButton = new Button("Löschen"); deleteButton = new Button("Löschen");
String previewCaption; String previewCaption;
String closeCaption; String closeCaption;
if (pdfOpenLabel == InvoiceMode.VIEW_ONLY) { if (pdfOpenLabel == InvoiceMode.VIEW_ONLY) {
previewCaption = getString(LABEL_OPEN); previewCaption = LABEL_OPEN.getText();
closeCaption = getString(LABEL_CLOSE); closeCaption = LABEL_CLOSE.getText();
okButton.setVisible(false); okButton.setVisible(false);
} else { } else {
previewCaption = getString(LABEL_PREVIEW); previewCaption = LABEL_PREVIEW.getText();
closeCaption = getString(LABEL_CANCEL); closeCaption = LABEL_CANCEL.getText();
deleteButton.setVisible(false); deleteButton.setVisible(false);
} }
Button cancel = new Button(closeCaption, ev -> close()); Button cancel = new Button(closeCaption, ev -> close());

@ -1,6 +1,5 @@
package de.kreth.invoice.views.invoiceitem; package de.kreth.invoice.views.invoiceitem;
import static de.kreth.invoice.Application.getString;
import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_DATE; import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_DATE;
import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_END; import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_END;
import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_NAME; import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_NAME;
@ -48,26 +47,26 @@ public class InvoiceItemGrid<T extends InvoiceItem> extends Grid<T> {
public InvoiceItemGrid() { public InvoiceItemGrid() {
Column<T> articleColumn = addColumn(InvoiceItem::getTitle) Column<T> articleColumn = addColumn(InvoiceItem::getTitle)
.setHeader(getString(CAPTION_INVOICEITEM_NAME)); .setHeader(CAPTION_INVOICEITEM_NAME.getText());
LocalDateTimeRenderer<T> renderer = new LocalDateTimeRenderer<>(InvoiceItem::getStart, LocalDateTimeRenderer<T> renderer = new LocalDateTimeRenderer<>(InvoiceItem::getStart,
DateTimeFormatter.ofPattern("EEE, dd.MM.yyyy")); DateTimeFormatter.ofPattern("EEE, dd.MM.yyyy"));
Column<T> dateColumn = addColumn(renderer).setHeader(getString(CAPTION_INVOICEITEM_DATE)); Column<T> dateColumn = addColumn(renderer).setHeader(CAPTION_INVOICEITEM_DATE.getText());
dateColumn.setId("Date"); dateColumn.setId("Date");
Column<T> startColumn = addColumn(new LocalDateTimeRenderer<>(InvoiceItem::getStart, Column<T> startColumn = addColumn(new LocalDateTimeRenderer<>(InvoiceItem::getStart,
DateTimeFormatter.ofPattern("HH:mm"))) DateTimeFormatter.ofPattern("HH:mm")))
.setHeader(getString(CAPTION_INVOICEITEM_START)); .setHeader(CAPTION_INVOICEITEM_START.getText());
Column<T> endColumn = addColumn(new LocalDateTimeRenderer<>(InvoiceItem::getEnd, Column<T> endColumn = addColumn(new LocalDateTimeRenderer<>(InvoiceItem::getEnd,
DateTimeFormatter.ofPattern("HH:mm"))) DateTimeFormatter.ofPattern("HH:mm")))
.setHeader(getString(CAPTION_INVOICEITEM_END)); .setHeader(CAPTION_INVOICEITEM_END.getText());
addColumn(InvoiceItem::getParticipants) addColumn(InvoiceItem::getParticipants)
.setHeader(getString(CAPTION_INVOICEITEM_PARTICIPANTS)); .setHeader(CAPTION_INVOICEITEM_PARTICIPANTS.getText());
Column<T> priceColumn = addColumn( Column<T> priceColumn = addColumn(
new NumberRenderer<>(InvoiceItem::getSumPrice, NumberFormat.getCurrencyInstance())) new NumberRenderer<>(InvoiceItem::getSumPrice, NumberFormat.getCurrencyInstance()))
.setHeader(getString(CAPTION_INVOICEITEM_SUMPRICE)); .setHeader(CAPTION_INVOICEITEM_SUMPRICE.getText());
FooterRow footer = appendFooterRow(); FooterRow footer = appendFooterRow();
footer = appendFooterRow(); footer = appendFooterRow();

@ -1,6 +1,5 @@
package de.kreth.invoice.views.invoiceitem; package de.kreth.invoice.views.invoiceitem;
import static de.kreth.invoice.Application.getString;
import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEMS; import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEMS;
import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_ADD; import static de.kreth.invoice.Localization_Properties.CAPTION_INVOICEITEM_ADD;
@ -55,8 +54,8 @@ public class InvoiceItemOverviewComponent extends VerticalLayout {
this.user = user; this.user = user;
this.selectListener = new ArrayList<>(); this.selectListener = new ArrayList<>();
Button addButton = new Button(getString(CAPTION_INVOICEITEM_ADD), this::createNewitem); Button addButton = new Button(CAPTION_INVOICEITEM_ADD.getText(), this::createNewitem);
H3 title = new H3(getString(CAPTION_INVOICEITEMS)); H3 title = new H3(CAPTION_INVOICEITEMS.getText());
HorizontalLayout horizontalLayout = new HorizontalLayout(title, addButton); HorizontalLayout horizontalLayout = new HorizontalLayout(title, addButton);
@ -66,7 +65,7 @@ public class InvoiceItemOverviewComponent extends VerticalLayout {
grid.addItemClickListener(this::itemClicked); grid.addItemClickListener(this::itemClicked);
grid.setSelectionMode(SelectionMode.MULTI); grid.setSelectionMode(SelectionMode.MULTI);
GridContextMenu<InvoiceItem> contextMenu = grid.addContextMenu(); GridContextMenu<InvoiceItem> contextMenu = grid.addContextMenu();
contextMenu.addItem(getString(Localization_Properties.LABEL_DELETE), this::deleteEvent); contextMenu.addItem(Localization_Properties.LABEL_DELETE.getText(), this::deleteEvent);
add(grid); add(grid);
} }
@ -74,12 +73,12 @@ public class InvoiceItemOverviewComponent extends VerticalLayout {
private void deleteEvent(GridContextMenuItemClickEvent<InvoiceItem> event) { private void deleteEvent(GridContextMenuItemClickEvent<InvoiceItem> event) {
if (event.getItem().isPresent()) { if (event.getItem().isPresent()) {
ConfirmDialog dlg = new ConfirmDialog(); ConfirmDialog dlg = new ConfirmDialog();
dlg.setHeader(getString(Localization_Properties.MESSAGE_DELETE_TITLE)); dlg.setHeader(Localization_Properties.MESSAGE_DELETE_TITLE.getText());
dlg.setText(MessageFormat.format(getString(Localization_Properties.MESSAGE_DELETE_TEXT), dlg.setText(MessageFormat.format(Localization_Properties.MESSAGE_DELETE_TEXT.getText(),
event.getItem().get())); event.getItem().get()));
dlg.setCancelable(true); dlg.setCancelable(true);
dlg.setCancelText("Nicht " + getString(Localization_Properties.LABEL_DELETE)); dlg.setCancelText("Nicht " + Localization_Properties.LABEL_DELETE.getText());
dlg.setConfirmText(getString(Localization_Properties.LABEL_DELETE)); dlg.setConfirmText(Localization_Properties.LABEL_DELETE.getText());
dlg.addConfirmListener(ev -> { dlg.addConfirmListener(ev -> {
invoiceItemRepository.delete(event.getItem().get()); invoiceItemRepository.delete(event.getItem().get());
refreshData(); refreshData();

@ -1,7 +1,5 @@
package de.kreth.invoice.views.invoiceitem; package de.kreth.invoice.views.invoiceitem;
import static de.kreth.invoice.Application.getString;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.TextStyle; import java.time.format.TextStyle;
@ -44,9 +42,9 @@ public class InvoiceOverviewComponent extends VerticalLayout {
this.grid = new InvoiceGrid(); this.grid = new InvoiceGrid();
this.creationListener = new ArrayList<>(); this.creationListener = new ArrayList<>();
Button addButton = new Button(getString(Localization_Properties.CAPTION_INVOICE_CREATE), Button addButton = new Button(Localization_Properties.CAPTION_INVOICE_CREATE.getText(),
this::createNewRechnung); this::createNewRechnung);
FormLayout titleComponent = new FormLayout(new H3(getString(Localization_Properties.CAPTION_INVOICES)), FormLayout titleComponent = new FormLayout(new H3(Localization_Properties.CAPTION_INVOICES.getText()),
addButton); addButton);
add(new VerticalLayout(titleComponent, grid)); add(new VerticalLayout(titleComponent, grid));
grid.addItemClickListener(ev -> openDialog(ev.getItem(), InvoiceMode.VIEW_ONLY)); grid.addItemClickListener(ev -> openDialog(ev.getItem(), InvoiceMode.VIEW_ONLY));
@ -55,12 +53,12 @@ public class InvoiceOverviewComponent extends VerticalLayout {
private void confirmAndExecuteDelete(Invoice item) { private void confirmAndExecuteDelete(Invoice item) {
ConfirmDialog dlg = new ConfirmDialog(); ConfirmDialog dlg = new ConfirmDialog();
dlg.setHeader(getString(Localization_Properties.MESSAGE_DELETE_TITLE)); dlg.setHeader(Localization_Properties.MESSAGE_DELETE_TITLE.getText());
dlg.setText(MessageFormat.format(getString(Localization_Properties.MESSAGE_DELETE_TEXT), dlg.setText(MessageFormat.format(Localization_Properties.MESSAGE_DELETE_TEXT.getText(),
item)); item));
dlg.setCancelable(true); dlg.setCancelable(true);
dlg.setCancelText("Nicht " + getString(Localization_Properties.LABEL_DELETE)); dlg.setCancelText("Nicht " + Localization_Properties.LABEL_DELETE.getText());
dlg.setConfirmText(getString(Localization_Properties.LABEL_DELETE)); dlg.setConfirmText(Localization_Properties.LABEL_DELETE.getText());
dlg.addConfirmListener(ev -> { dlg.addConfirmListener(ev -> {
business.delete(item); business.delete(item);
if (invoiceDialog != null) { if (invoiceDialog != null) {

@ -10,7 +10,7 @@ caption.article.price = Stundenpreis
caption.article.title = Titel caption.article.title = Titel
caption.article.report = Mit Trainer-Lizenz caption.article.report = Mit Trainer-Lizenz
caption.article.type.trainer = Trainer caption.article.type.trainer = Trainer
caption.article.type.assistant = Übungsleiter caption.article.type.assistant = Übungsleiter
caption.articles = Artikel caption.articles = Artikel
caption.bank.bic = BIC caption.bank.bic = BIC
caption.bank.iban = IBAN caption.bank.iban = IBAN
@ -66,14 +66,14 @@ label.open = PDF \u00D6ffnen
label.user.register = Registrieren label.user.register = Registrieren
message.article.priceerror = Bitte legen Sie den Preis fest. message.article.priceerror = Bitte legen Sie den Preis fest.
message.article.error.invoiceexists = Kann nicht geändert werden, da bereits Rechnungen bestehen. Bitte neuen Artikel anlegen. message.article.error.invoiceexists = Kann nicht geändert werden, da bereits Rechnungen bestehen. Bitte neuen Artikel anlegen.
message.delete.text = Soll {0} wirklich gel\u00F6scht werden? message.delete.text = Soll {0} wirklich gel\u00F6scht werden?
message.delete.title = Wirklich l\u00F6schen? message.delete.title = Wirklich l\u00F6schen?
message.invoiceitem.allfieldsmustbeset = Start, Ende und Artikel m\u00FCssen \ message.invoiceitem.allfieldsmustbeset = Start, Ende und Artikel m\u00FCssen \
gesetzt sein! gesetzt sein!
message.invoiceitem.startbeforeend = Ende darf nicht vor Start liegen. message.invoiceitem.startbeforeend = Ende darf nicht vor Start liegen.
message.user.create.success = {0} erstellt! message.user.create.success = {0} erstellt!
message.user.create.failure = Fehler beim Erstellen von Benutzer {0}! Ändern Sie den Benutzernamen oder fragen Sie nach dem Passwort. Detail: {1} message.user.create.failure = Fehler beim Erstellen von Benutzer {0}! Ändern Sie den Benutzernamen oder fragen Sie nach dem Passwort. Detail: {1}
message.user.loginfailure = Anmeldefehler! Falscher Name oder \ message.user.loginfailure = Anmeldefehler! Falscher Name oder \
Passwort? Passwort?
message.user.passwordmissmatch = Passworter stimmen nicht \u00FCberein! message.user.passwordmissmatch = Passworter stimmen nicht \u00FCberein!

Loading…
Cancel
Save