diff --git a/src/main/java/info/bukova/isspst/data/UsersAddress.java b/src/main/java/info/bukova/isspst/data/UsersAddress.java index d5aeb44b..f3f761ba 100644 --- a/src/main/java/info/bukova/isspst/data/UsersAddress.java +++ b/src/main/java/info/bukova/isspst/data/UsersAddress.java @@ -1,5 +1,10 @@ package info.bukova.isspst.data; +import info.bukova.isspst.StringUtils; + +import java.util.ArrayList; +import java.util.List; + import javax.persistence.Column; import javax.persistence.Embeddable; @@ -47,4 +52,22 @@ public class UsersAddress { this.city = city; } + public String toString() { + List list = new ArrayList(); + list.add(this.street); + list.add(this.houseNumber); + final String s1 = StringUtils.joinNotEmpty(list, " "); + + list.clear(); + list.add(this.zipCode); + list.add(this.city); + final String s2 = StringUtils.joinNotEmpty(list, " "); + + list.clear(); + list.add(s1); + list.add(s2); + final String s = StringUtils.joinNotEmpty(list, ", "); + + return s; + } } diff --git a/src/main/java/info/bukova/isspst/reporting/ParamFiller.java b/src/main/java/info/bukova/isspst/reporting/ParamFiller.java index b1bbddda..24b6e544 100644 --- a/src/main/java/info/bukova/isspst/reporting/ParamFiller.java +++ b/src/main/java/info/bukova/isspst/reporting/ParamFiller.java @@ -48,6 +48,7 @@ public class ParamFiller { if ((definition.getDataSet().get(0) instanceof TripBill) && definition.getReport().isSingleRecord()) { + if (userService.getUserSettings().getSignatureFile() != null && !userService.getUserSettings().getSignatureFile().isEmpty()) { definition.setParam("P_USER_SIGNATURE", storage.serverPath(userService.getUserSettings().getSignatureFile())); @@ -55,17 +56,25 @@ public class ParamFiller { TripBill tb = (TripBill)definition.getDataSet().get(0); tripReqService.loadAuthItems(tb.getRequirement()); + + AuthItem lastButOneAuth = tb.getRequirement().getAuthorization().get(0); + definition.setParam("P_PREV_APPROVE_DATE", lastButOneAuth.getAuthDate()); + + User lastButOneUser = lastButOneAuth.getApprover(); + UserSettingsData prevApproverSettings = userService.getUserSettings(lastButOneUser); + + if (prevApproverSettings != null && !StringUtils.isNullOrEmpty(prevApproverSettings.getSignatureFile())) { + definition.setParam("P_PREV_APPROVER_SIGNATURE", storage.serverPath(prevApproverSettings.getSignatureFile())); + } + + AuthItem lastAuth = tb.getRequirement().getAuthorization().get(tb.getRequirement().getAuthorization().size() - 1); - definition.setParam("P_APPROVE_DATE", lastAuth.getAuthDate()); User u = lastAuth.getApprover(); - UserSettingsData approverSettings = userService.getUserSettings(u); - if (approverSettings != null - && approverSettings.getSignatureFile() != null - && !approverSettings.getSignatureFile().isEmpty()) { + if (approverSettings != null && !StringUtils.isNullOrEmpty(approverSettings.getSignatureFile())) { definition.setParam("P_APPROVER_SIGNATURE", storage.serverPath(approverSettings.getSignatureFile())); } } diff --git a/src/main/webapp/WEB-INF/reports/tripBill.jasper b/src/main/webapp/WEB-INF/reports/tripBill.jasper index c0abfc27..d324b8cd 100644 Binary files a/src/main/webapp/WEB-INF/reports/tripBill.jasper and b/src/main/webapp/WEB-INF/reports/tripBill.jasper differ diff --git a/src/main/webapp/WEB-INF/reports/tripBill.jrxml b/src/main/webapp/WEB-INF/reports/tripBill.jrxml index b4c83281..6fb9ddf4 100644 --- a/src/main/webapp/WEB-INF/reports/tripBill.jrxml +++ b/src/main/webapp/WEB-INF/reports/tripBill.jrxml @@ -2,13 +2,17 @@ - + + + + + @@ -48,11 +52,18 @@ + + + + + + + @@ -166,9 +177,9 @@ tuzemské pracovní cesty]]> - - - + + + @@ -203,14 +214,14 @@ tuzemské pracovní cesty]]> - + - + @@ -225,6 +236,11 @@ tuzemské pracovní cesty]]> + + + + + @@ -254,12 +270,12 @@ tuzemské pracovní cesty]]> - + - + @@ -405,6 +421,18 @@ tuzemské pracovní cesty]]> + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/reports/tripRequirement.jasper b/src/main/webapp/WEB-INF/reports/tripRequirement.jasper index 7625b9fc..4e5a43a6 100644 Binary files a/src/main/webapp/WEB-INF/reports/tripRequirement.jasper and b/src/main/webapp/WEB-INF/reports/tripRequirement.jasper differ diff --git a/src/main/webapp/WEB-INF/reports/tripRequirement.jrxml b/src/main/webapp/WEB-INF/reports/tripRequirement.jrxml index 4d234455..f8a88eba 100644 --- a/src/main/webapp/WEB-INF/reports/tripRequirement.jrxml +++ b/src/main/webapp/WEB-INF/reports/tripRequirement.jrxml @@ -2,7 +2,7 @@ - +