18 package org.turro.financials.contract;
20 import java.util.LinkedList;
21 import java.util.List;
22 import org.turro.elephant.db.WhereClause;
23 import org.turro.financials.db.FinancialsPU;
24 import org.turro.financials.entity.Contract;
25 import org.turro.financials.entity.ContractDefinition;
26 import org.turro.financials.entity.DocumentDefinition;
27 import org.turro.financials.model.contract.ContractWrapper;
28 import org.turro.jpa.Dao;
29 import org.turro.zkoss.input.GenericCombobox;
37 private boolean onlyStores, onlyActive;
46 this.onlyActive = onlyActive;
54 this.onlyStores = onlyStores;
58 this.contractDefinition = contractDefinition;
62 this.documentDefinition = documentDefinition;
66 public void populateList(String value, LinkedList list,
int nRows) {
69 wc.
addClause(
"select contract from Contract as contract");
72 wc.
addClause(
"and contract.stock = TRUE");
74 if(contractDefinition !=
null) {
75 wc.
addClause(
"and contract.contractDefinition = :ctcdef");
78 if(documentDefinition !=
null) {
80 wc.
addClause(
" select reldoc from contract.contractDefinition.relatedDocuments as reldoc");
81 wc.
addClause(
" where reldoc.documentDefinition = :docdef");
87 List<Contract> l = dao.getResultList(wc, nRows);
void addClause(String clause)
void addLikeFields(String[] fields, String value)
void addNamedValue(String name, Object value)
String getTextFromObject(Contract value)
void populateList(String value, LinkedList list, int nRows)
void setOnlyStores(boolean onlyStores)
void setDocumentDefinition(DocumentDefinition documentDefinition)
void setOnlyActive(boolean onlyActive)
void setContractDefinition(ContractDefinition contractDefinition)
static void clearInactives(Collection< Contract > contracts)