19 package org.turro.erp.command;
21 import java.util.Collection;
22 import org.turro.annotation.ElephantPlugin;
23 import org.turro.collections.ItemOf;
24 import org.turro.collections.SetOf;
25 import org.turro.plugin.command.CustomerSummaryPlugin;
26 import org.turro.elephant.context.Application;
27 import org.turro.elephant.db.SQLHelper;
28 import org.turro.elephant.db.WhereClause;
29 import org.turro.elephant.util.Images;
30 import org.turro.erp.db.ErpPU;
31 import org.turro.erp.entity.WorkOrder;
32 import org.turro.financials.contract.logic.ContractWrapper;
33 import org.turro.financials.entity.Contract;
34 import org.turro.zkoss.label.LabelTypes;
35 import org.turro.zkoss.layout.GroupboxArrow;
36 import org.zkoss.zul.Hlayout;
37 import org.zkoss.zul.Image;
38 import org.zkoss.zul.Include;
47 private Collection<WorkOrder> active;
53 if(!active.isEmpty()) {
56 protected void doFillContent() {
59 Hlayout hbox =
new Hlayout();
61 hbox.setSclass(
"z-valign-middle");
62 hbox.setValign(
"middle");
66 Include report =
new Include(
"/WEB-INF/_zul/erp/sales/customerSummary.zul");
67 report.setDynamicProperty(
"active", active);
68 gba.appendChild(report);
74 private void activeWorkOrders() {
76 String inCtc =
SQLHelper.
convertToIn(
new SetOf<Contract, Long>(contracts,
new ItemOf<Contract, Long>() {
82 WhereClause wc =
new WhereClause();
83 wc.addClause(
"select distinct workord from WorkOrder as workord");
84 wc.addClause(
"where workord.contractId in (" + inCtc +
")");
85 active =
new ErpPU().getResultList(wc);
Object addResult(String key, Object value)
static Application getApplication()
static String getString(String key)
static String convertToIn(Collection collection)
static String getImage(String image)
static Collection< Contract > getContracts(ContractDefinition contractDefinition)
static Label getPreLabel(String value)
static Label getSoftLabel(String value)
void setCaption(Component comp)
void setOpen(boolean open)