From d9fd26bbadba009d675955f778d27d504d90cc41 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Tue, 20 Jan 2015 14:11:59 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Ve=20schv=C3=A1len=C3=BDch=20polo=C5=BEk?= =?UTF-8?q?=C3=A1ch=20po=C5=BEadavk=C5=AF=20byl=20do=20gridu=20p=C5=99idan?= =?UTF-8?q?=C3=BD=20sloupec=20s=20=C4=8D=C3=ADslem=20po=C5=BEadavku.=20clo?= =?UTF-8?q?ses=20#192?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/locales/zk-label.properties | 2 +- src/main/webapp/main/orders/approved/grid.zul | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 7fe9c936..47672f56 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -360,4 +360,4 @@ WorkgroupFormOrderLimit=Limit nákupů WorkgroupIsInWorkgroup=Komisi nelze smazat, protože je členem některého střediska GoogleDriveUrl=Odkaz na Google Drive -Help=Pomoc +Help=Příručka diff --git a/src/main/webapp/main/orders/approved/grid.zul b/src/main/webapp/main/orders/approved/grid.zul index 77bbc099..33d27a2d 100644 --- a/src/main/webapp/main/orders/approved/grid.zul +++ b/src/main/webapp/main/orders/approved/grid.zul @@ -32,6 +32,10 @@ + @@ -82,6 +86,21 @@ +
+
+ +
+
+ +
+
+
+
+ From 4e2b00a957c33863229916c4e59e2dc3c5ce2058 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Tue, 20 Jan 2015 15:19:51 +0100 Subject: [PATCH 2/2] =?UTF-8?q?U=20po=C5=BEadavk=C5=AF=20se=20nyn=C3=AD=20?= =?UTF-8?q?zobrazuje=20fakturovan=C3=A1=20=C4=8D=C3=A1stka.=20Opraveno=20m?= =?UTF-8?q?az=C3=A1n=C3=AD=20objedn=C3=A1vek-=20pokud=20je=20mazan=C3=A1?= =?UTF-8?q?=20objedn=C3=A1vka=20ozna=C4=8Den=C3=A1=20jako=20objednan=C3=A1?= =?UTF-8?q?,=20mus=C3=ADme=20z=20polo=C5=BEek=20smazat=20=C4=8D=C3=ADslo?= =?UTF-8?q?=20objedn=C3=A1vky,=20aby=20se=20nab=C3=ADdly=20pro=20dal=C5=A1?= =?UTF-8?q?=C3=AD=20objedn=C3=A1vku.=20closes=20#193?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/orders/OrderServiceImpl.java | 18 ++++++++++++++++++ .../requirement/RequirementService.java | 2 ++ .../requirement/RequirementServiceImpl.java | 12 ++++++++++++ .../main/orders/requirements/ReqListMyAll.java | 15 +++++++++++++++ .../orders/requirements/ReqListMyCenters.java | 15 +++++++++++++++ .../requirements/ReqListMyWorkgroups.java | 15 +++++++++++++++ .../webapp/WEB-INF/locales/zk-label.properties | 2 ++ .../main/orders/requirements/reqListMyAll.zul | 10 +++++++++- .../orders/requirements/reqListMyCenters.zul | 10 +++++++++- .../requirements/reqListMyWorkgroups.zul | 10 +++++++++- 10 files changed, 106 insertions(+), 3 deletions(-) diff --git a/src/main/java/info/bukova/isspst/services/orders/OrderServiceImpl.java b/src/main/java/info/bukova/isspst/services/orders/OrderServiceImpl.java index 42f5ab84..2e0b1e69 100644 --- a/src/main/java/info/bukova/isspst/services/orders/OrderServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/orders/OrderServiceImpl.java @@ -200,4 +200,22 @@ public class OrderServiceImpl extends AbstractOwnedService implements super.update(order); } + + @Override + @Transactional + @PreAuthorize("hasPermission(this, 'PERM_DELETE') or hasPermission(#entity, this.getDeleteEntityPermission())") + public void delete(Order order) { + for (OrderItem item : order.getItems()) + { + RequirementItem rItem = item.getReqItem(); + + if (rItem != null) + { + rItem.setOrderNum(null); + requirementItemDao.modify(rItem); + } + } + + super.delete(order); + } } diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java index 770e69d1..6c99d859 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java @@ -26,4 +26,6 @@ public interface RequirementService extends RequirementBaseService public RequirementItem calcItemValuesFromItemTotal(RequirementItem item); public BigDecimal calcSumTotalFromItems(List items); + + public BigDecimal getInvoicedAmount(Requirement req); } diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java index 87b3fdd6..a97f078d 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java @@ -16,6 +16,7 @@ import java.util.Date; import java.util.List; import org.hibernate.Hibernate; +import org.hibernate.Query; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; @@ -240,4 +241,15 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl protected void beforeSelectViaUrl() { BindUtils.postGlobalCommand(null, null, "selectAll", null); } + + public BigDecimal getInvoicedAmount() { + if (getDataBean() != null) { + return requirementService.getInvoicedAmount(getDataBean()); + } else { + return null; + } + } + + @Override + @NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" }) + public void setDataBean(Requirement data) { + super.setDataBean(data); + } } diff --git a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java index 0c116134..af243b72 100644 --- a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java +++ b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java @@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.ui.requirement.RequirementSubpage; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -64,4 +65,18 @@ public class ReqListMyCenters extends RequirementSubpage protected void beforeSelectViaUrl() { BindUtils.postGlobalCommand(null, null, "selectCentre", null); } + + public BigDecimal getInvoicedAmount() { + if (getDataBean() != null) { + return requirementService.getInvoicedAmount(getDataBean()); + } else { + return null; + } + } + + @Override + @NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" }) + public void setDataBean(Requirement data) { + super.setDataBean(data); + } } 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 90e0a2c2..22b7af87 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 @@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.ui.requirement.RequirementSubpage; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -64,4 +65,18 @@ public class ReqListMyWorkgroups extends RequirementSubpage protected void beforeSelectViaUrl() { BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null); } + + public BigDecimal getInvoicedAmount() { + if (getDataBean() != null) { + return requirementService.getInvoicedAmount(getDataBean()); + } else { + return null; + } + } + + @Override + @NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" }) + public void setDataBean(Requirement data) { + super.setDataBean(data); + } } diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 47672f56..709389c5 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -40,6 +40,8 @@ RequirementItemUnitPrice=Jedn. cena RequirementItemTotal=Celkem RequirementItemDescription=Poznámka +RequirementInvoicedAmount=Fakturovaná částka: + AgendaMyOrders=Aktuální AgendaOrdersHistory=Ukončené diff --git a/src/main/webapp/main/orders/requirements/reqListMyAll.zul b/src/main/webapp/main/orders/requirements/reqListMyAll.zul index 336536c8..7e827ccf 100644 --- a/src/main/webapp/main/orders/requirements/reqListMyAll.zul +++ b/src/main/webapp/main/orders/requirements/reqListMyAll.zul @@ -188,6 +188,14 @@
- + + + + + + +
diff --git a/src/main/webapp/main/orders/requirements/reqListMyCenters.zul b/src/main/webapp/main/orders/requirements/reqListMyCenters.zul index 336536c8..98582b47 100644 --- a/src/main/webapp/main/orders/requirements/reqListMyCenters.zul +++ b/src/main/webapp/main/orders/requirements/reqListMyCenters.zul @@ -188,6 +188,14 @@
- + + + + + + +
diff --git a/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul b/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul index 44a57fd7..12e32e86 100644 --- a/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul +++ b/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul @@ -188,6 +188,14 @@
- + + + + + + +