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 00000000..39f09967 Binary files /dev/null and b/src/main/webapp/img/bill-016.png differ 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