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);
}
@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 BigDecimal calcSumTotalFromItems(List<RequirementItem> items);
public BigDecimal getInvoicedAmount(Requirement req);
}

@ -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<Requireme
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.ui.requirement.RequirementSubpage;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -64,4 +65,18 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
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);
}
}

@ -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<Requirement>
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);
}
}

@ -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<Requirement>
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);
}
}

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

@ -32,6 +32,10 @@
<listhead menupopup="auto">
<listheader width="27" />
<listheader
hflex="6"
sort="czech(requirement.numser)"
label="${labels.InvoicingRequirementNumber}" />
<listheader
hflex="7"
sort="czech(code)"
label="${labels.RequirementItemCode}" />
@ -82,6 +86,21 @@
<auxhead visible="@load(vm.filter)">
<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-divtextbox">
<textbox
@ -268,6 +287,7 @@
<template name="model">
<listitem context="popupMenu">
<listcell />
<listcell label="@load(each.requirement.numser)"/>
<listcell label="@load(each.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.textItem)" />

@ -188,6 +188,14 @@
</template>
</listbox>
<div hflex="3">
<vbox>
<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>
</hbox>

@ -188,6 +188,14 @@
</template>
</listbox>
<div hflex="3">
<vbox>
<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>
</hbox>

@ -188,6 +188,14 @@
</template>
</listbox>
<div hflex="3">
<vbox>
<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>
</hbox>

Loading…
Cancel
Save