Skip to content

Commit

Permalink
added user placeholders. issue #2165. close #2551.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Sep 9, 2024
1 parent ebc695f commit 5aa15a0
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,6 @@ public class PlaceHolders {
// Anzeigename
public static final String AKTE_ANWALT_AN = "{{AKTE_ANWALT_AN}}";
public static final String AKTE_SACHBEARBEITER_AN = "{{AKTE_SACHBEARBEITER_AN}}";
public static final String AUTOR_AN = "{{AUTOR_AN}}";
public static final String AUTOR_EMAIL = "{{AUTOR_EMAIL}}";

//Nutzernamen
public static final String AKTE_SACHBEARBEITER = "{{AKTE_SACHBEARBEITER}}";
Expand All @@ -776,13 +774,35 @@ public class PlaceHolders {
// Kürzel
public static final String AKTE_SACHBEARBEITER_KRZ = "{{AKTE_SACHBEARBEITER_KRZ}}";
public static final String AKTE_ANWALT_KRZ = "{{AKTE_ANWALT_KRZ}}";
public static final String AUTOR_KRZ = "{{AUTOR_KRZ}}";


public static final String DOK_DZ = "{{DOK_DZ}}";
public static final String AKTE_EIGENE1 = "{{AKTE_EIGENE1}}";
public static final String AKTE_EIGENE2 = "{{AKTE_EIGENE2}}";
public static final String AKTE_EIGENE3 = "{{AKTE_EIGENE3}}";

// user / author
public static final String USER_AN = "{{USER_AN}}";
public static final String USER_EMAIL = "{{USER_EMAIL}}";
public static final String USER_KRZ = "{{USER_KRZ}}";
public static final String USER_VORNAME = "{{USER_VORNAME}}";
public static final String USER_NAME = "{{USER_NAME}}";
public static final String USER_UNTERNEHMEN = "{{USER_UNTERNEHMEN}}";
public static final String USER_FKT = "{{USER_FKT}}";
public static final String USER_STRASSE = "{{USER_STRASSE}}";
public static final String USER_ZUSATZ = "{{USER_ZUSATZ}}";
public static final String USER_PLZ = "{{USER_PLZ}}";
public static final String USER_ORT = "{{USER_ORT}}";
public static final String USER_LAND = "{{USER_LAND}}";
public static final String USER_TEL = "{{USER_TEL}}";
public static final String USER_FAX = "{{USER_FAX}}";
public static final String USER_MOBIL = "{{USER_MOBIL}}";
public static final String USER_WWW = "{{USER_WWW}}";
public static final String USER_BANK = "{{USER_BANK}}";
public static final String USER_BIC = "{{USER_BIC}}";
public static final String USER_IBAN = "{{USER_IBAN}}";
public static final String USER_STEUERNR = "{{USER_STEUERNR}}";
public static final String USER_USTIDNR = "{{USER_USTIDNR}}";


public static final String TABELLE_1 = "{{TABELLE_1}}";
Expand Down Expand Up @@ -935,15 +955,33 @@ public static ArrayList<String> getAllPlaceHolders(List<String> allPartyTypesPla
ALLPLACEHOLDERS.add(AKTE_SACHBEARBEITER_AN);
ALLPLACEHOLDERS.add(AKTE_SACHBEARBEITER_KRZ);
ALLPLACEHOLDERS.add(AKTE_ANWALT_KRZ);
ALLPLACEHOLDERS.add(AUTOR_KRZ);
ALLPLACEHOLDERS.add(AKTE_EIGENE1);
ALLPLACEHOLDERS.add(AKTE_EIGENE2);
ALLPLACEHOLDERS.add(AKTE_EIGENE3);
ALLPLACEHOLDERS.add(AKTE_ERSTELLT);


ALLPLACEHOLDERS.add(AUTOR_AN);
ALLPLACEHOLDERS.add(AUTOR_EMAIL);
ALLPLACEHOLDERS.add(USER_AN);
ALLPLACEHOLDERS.add(USER_KRZ);
ALLPLACEHOLDERS.add(USER_EMAIL);
ALLPLACEHOLDERS.add(USER_VORNAME);
ALLPLACEHOLDERS.add(USER_NAME);
ALLPLACEHOLDERS.add(USER_UNTERNEHMEN);
ALLPLACEHOLDERS.add(USER_FKT);
ALLPLACEHOLDERS.add(USER_STRASSE);
ALLPLACEHOLDERS.add(USER_ZUSATZ);
ALLPLACEHOLDERS.add(USER_PLZ);
ALLPLACEHOLDERS.add(USER_ORT);
ALLPLACEHOLDERS.add(USER_LAND);
ALLPLACEHOLDERS.add(USER_TEL);
ALLPLACEHOLDERS.add(USER_FAX);
ALLPLACEHOLDERS.add(USER_MOBIL);
ALLPLACEHOLDERS.add(USER_WWW);
ALLPLACEHOLDERS.add(USER_BANK);
ALLPLACEHOLDERS.add(USER_BIC);
ALLPLACEHOLDERS.add(USER_IBAN);
ALLPLACEHOLDERS.add(USER_STEUERNR);
ALLPLACEHOLDERS.add(USER_USTIDNR);

ALLPLACEHOLDERS.add(DOK_DZ);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1051,27 +1051,154 @@ public static HashMap<String,Object> getPlaceHolderValues(HashMap<String,Object>

}

if (placeHolders.containsKey(AUTOR_AN)) {
if (placeHolders.containsKey(USER_AN)) {
if (author != null) {
placeHolders.put(AUTOR_AN, val(author.getDisplayName()));
placeHolders.put(USER_AN, val(author.getDisplayName()));
} else {
placeHolders.put(AUTOR_AN, "");
placeHolders.put(USER_AN, "");
}
}
if (placeHolders.containsKey(AUTOR_EMAIL)) {
if (placeHolders.containsKey(USER_EMAIL)) {
if (author != null) {
placeHolders.put(AUTOR_EMAIL, val(author.getEmail()));
placeHolders.put(USER_EMAIL, val(author.getEmail()));
} else {
placeHolders.put(AUTOR_EMAIL, "");
placeHolders.put(USER_EMAIL, "");
}
}
if (placeHolders.containsKey(AUTOR_KRZ)) {
if (placeHolders.containsKey(USER_KRZ)) {
if (author != null) {
placeHolders.put(AUTOR_KRZ, val(author.getAbbreviation()));
placeHolders.put(USER_KRZ, val(author.getAbbreviation()));
} else {
placeHolders.put(AUTOR_KRZ, "");
placeHolders.put(USER_KRZ, "");
}
}
if (placeHolders.containsKey(USER_VORNAME)) {
if (author != null) {
placeHolders.put(USER_VORNAME, val(author.getFirstName()));
} else {
placeHolders.put(USER_VORNAME, "");
}
}
if (placeHolders.containsKey(USER_NAME)) {
if (author != null) {
placeHolders.put(USER_NAME, val(author.getName()));
} else {
placeHolders.put(USER_NAME, "");
}
}
if (placeHolders.containsKey(USER_UNTERNEHMEN)) {
if (author != null) {
placeHolders.put(USER_UNTERNEHMEN, val(author.getCompany()));
} else {
placeHolders.put(USER_UNTERNEHMEN, "");
}
}
if (placeHolders.containsKey(USER_FKT)) {
if (author != null) {
placeHolders.put(USER_FKT, val(author.getRole()));
} else {
placeHolders.put(USER_FKT, "");
}
}
if (placeHolders.containsKey(USER_STRASSE)) {
if (author != null) {
placeHolders.put(USER_STRASSE, val(author.getStreet()));
} else {
placeHolders.put(USER_STRASSE, "");
}
}
if (placeHolders.containsKey(USER_ZUSATZ)) {
if (author != null) {
placeHolders.put(USER_ZUSATZ, val(author.getAdjunct()));
} else {
placeHolders.put(USER_ZUSATZ, "");
}
}
if (placeHolders.containsKey(USER_PLZ)) {
if (author != null) {
placeHolders.put(USER_PLZ, val(author.getZipCode()));
} else {
placeHolders.put(USER_PLZ, "");
}
}
if (placeHolders.containsKey(USER_ORT)) {
if (author != null) {
placeHolders.put(USER_ORT, val(author.getCity()));
} else {
placeHolders.put(USER_ORT, "");
}
}
if (placeHolders.containsKey(USER_LAND)) {
if (author != null) {
placeHolders.put(USER_LAND, val(author.getCountryCode()));
} else {
placeHolders.put(USER_LAND, "");
}
}
if (placeHolders.containsKey(USER_TEL)) {
if (author != null) {
placeHolders.put(USER_TEL, val(author.getPhone()));
} else {
placeHolders.put(USER_TEL, "");
}
}
if (placeHolders.containsKey(USER_FAX)) {
if (author != null) {
placeHolders.put(USER_FAX, val(author.getFax()));
} else {
placeHolders.put(USER_FAX, "");
}
}
if (placeHolders.containsKey(USER_MOBIL)) {
if (author != null) {
placeHolders.put(USER_MOBIL, val(author.getMobile()));
} else {
placeHolders.put(USER_MOBIL, "");
}
}
if (placeHolders.containsKey(USER_WWW)) {
if (author != null) {
placeHolders.put(USER_WWW, val(author.getWebsite()));
} else {
placeHolders.put(USER_WWW, "");
}
}
if (placeHolders.containsKey(USER_BANK)) {
if (author != null) {
placeHolders.put(USER_BANK, val(author.getBankName()));
} else {
placeHolders.put(USER_BANK, "");
}
}
if (placeHolders.containsKey(USER_BIC)) {
if (author != null) {
placeHolders.put(USER_BIC, val(author.getBankBic()));
} else {
placeHolders.put(USER_BIC, "");
}
}
if (placeHolders.containsKey(USER_IBAN)) {
if (author != null) {
placeHolders.put(USER_IBAN, val(author.getBankIban()));
} else {
placeHolders.put(USER_IBAN, "");
}
}
if (placeHolders.containsKey(USER_STEUERNR)) {
if (author != null) {
placeHolders.put(USER_STEUERNR, val(author.getTaxNr()));
} else {
placeHolders.put(USER_STEUERNR, "");
}
}
if (placeHolders.containsKey(USER_USTIDNR)) {
if (author != null) {
placeHolders.put(USER_USTIDNR, val(author.getTaxVatId()));
} else {
placeHolders.put(USER_USTIDNR, "");
}
}


if (invoice != null) {
SimpleDateFormat df = new SimpleDateFormat(DATE_FORMAT, Locale.GERMAN);
Expand Down

0 comments on commit 5aa15a0

Please sign in to comment.