19 package org.turro.financials.model.document.contract;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.Collections;
24 import java.util.Date;
25 import java.util.List;
26 import org.amic.util.date.CheckDate;
27 import org.turro.auth.Authentication;
28 import org.turro.elephant.db.WhereClause;
29 import org.turro.financials.db.FinancialsPU;
30 import org.turro.financials.entity.Contract;
31 import org.turro.financials.entity.ContractInterventionType;
32 import org.turro.i18n.I_;
33 import org.turro.plugin.contacts.IContact;
34 import org.zkoss.bind.annotation.Command;
35 import org.zkoss.bind.annotation.NotifyChange;
45 private Date from, to;
48 from =
new CheckDate().addMonths(-6).getDate();
57 this.contract = contract;
76 @NotifyChange(
"model")
81 if(contract !=
null && from !=
null && to !=
null) {
84 return new ArrayList(cpl);
86 return Collections.EMPTY_LIST;
92 if(contact !=
null && contact.
isWebUser()) {
94 wc.
addClause(
"select distinct ctc from Contract ctc");
95 wc.
addClause(
"left join ctc.participants par");
97 wc.
addClause(
"and ctc.contractDefinition.id in (48, 55, 56)");
99 wc.
addClause(
"and (ctc.contractor = :contractor");
102 if(cit.isShowDocuments()) {
103 wc.
addClause(
"or (par.interventionType = :cit" + cit.toString());
105 wc.
addClause(
"and par.idContact = :con" + cit.toString() +
")");
114 return Collections.EMPTY_LIST;
119 return I_.
get(label);
static IContact getIContact()
void addClause(String clause)
void addNamedValue(String name, Object value)
Collection< Contract > getContractModel()
List< DocumentPortfolio > getModel()
void setContract(Contract contract)
String getLabel(String label)
static String get(String msg)