BrightSide Workbench Full Report + Source Code
org.turro.crm.search.InactiveProspects Class Reference

Public Member Functions

 InactiveProspects ()
 
java.util.List< SaleProspectgetObjectValues (Vendor vendor)
 
WhereClause createCriteria (Vendor vendor)
 

Detailed Description

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

Definition at line 33 of file InactiveProspects.java.

Constructor & Destructor Documentation

◆ InactiveProspects()

org.turro.crm.search.InactiveProspects.InactiveProspects ( )

Definition at line 35 of file InactiveProspects.java.

35  {
36  }

Member Function Documentation

◆ createCriteria()

WhereClause org.turro.crm.search.InactiveProspects.createCriteria ( Vendor  vendor)

Definition at line 42 of file InactiveProspects.java.

42  {
43  WhereClause wc = new WhereClause();
44  wc.addClause("select distinct salep from SaleProspect as salep");
45  if(!Application.getApplication().isInRole("sale-prospect:all")) {
46  vendor = vendor == null ? VendorUtil.getCurrent() : vendor;
47  if(vendor == null) {
48  wc.addClause("where 1=2");
49  return wc;
50  }
51  }
52  if(vendor != null) {
53  wc.addClause("left join salep.vendorProspects vendorp");
54  wc.addClause("left join salep.customer.ownedBy vendoro");
55  wc.addClause("where (vendorp.vendor = :vendorlimp");
56  wc.addClause("or vendoro.vendor = :vendorlimo)");
57  wc.addNamedValue("vendorlimp", vendor);
58  wc.addNamedValue("vendorlimo", vendor);
59  } else {
60  wc.addClause("where 1=1");
61  }
62  wc.addClause("and salep.stage <> :close_won");
63  wc.addNamedValue("close_won", ProspectStage.CLOSED_WON);
64  wc.addClause("and salep.stage <> :close_lost");
65  wc.addNamedValue("close_lost", ProspectStage.CLOSED_LOST);
66  wc.addClause("and not exists (");
67  wc.addClause("select sa from SaleAction sa");
68  wc.addClause("where sa.vendorProspect.saleProspect = salep");
69  wc.addClause("and sa.status = 0");
70  wc.addClause(")");
71  wc.addClause("order by salep.prospectDate");
72  return wc;
73  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObjectValues()

java.util.List<SaleProspect> org.turro.crm.search.InactiveProspects.getObjectValues ( Vendor  vendor)

Definition at line 38 of file InactiveProspects.java.

38  {
39  return new CrmPU().getResultList(createCriteria(vendor));
40  }
WhereClause createCriteria(Vendor vendor)
Here is the call graph for this function:

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