V agendách pro schválení materiálu a služeb se na záložce "Mé komise" objevuje informace o vyčerpaném limitu komise.

master
Josef Rokos 6 years ago
parent e55d7ad07f
commit 2a48f440af

@ -1,8 +1,11 @@
package info.bukova.isspst.ui.main.orders.requirements; 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.Requirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.RequirementFilter; 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.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;
@ -25,6 +28,12 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
@WireVariable @WireVariable
protected WorkgroupService workgroupService; protected WorkgroupService workgroupService;
@WireVariable
protected LimitService limitService;
@WireVariable
protected InvoicingService invoicingService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {
return workgroupService.getCentres(); return workgroupService.getCentres();
@ -75,8 +84,36 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
} }
@Override @Override
@NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" }) @NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount", "workgroupLimit", "workgroupInvoiced" })
public void setDataBean(Requirement data) { public void setDataBean(Requirement data) {
super.setDataBean(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;
}
} }

@ -51,6 +51,6 @@
<div id="mainData"> <div id="mainData">
<u:include src="${gridZul}" /> <u:include src="${gridZul}" />
</div> </div>
<div id="footer"> Verze 4.22 </div> <div id="footer"> Verze 4.3 </div>
</div> </div>
</html> </html>

@ -205,7 +205,14 @@
<label value="${labels.RequirementInvoicedAmount}"/> <label value="${labels.RequirementInvoicedAmount}"/>
<label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/> <label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
</hbox> </hbox>
<hbox visible="@load(not empty vm.workgroupLimit)">
<label value="Limit komise "/>
<label value="@load(vm.dataBean.workgroup)"/>
<label value=" / vyčerpáno: "/>
<label value="@load(vm.workgroupLimit) @converter(vm.bigDecimalConverter)"/>
<label value=" / "/>
<label value="@load(vm.workgroupInvoiced) @converter(vm.bigDecimalConverter)"/>
</hbox>
</vbox> </vbox>
</div> </div>
</hbox> </hbox>

Loading…
Cancel
Save