BrightSide Workbench Full Report + Source Code
org.turro.financials.product.ProductUncoded Class Reference
Inheritance diagram for org.turro.financials.product.ProductUncoded:
Collaboration diagram for org.turro.financials.product.ProductUncoded:

Public Member Functions

 ProductUncoded (String description)
 
 ProductUncoded (String description, ProductByContractor productByContractor)
 
ProductByContractor getProductByContractor ()
 
void setProductByContractor (ProductByContractor productByContractor)
 
double getProductCost ()
 
double getProductCostTax ()
 
String getProductName ()
 
long getProductId ()
 
String getProductCodeStr ()
 
double getProductPrice ()
 
double getProductPriceTax ()
 
IProduct load (Object id)
 
double getProductStock (Date date, Contract store)
 
String getProductString ()
 
boolean isUncoded ()
 
Collection< MovementgetMovements ()
 
Collection< MovementgetMovements (Date from, Date to, Contract store)
 

Static Public Member Functions

static List< ProductUncodedgetProducts ()
 
static List< ProductUncodedgetProducts (String concept, boolean equality)
 
static List< String > getConcepts (String concept, boolean equality)
 

Detailed Description

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

Definition at line 34 of file ProductUncoded.java.

Constructor & Destructor Documentation

◆ ProductUncoded() [1/2]

org.turro.financials.product.ProductUncoded.ProductUncoded ( String  description)

Definition at line 41 of file ProductUncoded.java.

41  {
42  this.description = description;
43  }
Here is the caller graph for this function:

◆ ProductUncoded() [2/2]

org.turro.financials.product.ProductUncoded.ProductUncoded ( String  description,
ProductByContractor  productByContractor 
)

Definition at line 45 of file ProductUncoded.java.

45  {
46  this.description = description;
47  this.productByContractor = productByContractor;
48  }

Member Function Documentation

◆ getConcepts()

static List<String> org.turro.financials.product.ProductUncoded.getConcepts ( String  concept,
boolean  equality 
)
static

Definition at line 246 of file ProductUncoded.java.

246  {
247  WhereClause wc = new WhereClause();
248  wc.addClause("select distinct dl.concept");
249  getConceptsQuery(wc, concept, equality);
250  List<String> list = new FinancialsPU().getResultList(wc);
251  return list;
252  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMovements() [1/2]

Collection<Movement> org.turro.financials.product.ProductUncoded.getMovements ( )

Implements org.turro.financials.product.IProduct.

Definition at line 142 of file ProductUncoded.java.

142  {
143  WhereClause wc = new WhereClause();
144  wc.addClause("select new org.turro.financials.product.Movement");
145  wc.addClause("(dl.document.contract, dl.document.documentDate,");
146  wc.addClause("dl.lineType.stockCoefficient,dl.quantity,dl.price,dl.concept)");
147  wc.addClause("from DocumentLine dl");
148  wc.addClause("where dl.product is null");
149  wc.addClause("and dl.productByContractor is null");
150  wc.addClause("and dl.concept = :concept");
151  wc.addNamedValue("concept", description);
152  wc.addClause("and dl.quantity <> 0");
153  wc.addClause("order by dl.document.receiptDate desc, dl.lineOrder");
154  return new FinancialsPU().getResultList(wc, 100);
155  }
Here is the call graph for this function:

◆ getMovements() [2/2]

Collection<Movement> org.turro.financials.product.ProductUncoded.getMovements ( Date  from,
Date  to,
Contract  store 
)

Implements org.turro.financials.product.IProduct.

Definition at line 158 of file ProductUncoded.java.

158  {
159  WhereClause wc = new WhereClause();
160  wc.addClause("select new org.turro.financials.product.Movement");
161  wc.addClause("('Accumulated',coalesce(sum(dl.quantity*dl.lineType.stockCoefficient),0.0),coalesce(sum(dl.quantity*dl.price*dl.lineType.stockCoefficient),0.0))");
162  wc.addClause("from DocumentLine dl");
163  wc.addClause("where dl.product is null");
164  if(store != null) {
165  wc.addClause("and dl.store = :store");
166  wc.addNamedValue("store", store);
167  }
168  wc.addClause("and dl.productByContractor is null");
169  wc.addClause("and dl.concept = :concept");
170  wc.addNamedValue("concept", description);
171  wc.addClause("and dl.quantity <> 0");
172  wc.addClause("and dl.document.receiptDate < :from2");
173  wc.addNamedValue("from2", from);
174  Collection<Movement> movs = new FinancialsPU().getResultList(wc);
175  wc = new WhereClause();
176  wc.addClause("select new org.turro.financials.product.Movement");
177  wc.addClause("(dl.document.contract, dl.document.documentDate,");
178  wc.addClause("dl.lineType.stockCoefficient,dl.quantity,dl.price,dl.concept)");
179  wc.addClause("from DocumentLine dl");
180  wc.addClause("where dl.product is null");
181  if(store != null) {
182  wc.addClause("and dl.store = :store");
183  wc.addNamedValue("store", store);
184  }
185  wc.addClause("and dl.productByContractor is null");
186  wc.addClause("and dl.concept = :concept");
187  wc.addNamedValue("concept", description);
188  wc.addClause("and dl.quantity <> 0");
189  wc.addClause("and dl.document.receiptDate >= :from2");
190  wc.addNamedValue("from2", from);
191  if(to != null) {
192  wc.addClause("and dl.document.receiptDate <= :to2");
193  wc.addNamedValue("to2", to);
194  }
195  wc.addClause("order by dl.document.receiptDate asc, dl.lineOrder");
196  movs.addAll(new FinancialsPU().getResultList(wc));
197  return movs;
198  }
Here is the call graph for this function:

◆ getProductByContractor()

ProductByContractor org.turro.financials.product.ProductUncoded.getProductByContractor ( )

Implements org.turro.financials.product.IProduct.

Definition at line 51 of file ProductUncoded.java.

51  {
52  return productByContractor;
53  }

◆ getProductCodeStr()

String org.turro.financials.product.ProductUncoded.getProductCodeStr ( )

Implements org.turro.financials.product.IProduct.

Definition at line 84 of file ProductUncoded.java.

84  {
85  return description;
86  }

◆ getProductCost()

double org.turro.financials.product.ProductUncoded.getProductCost ( )

Implements org.turro.financials.product.IProduct.

Definition at line 61 of file ProductUncoded.java.

61  {
62  if(cost == null) {
63  loadCostData();
64  }
65  return cost;
66  }

◆ getProductCostTax()

double org.turro.financials.product.ProductUncoded.getProductCostTax ( )

Implements org.turro.financials.product.IProduct.

Definition at line 69 of file ProductUncoded.java.

69  {
70  return costTax;
71  }

◆ getProductId()

long org.turro.financials.product.ProductUncoded.getProductId ( )

Implements org.turro.financials.product.IProduct.

Definition at line 79 of file ProductUncoded.java.

79  {
80  return -1;
81  }

◆ getProductName()

String org.turro.financials.product.ProductUncoded.getProductName ( )

Implements org.turro.financials.product.IProduct.

Definition at line 74 of file ProductUncoded.java.

74  {
75  return description;
76  }

◆ getProductPrice()

double org.turro.financials.product.ProductUncoded.getProductPrice ( )

Implements org.turro.financials.product.IProduct.

Definition at line 89 of file ProductUncoded.java.

89  {
90  if(price == null) {
91  loadPriceData();
92  }
93  return price;
94  }

◆ getProductPriceTax()

double org.turro.financials.product.ProductUncoded.getProductPriceTax ( )

Implements org.turro.financials.product.IProduct.

Definition at line 97 of file ProductUncoded.java.

97  {
98  return priceTax;
99  }

◆ getProducts() [1/2]

static List<ProductUncoded> org.turro.financials.product.ProductUncoded.getProducts ( )
static

Definition at line 234 of file ProductUncoded.java.

234  {
235  return getProducts(null, false);
236  }
static List< ProductUncoded > getProducts()
Here is the caller graph for this function:

◆ getProducts() [2/2]

static List<ProductUncoded> org.turro.financials.product.ProductUncoded.getProducts ( String  concept,
boolean  equality 
)
static

Definition at line 238 of file ProductUncoded.java.

238  {
239  List<ProductUncoded> l = new ArrayList<ProductUncoded>();
240  for(String cp : getConcepts(concept, equality)) {
241  l.add(new ProductUncoded(cp));
242  }
243  return l;
244  }
static List< String > getConcepts(String concept, boolean equality)
Here is the call graph for this function:

◆ getProductStock()

double org.turro.financials.product.ProductUncoded.getProductStock ( Date  date,
Contract  store 
)

Implements org.turro.financials.product.IProduct.

Definition at line 112 of file ProductUncoded.java.

112  {
113  WhereClause wc = new WhereClause();
114  wc.addClause("select sum(quantity) ");
115  wc.addClause("from DocumentLine dl");
116  wc.addClause("where dl.document.receiptDate = :date");
117  wc.addNamedValue("date", date);
118  if(store != null) {
119  wc.addClause("and dl.store = :store");
120  wc.addNamedValue("store", store);
121  }
122  wc.addClause("and dl.product is null");
123  wc.addClause("and dl.productByContractor is null");
124  wc.addClause("and dl.lineType.stockCoefficient <> 0");
125  wc.addClause("and dl.quantity <> 0");
126  wc.addClause("and dl.concept = :concept");
127  wc.addNamedValue("concept", description);
128  return (Double) new FinancialsPU().getSingleResultOrNull(wc);
129  }
Here is the call graph for this function:

◆ getProductString()

String org.turro.financials.product.ProductUncoded.getProductString ( )

Implements org.turro.financials.product.IProduct.

Definition at line 132 of file ProductUncoded.java.

132  {
133  return description;
134  }

◆ isUncoded()

boolean org.turro.financials.product.ProductUncoded.isUncoded ( )

Implements org.turro.financials.product.IProduct.

Definition at line 137 of file ProductUncoded.java.

137  {
138  return true;
139  }

◆ load()

IProduct org.turro.financials.product.ProductUncoded.load ( Object  id)

Implements org.turro.financials.product.IProduct.

Definition at line 102 of file ProductUncoded.java.

102  {
103  this.description = (String) id;
104  this.cost = null;
105  this.costTax = null;
106  this.price = null;
107  this.priceTax = null;
108  return this;
109  }

◆ setProductByContractor()

void org.turro.financials.product.ProductUncoded.setProductByContractor ( ProductByContractor  productByContractor)

Implements org.turro.financials.product.IProduct.

Definition at line 56 of file ProductUncoded.java.

56  {
57  this.productByContractor = productByContractor;
58  }

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