From 1df90a41c4245d6d6adb83cb99b5c02cf9fec333 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sun, 15 Feb 2015 19:14:03 +0100 Subject: [PATCH] =?UTF-8?q?Do=20agendy=20po=C5=BEadavk=C5=AF=20na=20slu?= =?UTF-8?q?=C5=BEebn=C3=AD=20cesty=20byla=20p=C5=99id=C3=A1na=20mo=C5=BEno?= =?UTF-8?q?st=20prohl=C3=AD=C5=BEen=C3=AD=20vy=C3=BA=C4=8Dtov=C3=A1n=C3=AD?= =?UTF-8?q?=20slu=C5=BEebn=C3=AD=20cesty.=20closes=20#200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../requirement/TripRequirementService.java | 2 + .../TripRequirementServiceImpl.java | 16 + .../requirement/TripRequirementListAll.java | 30 +- .../TripRequirementListCentre.java | 31 +- .../TripRequirementListWorkgroup.java | 31 +- .../WEB-INF/locales/zk-label.properties | 1 + src/main/webapp/img/bill-016.png | Bin 0 -> 651 bytes .../webapp/main/trips/bill/tripBillForm.zul | 335 +-------------- .../main/trips/requirements/reqListMyAll.zul | 14 +- .../trips/requirements/reqListMyCenters.zul | 10 +- .../requirements/reqListMyWorkgroups.zul | 10 +- .../main/trips/requirements/tripBill.zul | 39 ++ .../webapp/main/trips/tripBillInterior.zul | 385 ++++++++++++++++++ 13 files changed, 557 insertions(+), 347 deletions(-) create mode 100644 src/main/webapp/img/bill-016.png create mode 100644 src/main/webapp/main/trips/requirements/tripBill.zul create mode 100644 src/main/webapp/main/trips/tripBillInterior.zul diff --git a/src/main/java/info/bukova/isspst/services/requirement/TripRequirementService.java b/src/main/java/info/bukova/isspst/services/requirement/TripRequirementService.java index 373fee93..5e6805b7 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/TripRequirementService.java +++ b/src/main/java/info/bukova/isspst/services/requirement/TripRequirementService.java @@ -1,10 +1,12 @@ package info.bukova.isspst.services.requirement; +import info.bukova.isspst.data.TripBill; import info.bukova.isspst.data.TripRequirement; public interface TripRequirementService extends RequirementBaseService { public void loadPassangers(TripRequirement entity); + public TripBill getTripBill(TripRequirement requirement); } diff --git a/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java index 53411223..180626fd 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java @@ -7,10 +7,12 @@ import info.bukova.isspst.services.tripbill.TripBillService; import info.bukova.isspst.services.workgroups.WorkgroupService; import org.hibernate.Hibernate; import org.hibernate.LazyInitializationException; +import org.hibernate.Query; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.Date; +import java.util.List; public class TripRequirementServiceImpl extends RequirementBaseServiceImpl implements TripRequirementService, RequirementBaseService { @@ -49,6 +51,20 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl result = q.list(); + + if (result.size() > 0) { + return result.get(0); + } + + return null; + } + @Transactional @LazyLoader("form") public void loadAttachments(TripRequirement entity) { diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java index 4d46242c..4709b651 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java @@ -1,20 +1,26 @@ package info.bukova.isspst.ui.requirement; +import info.bukova.isspst.data.TripBill; import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.services.requirement.TripRequirementService; +import info.bukova.isspst.services.tripbill.TripBillService; import info.bukova.isspst.services.workgroups.WorkgroupService; - -import java.util.ArrayList; -import java.util.List; - import org.springframework.security.access.AccessDeniedException; import org.zkoss.bind.BindUtils; +import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.NotifyChange; +import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zul.Window; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class TripRequirementListAll extends RequirementSubpage { @@ -22,6 +28,8 @@ public class TripRequirementListAll extends RequirementSubpage private TripRequirementService tripRequirementService; @WireVariable private WorkgroupService workgroupService; + @WireVariable + private TripBillService tripBillService; private List allCentres; private List allWorkgroups; @@ -65,4 +73,18 @@ public class TripRequirementListAll extends RequirementSubpage BindUtils.postGlobalCommand(null, null, "selectAll", null); } + @Command + public void showTripBill() { + if (getDataBean() == null) { + return; + } + + TripBill tb = tripRequirementService.getTripBill(getDataBean()); + tripBillService.loadLazyData(tb); + Map params = new HashMap(); + params.put("selected", tb); + Window win = (Window) Executions.createComponents("tripBill.zul", null, params); + win.doModal(); + } + } diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java index cccf1a00..f0857290 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java @@ -1,20 +1,26 @@ package info.bukova.isspst.ui.requirement; +import info.bukova.isspst.data.TripBill; import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.services.requirement.TripRequirementService; +import info.bukova.isspst.services.tripbill.TripBillService; import info.bukova.isspst.services.workgroups.WorkgroupService; - -import java.util.ArrayList; -import java.util.List; - import org.springframework.security.access.AccessDeniedException; import org.zkoss.bind.BindUtils; +import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.NotifyChange; +import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zul.Window; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class TripRequirementListCentre extends RequirementSubpage { @@ -24,6 +30,9 @@ public class TripRequirementListCentre extends RequirementSubpage myCentres; @Init @@ -61,4 +70,18 @@ public class TripRequirementListCentre extends RequirementSubpage params = new HashMap(); + params.put("selected", tb); + Window win = (Window) Executions.createComponents("tripBill.zul", null, params); + win.doModal(); + } + } diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java index 3aff0cfb..4a883718 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java @@ -1,20 +1,26 @@ package info.bukova.isspst.ui.requirement; +import info.bukova.isspst.data.TripBill; import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.services.requirement.TripRequirementService; +import info.bukova.isspst.services.tripbill.TripBillService; import info.bukova.isspst.services.workgroups.WorkgroupService; - -import java.util.ArrayList; -import java.util.List; - import org.springframework.security.access.AccessDeniedException; import org.zkoss.bind.BindUtils; +import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.NotifyChange; +import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zul.Window; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class TripRequirementListWorkgroup extends RequirementSubpage { @@ -24,6 +30,9 @@ public class TripRequirementListWorkgroup extends RequirementSubpage myCentres; private List myWorkgroups; @@ -68,4 +77,18 @@ public class TripRequirementListWorkgroup extends RequirementSubpage params = new HashMap(); + params.put("selected", tb); + Window win = (Window) Executions.createComponents("tripBill.zul", null, params); + win.doModal(); + } + } diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index d6f65f62..d8dea6f6 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -224,6 +224,7 @@ TripBillBack=Zpět TripBillTotal=Celkem TripRequirement=Požadavek na služební cestu +ShowTripBill=Zobrazit vyúčtování CentresForRequirements=Střediska, pro která lze vkládat požadavky WorkgroupMembership=Členství v komisích diff --git a/src/main/webapp/img/bill-016.png b/src/main/webapp/img/bill-016.png new file mode 100644 index 0000000000000000000000000000000000000000..39f09967046b32c8563a44af9da1b0b454175626 GIT binary patch literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h literal 0 HcmV?d00001 diff --git a/src/main/webapp/main/trips/bill/tripBillForm.zul b/src/main/webapp/main/trips/bill/tripBillForm.zul index 8485dd36..bbf9249b 100644 --- a/src/main/webapp/main/trips/bill/tripBillForm.zul +++ b/src/main/webapp/main/trips/bill/tripBillForm.zul @@ -10,342 +10,15 @@ position="center" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillForm')"> + + boolean disabled = false; + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - - - -
- - -
- -
- -
- - -
-
- - - ${labels.TripBillKm} ]]> - - - - - ${labels.TripBillPHM} ]]> - - - - - ${labels.TripBillLocal}
${labels.TripBillTransportation} ]]> - -
- - - - - ${labels.TripBillMeals}
${labels.TripBillFree} ]]> - -
- - - - - ${labels.TripBillOther}
${labels.TripBillExpenses} ]]> - -
- - - - -
- - - - - - - - - - - - - - ${labels.TripBillTraveled}
${labels.TripBillKm}
${labels.TripBillInKc} ]]> - -
- - - ${labels.TripBillPHM}
${labels.TripBillInKc}]]> - -
- -
- - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - -
+
diff --git a/src/main/webapp/main/trips/requirements/reqListMyAll.zul b/src/main/webapp/main/trips/requirements/reqListMyAll.zul index 10b4824b..89ef85f3 100644 --- a/src/main/webapp/main/trips/requirements/reqListMyAll.zul +++ b/src/main/webapp/main/trips/requirements/reqListMyAll.zul @@ -1,4 +1,6 @@ - +
- + + +
diff --git a/src/main/webapp/main/trips/requirements/reqListMyCenters.zul b/src/main/webapp/main/trips/requirements/reqListMyCenters.zul index 9ee3531d..3c40bb3e 100644 --- a/src/main/webapp/main/trips/requirements/reqListMyCenters.zul +++ b/src/main/webapp/main/trips/requirements/reqListMyCenters.zul @@ -158,7 +158,15 @@
- + + +
diff --git a/src/main/webapp/main/trips/requirements/reqListMyWorkgroups.zul b/src/main/webapp/main/trips/requirements/reqListMyWorkgroups.zul index 6c4db24b..6abd5043 100644 --- a/src/main/webapp/main/trips/requirements/reqListMyWorkgroups.zul +++ b/src/main/webapp/main/trips/requirements/reqListMyWorkgroups.zul @@ -182,7 +182,15 @@
- + + +
diff --git a/src/main/webapp/main/trips/requirements/tripBill.zul b/src/main/webapp/main/trips/requirements/tripBill.zul new file mode 100644 index 00000000..7fdaa8fd --- /dev/null +++ b/src/main/webapp/main/trips/requirements/tripBill.zul @@ -0,0 +1,39 @@ + + + + + boolean disabled = true; + + + + + + +
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/main/trips/tripBillInterior.zul b/src/main/webapp/main/trips/tripBillInterior.zul new file mode 100644 index 00000000..c7cbb394 --- /dev/null +++ b/src/main/webapp/main/trips/tripBillInterior.zul @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + +
+ + +
+ +
+ +
+ + +
+
+ + + ${labels.TripBillKm} ]]> + + + + + ${labels.TripBillPHM} ]]> + + + + + ${labels.TripBillLocal}
${labels.TripBillTransportation} ]]> + +
+ + + + + ${labels.TripBillMeals}
${labels.TripBillFree} ]]> + +
+ + + + + ${labels.TripBillOther}
${labels.TripBillExpenses} ]]> + +
+ + + + +
+ + + + + + + + + + + + + + ${labels.TripBillTraveled}
${labels.TripBillKm}
${labels.TripBillInKc} ]]> + +
+ + + ${labels.TripBillPHM}
${labels.TripBillInKc}]]> + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+ +
\ No newline at end of file