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