BrightSide Workbench Full Report + Source Code
org.turro.financials.model.document.contract.DocumentByContractVM Class Reference
Collaboration diagram for org.turro.financials.model.document.contract.DocumentByContractVM:

Public Member Functions

 DocumentByContractVM ()
 
Contract getContract ()
 
void setContract (Contract contract)
 
Date getFrom ()
 
void setFrom (Date from)
 
Date getTo ()
 
void setTo (Date to)
 
void update ()
 
List< DocumentPortfoliogetModel ()
 
Collection< ContractgetContractModel ()
 
String getLabel (String label)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 41 of file DocumentByContractVM.java.

Constructor & Destructor Documentation

◆ DocumentByContractVM()

org.turro.financials.model.document.contract.DocumentByContractVM.DocumentByContractVM ( )

Definition at line 47 of file DocumentByContractVM.java.

47  {
48  from = new CheckDate().addMonths(-6).getDate();
49  to = new Date();
50  }

Member Function Documentation

◆ getContract()

Contract org.turro.financials.model.document.contract.DocumentByContractVM.getContract ( )

Definition at line 52 of file DocumentByContractVM.java.

52  {
53  return contract;
54  }

◆ getContractModel()

Collection<Contract> org.turro.financials.model.document.contract.DocumentByContractVM.getContractModel ( )

Definition at line 90 of file DocumentByContractVM.java.

90  {
91  IContact contact = Authentication.getIContact();
92  if(contact != null && contact.isWebUser()) {
93  WhereClause wc = new WhereClause();
94  wc.addClause("select distinct ctc from Contract ctc");
95  wc.addClause("left join ctc.participants par");
96  wc.addClause("where ctc.active = TRUE");
97  wc.addClause("and ctc.contractDefinition.id in (48, 55, 56)");
98  if(!contact.isAdmin()) {
99  wc.addClause("and (ctc.contractor = :contractor");
100  wc.addNamedValue("contractor", contact.getId());
101  for(ContractInterventionType cit : ContractInterventionType.values()) {
102  if(cit.isShowDocuments()) {
103  wc.addClause("or (par.interventionType = :cit" + cit.toString());
104  wc.addNamedValue("cit" + cit.toString(), cit);
105  wc.addClause("and par.idContact = :con" + cit.toString() + ")");
106  wc.addNamedValue("con" + cit.toString(), contact.getId());
107  }
108  }
109  wc.addClause(")");
110  }
111  wc.addClause("order by ctc.name");
112  return new FinancialsPU().getResultList(wc);
113  } else {
114  return Collections.EMPTY_LIST;
115  }
116  }
Here is the call graph for this function:

◆ getFrom()

Date org.turro.financials.model.document.contract.DocumentByContractVM.getFrom ( )

Definition at line 60 of file DocumentByContractVM.java.

60  {
61  return from;
62  }

◆ getLabel()

String org.turro.financials.model.document.contract.DocumentByContractVM.getLabel ( String  label)

Definition at line 118 of file DocumentByContractVM.java.

118  {
119  return I_.get(label);
120  }
Here is the call graph for this function:

◆ getModel()

List<DocumentPortfolio> org.turro.financials.model.document.contract.DocumentByContractVM.getModel ( )

Definition at line 80 of file DocumentByContractVM.java.

80  {
81  if(contract != null && from != null && to != null) {
82  documents = new DocumentByContractList();
83  ContractPortfolioList cpl = new ContractPortfolioList(documents, null, contract, from, to);
84  return new ArrayList(cpl);
85  } else {
86  return Collections.EMPTY_LIST;
87  }
88  }

◆ getTo()

Date org.turro.financials.model.document.contract.DocumentByContractVM.getTo ( )

Definition at line 68 of file DocumentByContractVM.java.

68  {
69  return to;
70  }

◆ setContract()

void org.turro.financials.model.document.contract.DocumentByContractVM.setContract ( Contract  contract)

Definition at line 56 of file DocumentByContractVM.java.

56  {
57  this.contract = contract;
58  }

◆ setFrom()

void org.turro.financials.model.document.contract.DocumentByContractVM.setFrom ( Date  from)

Definition at line 64 of file DocumentByContractVM.java.

64  {
65  this.from = from;
66  }

◆ setTo()

void org.turro.financials.model.document.contract.DocumentByContractVM.setTo ( Date  to)

Definition at line 72 of file DocumentByContractVM.java.

72  {
73  this.to = to;
74  }

◆ update()

void org.turro.financials.model.document.contract.DocumentByContractVM.update ( )

Definition at line 78 of file DocumentByContractVM.java.

78 {}

The documentation for this class was generated from the following file: