From aaa89a26537364465a6916cf1e49cd5938715eb2 Mon Sep 17 00:00:00 2001 From: Franta Pribyl Date: Fri, 22 May 2015 12:10:00 +0200 Subject: [PATCH] =?UTF-8?q?Workaround=20pro=20z=C3=A1pis=20=C4=8D=C3=ADsel?= =?UTF-8?q?n=C3=A9=20=C5=99ady.=20Vznikaly=20duplicity=20nad=20unik=C3=A1t?= =?UTF-8?q?n=C3=ADm=20indexem.=20Nyn=C3=AD=20se=20=C4=8D=C3=ADslo=20nezapi?= =?UTF-8?q?suje=20a=20na=C4=8D=C3=ADt=C3=A1=20se=20z=20vazby=20na=20po?= =?UTF-8?q?=C5=BEadavku=20na=20ces=C5=A5=C3=A1k.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #221 --- .../bukova/isspst/data/TripBillApproval.java | 16 ++++++++++++++++ .../tripbill/TripBillApprovalServiceImpl.java | 7 ++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/java/info/bukova/isspst/data/TripBillApproval.java b/src/main/java/info/bukova/isspst/data/TripBillApproval.java index 84388caa..bda81d49 100644 --- a/src/main/java/info/bukova/isspst/data/TripBillApproval.java +++ b/src/main/java/info/bukova/isspst/data/TripBillApproval.java @@ -18,6 +18,22 @@ public class TripBillApproval extends RequirementBase { @JoinColumn(name = "TRIPBILL_ID") private TripBill bill; + @Override + public String getNumser() { + + if (bill == null) { + return ""; + } + + TripRequirement tr = bill.getRequirement(); + + if (tr == null) { + return ""; + } + + return tr.getNumser(); + } + public TripBill getBill() { return bill; } diff --git a/src/main/java/info/bukova/isspst/services/tripbill/TripBillApprovalServiceImpl.java b/src/main/java/info/bukova/isspst/services/tripbill/TripBillApprovalServiceImpl.java index 11080ccf..c9827168 100644 --- a/src/main/java/info/bukova/isspst/services/tripbill/TripBillApprovalServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/tripbill/TripBillApprovalServiceImpl.java @@ -8,12 +8,13 @@ import info.bukova.isspst.data.TripBillApproval; import info.bukova.isspst.services.IsspstException; import info.bukova.isspst.services.requirement.RequirementBaseServiceImpl; import info.bukova.isspst.services.requirement.RequirementTypeService; + +import java.util.Date; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; -import java.util.Date; - /** * @author Pepa Rokos */ @@ -34,7 +35,7 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl