Merge branch 'Verze_1.0'

Conflicts:
	src/main/webapp/WEB-INF/locales/zk-label.properties
Verze_2.0
Josef Rokos 10 years ago
commit 024f1321ad

@ -200,4 +200,22 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
super.update(order); 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);
}
} }

@ -26,4 +26,6 @@ public interface RequirementService extends RequirementBaseService<Requirement>
public RequirementItem calcItemValuesFromItemTotal(RequirementItem item); public RequirementItem calcItemValuesFromItemTotal(RequirementItem item);
public BigDecimal calcSumTotalFromItems(List<RequirementItem> items); public BigDecimal calcSumTotalFromItems(List<RequirementItem> items);
public BigDecimal getInvoicedAmount(Requirement req);
} }

@ -16,6 +16,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -240,4 +241,15 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
invoicingService.add(inv); invoicingService.add(inv);
} }
} }
@Override
@Transactional
public BigDecimal getInvoicedAmount(Requirement req) {
Query query = dao.getQuery("select invoice from Invoicing invoice join invoice.requirement rq where rq.id = :reqId");
query.setParameter("reqId", req.getId());
Invoicing inv = (Invoicing) query.uniqueResult();
return inv != null ? inv.getTotalInvoiced() : null;
}
} }

@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -64,4 +65,18 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
protected void beforeSelectViaUrl() { protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectAll", null); 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);
}
} }

@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -64,4 +65,18 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
protected void beforeSelectViaUrl() { protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectCentre", null); 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);
}
} }

@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -64,4 +65,18 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
protected void beforeSelectViaUrl() { protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null); 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);
}
} }

@ -40,6 +40,8 @@ RequirementItemUnitPrice=Jedn. cena
RequirementItemTotal=Celkem RequirementItemTotal=Celkem
RequirementItemDescription=Poznámka RequirementItemDescription=Poznámka
RequirementInvoicedAmount=Fakturovaná částka:
AgendaMyOrders=Aktuální AgendaMyOrders=Aktuální
AgendaOrdersHistory=Ukončené AgendaOrdersHistory=Ukončené

@ -32,6 +32,10 @@
<listhead menupopup="auto"> <listhead menupopup="auto">
<listheader width="27" /> <listheader width="27" />
<listheader <listheader
hflex="6"
sort="czech(requirement.numser)"
label="${labels.InvoicingRequirementNumber}" />
<listheader
hflex="7" hflex="7"
sort="czech(code)" sort="czech(code)"
label="${labels.RequirementItemCode}" /> label="${labels.RequirementItemCode}" />
@ -82,6 +86,21 @@
<auxhead visible="@load(vm.filter)"> <auxhead visible="@load(vm.filter)">
<auxheader /> <auxheader />
<auxheader> <auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.requirement.numser)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthText)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell"> <div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox"> <div sclass="find-grid-divtextbox">
<textbox <textbox
@ -268,6 +287,7 @@
<template name="model"> <template name="model">
<listitem context="popupMenu"> <listitem context="popupMenu">
<listcell /> <listcell />
<listcell label="@load(each.requirement.numser)"/>
<listcell label="@load(each.code)" /> <listcell label="@load(each.code)" />
<listcell label="@load(each.name)" /> <listcell label="@load(each.name)" />
<listcell label="@load(each.textItem)" /> <listcell label="@load(each.textItem)" />

@ -188,6 +188,14 @@
</template> </template>
</listbox> </listbox>
<div hflex="3"> <div hflex="3">
<vbox>
<include src="/main/approveStatus.zul" /> <include src="/main/approveStatus.zul" />
<hbox visible="@load(not empty vm.invoicedAmount)">
<label value="${labels.RequirementInvoicedAmount}"/>
<label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
</hbox>
</vbox>
</div> </div>
</hbox> </hbox>

@ -188,6 +188,14 @@
</template> </template>
</listbox> </listbox>
<div hflex="3"> <div hflex="3">
<vbox>
<include src="/main/approveStatus.zul" /> <include src="/main/approveStatus.zul" />
<hbox visible="@load(not empty vm.invoicedAmount)">
<label value="${labels.RequirementInvoicedAmount}"/>
<label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
</hbox>
</vbox>
</div> </div>
</hbox> </hbox>

@ -188,6 +188,14 @@
</template> </template>
</listbox> </listbox>
<div hflex="3"> <div hflex="3">
<vbox>
<include src="/main/approveStatus.zul" /> <include src="/main/approveStatus.zul" />
<hbox visible="@load(not empty vm.invoicedAmount)">
<label value="${labels.RequirementInvoicedAmount}"/>
<label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
</hbox>
</vbox>
</div> </div>
</hbox> </hbox>

Loading…
Cancel
Save