From b0fedfa3f3640aec45d305c5f665d5a1e34a12b5 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sun, 21 Jun 2015 00:31:33 +0200 Subject: [PATCH] =?UTF-8?q?Opraveny=20datumy=20na=20vy=C3=BA=C4=8Dtov?= =?UTF-8?q?=C3=A1n=C3=AD=20slu=C5=BEebn=C3=AD=20cesty.=20closes=20#232?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bukova/isspst/reporting/ParamFiller.java | 45 ++++++++++-------- .../webapp/WEB-INF/reports/tripBill.jasper | Bin 54342 -> 55261 bytes .../webapp/WEB-INF/reports/tripBill.jrxml | 16 ++++++- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/main/java/info/bukova/isspst/reporting/ParamFiller.java b/src/main/java/info/bukova/isspst/reporting/ParamFiller.java index 24b6e544..41aec3b7 100644 --- a/src/main/java/info/bukova/isspst/reporting/ParamFiller.java +++ b/src/main/java/info/bukova/isspst/reporting/ParamFiller.java @@ -1,5 +1,6 @@ package info.bukova.isspst.reporting; +import com.mysql.jdbc.StringUtils; import info.bukova.isspst.data.Address; import info.bukova.isspst.data.AuthItem; import info.bukova.isspst.data.Order; @@ -8,16 +9,14 @@ import info.bukova.isspst.data.User; import info.bukova.isspst.data.UserSettingsData; import info.bukova.isspst.services.requirement.TripRequirementService; import info.bukova.isspst.services.settings.GlobalSettingsService; +import info.bukova.isspst.services.tripbill.TripBillApprovalService; import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.storage.FileStorage; +import org.springframework.beans.factory.annotation.Autowired; import java.util.HashMap; import java.util.Map; -import org.springframework.beans.factory.annotation.Autowired; - -import com.mysql.jdbc.StringUtils; - public class ParamFiller { @Autowired @@ -30,6 +29,8 @@ public class ParamFiller { private TripRequirementService tripReqService; @Autowired private GlobalSettingsService settingService; + @Autowired + private TripBillApprovalService tripBillApprovalService; public void fill() { if (definition.getDataSet() == null || definition.getDataSet().isEmpty()) { @@ -57,25 +58,31 @@ 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()); + if (tb.getApproval() != null) { + tripBillApprovalService.loadAuthItems(tb.getApproval()); + } - User lastButOneUser = lastButOneAuth.getApprover(); - UserSettingsData prevApproverSettings = userService.getUserSettings(lastButOneUser); + if (tb.getApproval() != null && tb.getApproval().getAuthorization() != null && !tb.getApproval().getAuthorization().isEmpty()) { - if (prevApproverSettings != null && !StringUtils.isNullOrEmpty(prevApproverSettings.getSignatureFile())) { - definition.setParam("P_PREV_APPROVER_SIGNATURE", storage.serverPath(prevApproverSettings.getSignatureFile())); - } + AuthItem lastButOneAuth = tb.getApproval().getAuthorization().get(0); + definition.setParam("P_PREV_APPROVE_DATE", lastButOneAuth.getAuthDate()); + User lastButOneUser = lastButOneAuth.getApprover(); + UserSettingsData prevApproverSettings = userService.getUserSettings(lastButOneUser); - 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 && !StringUtils.isNullOrEmpty(approverSettings.getSignatureFile())) { - definition.setParam("P_APPROVER_SIGNATURE", storage.serverPath(approverSettings.getSignatureFile())); + if (prevApproverSettings != null && !StringUtils.isNullOrEmpty(prevApproverSettings.getSignatureFile())) { + definition.setParam("P_PREV_APPROVER_SIGNATURE", storage.serverPath(prevApproverSettings.getSignatureFile())); + } + + AuthItem lastAuth = tb.getApproval().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 && !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 2d1911c6815ad5018c594b7f9a72d310e387d7fc..11f966a10d864a154cd14e100cca8e456686346d 100644 GIT binary patch delta 4305 zcmeHKe^`~}8Gi5k!C|K2c9bMAS!Vtq1QbNJRw;>NMq#0-m?Y|oqC#mUwQ14rr4NT&(xD089Gn1u9JGF^*X708oH(4X>g|Q^7&fo zvz)1iSo?BAG;N#Zlh?ECw!%jcH0q%PSAY9EO?wnpzzkZnFg1NbYFb)ySooOmabu!F z!^6f#h9-}Vhzt)avu_I=WM5}QKSnMg&VPq~f1%epju6Em#Sz7EMXTbHK23ex=%)x! z3|E9J;uJ}WR7IvDTVW|SD@qiVii3& zs)LBriEY=Mc-mvW(PO^OV}7so*nxre?IX)gW(6LvMuNuMq-<>klB)5fvNg)yax#a_ zuIyDOOIEf(S%I6)RhH}aoT}{CZZ@f#XOyz-Zd;He=o)vJLCW%-Y)*~w_9`-7@&RV* zYF^h2aYblXHm5V^ZfB}o%AW4}Y4}jtBq!7KQMLzjXXs4d&CccK@5VDa`>s_| z<9qwU3M{Tbmh$CRK#hOY9Q9k}bepDgPbe$u$`})st#Gne)E231xtoo!(rfMR<}7_w8{=XPanwkUhMYi+YmS+<+yIBZs6jW5l!R>;1AK2vnU z{VYwiRaZOEK2qnFy2Ax1OX|7_rmwQDTXNq{eYs&&IIz;_>uG+YulpWTZ>qGCs?AaJ zu~yUX%_*~AE9!tbZ|bzF4x20HQ?0Bc@HWS^x*A|J&01l9#b9$%tLzl)LFSB>S_>jg ztCrh85N|GM$+cm&Y1gvrK$^LtrS~6XLCX(79(usSx3B@duo<^wD|}FbeketMRAK4#Aaz-SJ`7&}KIk`Wlkak!t+_yJ=up3^ab zNr>SROyV+3=6XEBjfiIfrf?gkau=qt95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