From 2a48f440af2f1dc853b94b017d4e22794fa25439 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Mon, 10 Dec 2018 12:01:23 +0100 Subject: [PATCH] =?UTF-8?q?V=20agend=C3=A1ch=20pro=20schv=C3=A1len=C3=AD?= =?UTF-8?q?=20materi=C3=A1lu=20a=20slu=C5=BEeb=20se=20na=20z=C3=A1lo=C5=BE?= =?UTF-8?q?ce=20"M=C3=A9=20komise"=20objevuje=20informace=20o=20vy=C4=8Der?= =?UTF-8?q?pan=C3=A9m=20limitu=20komise.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../requirements/ReqListMyWorkgroups.java | 41 ++++++++++++++++++- src/main/webapp/app/template.zhtml | 2 +- .../requirements/reqListMyWorkgroups.zul | 9 +++- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java index abe527a8..b9736305 100644 --- a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java +++ b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java @@ -1,8 +1,11 @@ package info.bukova.isspst.ui.main.orders.requirements; +import info.bukova.isspst.data.Limit; import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.RequirementFilter; +import info.bukova.isspst.services.invoicing.InvoicingService; +import info.bukova.isspst.services.limits.LimitService; import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.ui.requirement.RequirementSubpage; @@ -25,6 +28,12 @@ public class ReqListMyWorkgroups extends RequirementSubpage @WireVariable protected WorkgroupService workgroupService; + @WireVariable + protected LimitService limitService; + + @WireVariable + protected InvoicingService invoicingService; + public List getCentres() { return workgroupService.getCentres(); @@ -73,10 +82,38 @@ public class ReqListMyWorkgroups extends RequirementSubpage return null; } } - + @Override - @NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" }) + @NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount", "workgroupLimit", "workgroupInvoiced" }) public void setDataBean(Requirement data) { super.setDataBean(data); } + + public BigDecimal getWorkgroupLimit() { + if (getDataBean() != null && getDataBean().getWorkgroup() != null) { + Limit limit = limitService.getForWorkgroup(getDataBean().getWorkgroup()); + + if (limit == null) { + return null; + } + + return limit.getLimit(); + } + + return null; + } + + public BigDecimal getWorkgroupInvoiced() { + if (getDataBean() != null && getDataBean().getWorkgroup() != null) { + BigDecimal invoiced = invoicingService.totalInvoicedForWorkgroup(getDataBean().getWorkgroup()); + + if (invoiced == null) { + return null; + } + + return invoiced; + } + + return null; + } } diff --git a/src/main/webapp/app/template.zhtml b/src/main/webapp/app/template.zhtml index ed254032..8f424268 100644 --- a/src/main/webapp/app/template.zhtml +++ b/src/main/webapp/app/template.zhtml @@ -51,6 +51,6 @@
- + \ No newline at end of file diff --git a/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul b/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul index 41b40f48..0660febb 100644 --- a/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul +++ b/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul @@ -205,7 +205,14 @@