From 1aeff7f587ff88dc7fb1b8ee000b020ee4c63be2 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sat, 15 Sep 2018 20:52:09 +0200 Subject: [PATCH] =?UTF-8?q?Do=20grid=C5=AF=20v=20cestovn=C3=ADch=20p=C5=99?= =?UTF-8?q?=C3=ADkazech=20byly=20p=C5=99id=C3=A1ny=20sloupce=20"Po=C4=8D?= =?UTF-8?q?=C3=A1tek=20sl.=20cesty",=20"Spolucestuj=C3=ADc=C3=AD"=20a=20"D?= =?UTF-8?q?atum=20schv=C3=A1len=C3=AD".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bukova/isspst/data/TripBillApproval.java | 32 ++++++++++ .../filters/TripBillApprovalFilter.java | 6 +- .../isspst/ui/tripbill/TripBillListAll.java | 7 +- .../ui/tripbill/TripBillListCentre.java | 7 +- .../ui/tripbill/TripBillListWorkgroup.java | 7 +- .../WEB-INF/locales/zk-label.properties | 1 + .../main/trips/bill/tripBillGridInt.zul | 64 ++++++++++++++++++- 7 files changed, 117 insertions(+), 7 deletions(-) diff --git a/src/main/java/info/bukova/isspst/data/TripBillApproval.java b/src/main/java/info/bukova/isspst/data/TripBillApproval.java index bda81d49..9733627d 100644 --- a/src/main/java/info/bukova/isspst/data/TripBillApproval.java +++ b/src/main/java/info/bukova/isspst/data/TripBillApproval.java @@ -5,6 +5,8 @@ import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; +import javax.persistence.Transient; +import java.util.Date; /** * @author Pepa Rokos @@ -17,6 +19,36 @@ public class TripBillApproval extends RequirementBase { @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "TRIPBILL_ID") private TripBill bill; + @Transient + private boolean billForPassenger; + @Transient + private Date approveDate; + @Transient + private Date tripDate; + + public boolean isBillForPassenger() { + return billForPassenger; + } + + public void setBillForPassenger(boolean billForPassenger) { + this.billForPassenger = billForPassenger; + } + + public Date getTripDate() { + return tripDate; + } + + public void setTripDate(Date tripDate) { + this.tripDate = tripDate; + } + + public Date getApproveDate() { + return approveDate; + } + + public void setApproveDate(Date approveDate) { + this.approveDate = approveDate; + } @Override public String getNumser() { diff --git a/src/main/java/info/bukova/isspst/filters/TripBillApprovalFilter.java b/src/main/java/info/bukova/isspst/filters/TripBillApprovalFilter.java index bc36d769..ea9b4e54 100644 --- a/src/main/java/info/bukova/isspst/filters/TripBillApprovalFilter.java +++ b/src/main/java/info/bukova/isspst/filters/TripBillApprovalFilter.java @@ -53,7 +53,11 @@ public class TripBillApprovalFilter implements Filter boolean foundOwner = User.isEqualByUserForFilter(item.getBill().getOwnedBy(), condition.getBill().getOwnedBy()); boolean foundPaid = BooleanUtils.isEqualByBooleanValue(item.getBill().getPaid(), condition.getBill().getPaid()); boolean foundPaidDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getPaidDate(), condition.getBill().getPaidDate()); - return foundNumser && foundReqDate && foundDescription && foundFrom && foundTo && foundWorkgroup && foundCentre && foundOwner && foundPaid && foundPaidDate; + boolean foundPassenger = (item.getBill().getOwnedBy() != item.getBill().getRequirement().getOwnedBy()) == condition.isBillForPassenger(); + boolean foundApproveDate = DateTimeUtils.isEqualByDateForFilter(item.getLastApproveDate(), condition.getApproveDate()); + boolean foundTripDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getRequirement().getTripDate(), condition.getTripDate()); + return foundNumser && foundReqDate && foundDescription && foundFrom && foundTo && foundWorkgroup && foundCentre && foundOwner && foundPaid + && foundPaidDate && foundPassenger && foundApproveDate && foundTripDate; } @Factory diff --git a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListAll.java b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListAll.java index 946f4767..19219a17 100644 --- a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListAll.java +++ b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListAll.java @@ -20,7 +20,12 @@ public class TripBillListAll extends TripBillListBase { @Override protected List getListFromService() { try { - return getReqService().getAll(); + List list = getReqService().getAll(); + for (TripBillApproval item : list) + { + getReqService().loadAuthItems(item); + } + return list; } catch (AccessDeniedException e) { BindUtils.postGlobalCommand(null, null, "disableAll", null); return new ArrayList(); diff --git a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListCentre.java b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListCentre.java index 9a6f868a..1ede9888 100644 --- a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListCentre.java +++ b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListCentre.java @@ -20,7 +20,12 @@ public class TripBillListCentre extends TripBillListBase { @Override protected List getListFromService() { try { - return getReqService().getCentreReq(); + List list = getReqService().getCentreReq(); + for (TripBillApproval item : list) + { + getReqService().loadAuthItems(item); + } + return list; } catch (AccessDeniedException e) { BindUtils.postGlobalCommand(null, null, "disableCentre", null); return new ArrayList(); diff --git a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListWorkgroup.java b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListWorkgroup.java index aee340bd..02660a73 100644 --- a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListWorkgroup.java +++ b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillListWorkgroup.java @@ -20,7 +20,12 @@ public class TripBillListWorkgroup extends TripBillListBase { @Override protected List getListFromService() { try { - return getReqService().getWorkgroupReq(); + List list = getReqService().getWorkgroupReq(); + for (TripBillApproval item : list) + { + getReqService().loadAuthItems(item); + } + return list; } catch (AccessDeniedException e) { BindUtils.postGlobalCommand(null, null, "disableWorkgroup", null); return new ArrayList(); diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 5e5c5dab..b97f51c5 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -247,6 +247,7 @@ TripBillCancelApprovalTitle=Zrušit schválení TripBillPaid=Proplaceno TripBillPaidDate=Datum proplacení TripBillPay=Proplatit +TribBillApproveDate=Datum schválení TripBillSummaryDetail=Detail diff --git a/src/main/webapp/main/trips/bill/tripBillGridInt.zul b/src/main/webapp/main/trips/bill/tripBillGridInt.zul index 2fc59fa0..af96a821 100644 --- a/src/main/webapp/main/trips/bill/tripBillGridInt.zul +++ b/src/main/webapp/main/trips/bill/tripBillGridInt.zul @@ -26,7 +26,12 @@ label="${labels.TravelOrdersGridReqDate}" sort="auto(bill.requirement.reqDate)" onSort="@command('onSortHeader', header=self)" - width="70%" /> + width="40%" /> + + width="30%" /> + + + width="40%"/> + +
+
+ +
+
+ +
+
+
@@ -153,6 +180,34 @@
+ +
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
@@ -186,10 +241,13 @@ + + +