BrightSide Workbench Full Report + Source Code
org.turro.erp.entity.OrderItem Class Reference
Inheritance diagram for org.turro.erp.entity.OrderItem:
Collaboration diagram for org.turro.erp.entity.OrderItem:

Public Member Functions

double getCost ()
 
void setCost (double cost)
 
boolean isCostMaximum ()
 
void setCostMaximum (boolean costMaximum)
 
double getDedication ()
 
void setDedication (double dedication)
 
Date getDelivery ()
 
void setDelivery (Date delivery)
 
String getDescription ()
 
void setDescription (String description)
 
Date getDocumentDate ()
 
void setDocumentDate (Date documentDate)
 
long getDocumentLineId ()
 
void setDocumentLineId (long documentLineId)
 
String getDocumentNumber ()
 
void setDocumentNumber (String documentNumber)
 
double getUnits ()
 
void setUnits (double units)
 
HumanResource getHumanResource ()
 
void setHumanResource (HumanResource humanResource)
 
long getId ()
 
void setId (long id)
 
double getMaxCost ()
 
void setMaxCost (double maxCost)
 
String getProductDescription ()
 
void setProductDescription (String productDescription)
 
long getProductId ()
 
void setProductId (long productId)
 
boolean isProviderFixed ()
 
void setProviderFixed (boolean providerFixed)
 
long getProviderId ()
 
void setProviderId (long providerId)
 
long getProviderProductId ()
 
void setProviderProductId (long providerProductId)
 
Set< ReceiptItemgetReceiptItems ()
 
Set< ReceiptItemgetUpdatedReceiptItems ()
 
void setReceiptItems (Set< ReceiptItem > receiptItems)
 
OrderItem getRelated ()
 
void setRelated (OrderItem related)
 
RequiredUsage getRequiredUsage ()
 
void setRequiredUsage (RequiredUsage requiredUsage)
 
Resource getResource ()
 
void setResource (Resource resource)
 
boolean isSent ()
 
void setSent (boolean sent)
 
double getTax ()
 
void setTax (double tax)
 
DocumentLine getDocumentLine ()
 
void setDocumentLine (DocumentLine documentLine)
 
Product getProduct ()
 
void setProduct (Product product)
 
IProduct getIProduct ()
 
void setIProduct (IProduct product)
 
Contract getProvider ()
 
void setProvider (Contract provider)
 
ProductByContractor getProviderProduct ()
 
void setProviderProduct (ProductByContractor providerProduct)
 
boolean isEmpty ()
 
OrderItem getOwner ()
 
RequiredUsage getOwnerRequiredUsage ()
 
String getName ()
 
String getType ()
 
double getAmount ()
 
ReceiptItem startReceipt (Date startWorking)
 
ReceiptItem startReceipt (Date startWorking, double receiptUnits)
 
OrderStatus getStatus ()
 
double getRealDedication ()
 
double getExpectedUnits ()
 
double getRealUnits ()
 
double getRealAmount ()
 
double convertToReal (double d)
 
boolean hasReceipts ()
 

Detailed Description

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

Definition at line 42 of file OrderItem.java.

Member Function Documentation

◆ convertToReal()

double org.turro.erp.entity.OrderItem.convertToReal ( double  d)

Definition at line 492 of file OrderItem.java.

492  {
493  return d / dedication;
494  }

◆ getAmount()

double org.turro.erp.entity.OrderItem.getAmount ( )

Definition at line 405 of file OrderItem.java.

405  {
406  return cost * units * dedication;
407  }
Here is the caller graph for this function:

◆ getCost()

double org.turro.erp.entity.OrderItem.getCost ( )

Definition at line 85 of file OrderItem.java.

85  {
86  return cost;
87  }
Here is the caller graph for this function:

◆ getDedication()

double org.turro.erp.entity.OrderItem.getDedication ( )

Definition at line 101 of file OrderItem.java.

101  {
102  return dedication;
103  }
Here is the caller graph for this function:

◆ getDelivery()

Date org.turro.erp.entity.OrderItem.getDelivery ( )

Definition at line 109 of file OrderItem.java.

109  {
110  return delivery;
111  }
Here is the caller graph for this function:

◆ getDescription()

String org.turro.erp.entity.OrderItem.getDescription ( )

Definition at line 117 of file OrderItem.java.

117  {
118  return description;
119  }
Here is the caller graph for this function:

◆ getDocumentDate()

Date org.turro.erp.entity.OrderItem.getDocumentDate ( )

Definition at line 125 of file OrderItem.java.

125  {
126  return documentDate;
127  }
Here is the caller graph for this function:

◆ getDocumentLine()

DocumentLine org.turro.erp.entity.OrderItem.getDocumentLine ( )

Definition at line 291 of file OrderItem.java.

291  {
292  return documentLine.getEntity(documentLineId);
293  }

◆ getDocumentLineId()

long org.turro.erp.entity.OrderItem.getDocumentLineId ( )

Definition at line 133 of file OrderItem.java.

133  {
134  return documentLineId;
135  }

◆ getDocumentNumber()

String org.turro.erp.entity.OrderItem.getDocumentNumber ( )

Definition at line 141 of file OrderItem.java.

141  {
142  return documentNumber;
143  }
Here is the caller graph for this function:

◆ getExpectedUnits()

double org.turro.erp.entity.OrderItem.getExpectedUnits ( )

Definition at line 472 of file OrderItem.java.

472  {
473  return units * dedication;
474  }

◆ getHumanResource()

HumanResource org.turro.erp.entity.OrderItem.getHumanResource ( )

Definition at line 157 of file OrderItem.java.

157  {
158  return humanResource;
159  }
Here is the caller graph for this function:

◆ getId()

long org.turro.erp.entity.OrderItem.getId ( )

Definition at line 165 of file OrderItem.java.

165  {
166  return id;
167  }
Here is the caller graph for this function:

◆ getIProduct()

IProduct org.turro.erp.entity.OrderItem.getIProduct ( )

Definition at line 317 of file OrderItem.java.

317  {
318  return iproduct.getIProduct(new IProductKey(productId, providerId, providerProductId, productDescription));
319  }
IProduct getIProduct(IProductKey productKey)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMaxCost()

double org.turro.erp.entity.OrderItem.getMaxCost ( )

Definition at line 173 of file OrderItem.java.

173  {
174  return maxCost;
175  }
Here is the caller graph for this function:

◆ getName()

String org.turro.erp.entity.OrderItem.getName ( )

Definition at line 384 of file OrderItem.java.

384  {
385  if(humanResource != null) {
386  return humanResource.getName();
387  } else if(resource != null) {
388  return resource.getName();
389  } else {
390  IProduct product = getIProduct();
391  return product != null ? product.getProductName() : null;
392  }
393  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOwner()

OrderItem org.turro.erp.entity.OrderItem.getOwner ( )

Definition at line 367 of file OrderItem.java.

367  {
368  return (OrderItem) new ErpPU().getSingleResultOrNull(
369  "select oi from OrderItem oi " +
370  "where related = ?",
371  new Object[] { this });
372  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOwnerRequiredUsage()

RequiredUsage org.turro.erp.entity.OrderItem.getOwnerRequiredUsage ( )

Definition at line 374 of file OrderItem.java.

374  {
375  if(requiredUsage == null) {
376  OrderItem oi = getOwner();
377  if(oi != null) {
378  return oi.getRequiredUsage();
379  }
380  }
381  return requiredUsage;
382  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProduct()

Product org.turro.erp.entity.OrderItem.getProduct ( )

Definition at line 307 of file OrderItem.java.

307  {
308  return product.getEntity(productId);
309  }

◆ getProductDescription()

String org.turro.erp.entity.OrderItem.getProductDescription ( )

Definition at line 181 of file OrderItem.java.

181  {
182  return productDescription;
183  }

◆ getProductId()

long org.turro.erp.entity.OrderItem.getProductId ( )

Definition at line 189 of file OrderItem.java.

189  {
190  return productId;
191  }

◆ getProvider()

Contract org.turro.erp.entity.OrderItem.getProvider ( )

Definition at line 337 of file OrderItem.java.

337  {
338  return provider.getEntity(providerId);
339  }
Here is the caller graph for this function:

◆ getProviderId()

long org.turro.erp.entity.OrderItem.getProviderId ( )

Definition at line 205 of file OrderItem.java.

205  {
206  return providerId;
207  }
Here is the caller graph for this function:

◆ getProviderProduct()

ProductByContractor org.turro.erp.entity.OrderItem.getProviderProduct ( )

Definition at line 353 of file OrderItem.java.

353  {
354  return providerProduct.getEntity(providerProductId);
355  }

◆ getProviderProductId()

long org.turro.erp.entity.OrderItem.getProviderProductId ( )

Definition at line 213 of file OrderItem.java.

213  {
214  return providerProductId;
215  }

◆ getRealAmount()

double org.turro.erp.entity.OrderItem.getRealAmount ( )

Definition at line 484 of file OrderItem.java.

484  {
485  double q = 0.0d;
486  for(ReceiptItem ri : getReceiptItems()) {
487  q += ri.getAmount();
488  }
489  return q;
490  }
Set< ReceiptItem > getReceiptItems()
Definition: OrderItem.java:221
Here is the call graph for this function:

◆ getRealDedication()

double org.turro.erp.entity.OrderItem.getRealDedication ( )

Definition at line 461 of file OrderItem.java.

461  {
462  double q = 0.0d, d = 0.0d;
463  if(humanResource != null) {
464  for(ReceiptItem ri : getReceiptItems()) {
465  q += ri.getUnits();
466  d += ri.getUnits() * ri.getDedication();
467  }
468  }
469  return q != 0.0d ? d / q : 1.0d;
470  }
Here is the call graph for this function:

◆ getRealUnits()

double org.turro.erp.entity.OrderItem.getRealUnits ( )

Definition at line 476 of file OrderItem.java.

476  {
477  double q = 0.0d;
478  for(ReceiptItem ri : getReceiptItems()) {
479  q += ri.getUnits() * ri.getDedication();
480  }
481  return q;
482  }
Here is the call graph for this function:

◆ getReceiptItems()

Set<ReceiptItem> org.turro.erp.entity.OrderItem.getReceiptItems ( )

Definition at line 221 of file OrderItem.java.

221  {
222  Dao dao = new ErpPU();
223  if(id > 0 && dao.isNotLoaded(receiptItems)) {
224  receiptItems = dao.lazyLoader(OrderItem.class, this, "receiptItems").receiptItems;
225  }
226  return receiptItems;
227  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRelated()

OrderItem org.turro.erp.entity.OrderItem.getRelated ( )

Definition at line 241 of file OrderItem.java.

241  {
242  return related;
243  }
Here is the caller graph for this function:

◆ getRequiredUsage()

RequiredUsage org.turro.erp.entity.OrderItem.getRequiredUsage ( )

Definition at line 249 of file OrderItem.java.

249  {
250  return requiredUsage;
251  }
Here is the caller graph for this function:

◆ getResource()

Resource org.turro.erp.entity.OrderItem.getResource ( )

Definition at line 257 of file OrderItem.java.

257  {
258  return resource;
259  }
Here is the caller graph for this function:

◆ getStatus()

OrderStatus org.turro.erp.entity.OrderItem.getStatus ( )

Definition at line 435 of file OrderItem.java.

435  {
436  Set<ReceiptItem> lri = getReceiptItems();
437  if(lri.isEmpty()) {
438  if(isSent()) {
439  return OrderStatus.ORDER_PENDING;
440  } else {
441  return OrderStatus.ORDER_READY;
442  }
443  }
444  double tmp = 0.0;
445  boolean processed = false;
446  for(ReceiptItem ri : lri) {
447  tmp += ri.getUnits();
448  processed = true;
449  }
450  if(processed) {
451  if(tmp >= units) {
452  return OrderStatus.ORDER_RECEIVED;
453  } else {
454  return OrderStatus.ORDER_RECEIVED_PARTIALLY;
455  }
456  } else {
457  return OrderStatus.ORDER_READY;
458  }
459  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTax()

double org.turro.erp.entity.OrderItem.getTax ( )

Definition at line 273 of file OrderItem.java.

273  {
274  return tax;
275  }
Here is the caller graph for this function:

◆ getType()

String org.turro.erp.entity.OrderItem.getType ( )

Definition at line 395 of file OrderItem.java.

395  {
396  if(humanResource != null) {
397  return "operator";
398  } else if(resource != null) {
399  return "resource";
400  } else {
401  return "product";
402  }
403  }
Here is the caller graph for this function:

◆ getUnits()

double org.turro.erp.entity.OrderItem.getUnits ( )

Definition at line 149 of file OrderItem.java.

149  {
150  return units;
151  }
Here is the caller graph for this function:

◆ getUpdatedReceiptItems()

Set<ReceiptItem> org.turro.erp.entity.OrderItem.getUpdatedReceiptItems ( )

Definition at line 229 of file OrderItem.java.

229  {
230  Dao dao = new ErpPU();
231  if(id > 0) {
232  receiptItems = dao.lazyLoader(OrderItem.class, this, "receiptItems").receiptItems;
233  }
234  return receiptItems;
235  }
Here is the caller graph for this function:

◆ hasReceipts()

boolean org.turro.erp.entity.OrderItem.hasReceipts ( )

Definition at line 496 of file OrderItem.java.

496  {
497  boolean empty = getReceiptItems().isEmpty();
498  if(empty && related != null) {
499  empty = related.getReceiptItems().isEmpty();
500  }
501  return !empty;
502  }
Here is the call graph for this function:

◆ isCostMaximum()

boolean org.turro.erp.entity.OrderItem.isCostMaximum ( )

Definition at line 93 of file OrderItem.java.

93  {
94  return costMaximum;
95  }
Here is the caller graph for this function:

◆ isEmpty()

boolean org.turro.erp.entity.OrderItem.isEmpty ( )

Definition at line 363 of file OrderItem.java.

363  {
364  return units == 0;
365  }
Here is the caller graph for this function:

◆ isProviderFixed()

boolean org.turro.erp.entity.OrderItem.isProviderFixed ( )

Definition at line 197 of file OrderItem.java.

197  {
198  return providerFixed;
199  }
Here is the caller graph for this function:

◆ isSent()

boolean org.turro.erp.entity.OrderItem.isSent ( )

Definition at line 265 of file OrderItem.java.

265  {
266  return sent;
267  }
Here is the caller graph for this function:

◆ setCost()

void org.turro.erp.entity.OrderItem.setCost ( double  cost)

Definition at line 89 of file OrderItem.java.

89  {
90  this.cost = cost;
91  }
Here is the caller graph for this function:

◆ setCostMaximum()

void org.turro.erp.entity.OrderItem.setCostMaximum ( boolean  costMaximum)

Definition at line 97 of file OrderItem.java.

97  {
98  this.costMaximum = costMaximum;
99  }
Here is the caller graph for this function:

◆ setDedication()

void org.turro.erp.entity.OrderItem.setDedication ( double  dedication)

Definition at line 105 of file OrderItem.java.

105  {
106  this.dedication = dedication;
107  }
Here is the caller graph for this function:

◆ setDelivery()

void org.turro.erp.entity.OrderItem.setDelivery ( Date  delivery)

Definition at line 113 of file OrderItem.java.

113  {
114  this.delivery = delivery;
115  }
Here is the caller graph for this function:

◆ setDescription()

void org.turro.erp.entity.OrderItem.setDescription ( String  description)

Definition at line 121 of file OrderItem.java.

121  {
122  this.description = description;
123  }
Here is the caller graph for this function:

◆ setDocumentDate()

void org.turro.erp.entity.OrderItem.setDocumentDate ( Date  documentDate)

Definition at line 129 of file OrderItem.java.

129  {
130  this.documentDate = documentDate;
131  }
Here is the caller graph for this function:

◆ setDocumentLine()

void org.turro.erp.entity.OrderItem.setDocumentLine ( DocumentLine  documentLine)

Definition at line 295 of file OrderItem.java.

295  {
296  documentLineId = this.documentLine.setEntity(documentLine);
297  }

◆ setDocumentLineId()

void org.turro.erp.entity.OrderItem.setDocumentLineId ( long  documentLineId)

Definition at line 137 of file OrderItem.java.

137  {
138  this.documentLineId = documentLineId;
139  }

◆ setDocumentNumber()

void org.turro.erp.entity.OrderItem.setDocumentNumber ( String  documentNumber)

Definition at line 145 of file OrderItem.java.

145  {
146  this.documentNumber = documentNumber;
147  }
Here is the caller graph for this function:

◆ setHumanResource()

void org.turro.erp.entity.OrderItem.setHumanResource ( HumanResource  humanResource)

Definition at line 161 of file OrderItem.java.

161  {
162  this.humanResource = humanResource;
163  }
Here is the caller graph for this function:

◆ setId()

void org.turro.erp.entity.OrderItem.setId ( long  id)

Definition at line 169 of file OrderItem.java.

169  {
170  this.id = id;
171  }

◆ setIProduct()

void org.turro.erp.entity.OrderItem.setIProduct ( IProduct  product)

Definition at line 321 of file OrderItem.java.

321  {
322  IProductKey productKey = iproduct.setIProduct(product);
323  productId = productKey.getProductId();
324  providerId = productKey.getProviderId();
325  providerProductId = productKey.getProviderProductId();
326  productDescription = productKey.getProductDescription();
327  }
IProductKey setIProduct(IProduct product)
Here is the call graph for this function:

◆ setMaxCost()

void org.turro.erp.entity.OrderItem.setMaxCost ( double  maxCost)

Definition at line 177 of file OrderItem.java.

177  {
178  this.maxCost = maxCost;
179  }
Here is the caller graph for this function:

◆ setProduct()

void org.turro.erp.entity.OrderItem.setProduct ( Product  product)

Definition at line 311 of file OrderItem.java.

311  {
312  productId = this.product.setEntity(product);
313  }

◆ setProductDescription()

void org.turro.erp.entity.OrderItem.setProductDescription ( String  productDescription)

Definition at line 185 of file OrderItem.java.

185  {
186  this.productDescription = productDescription;
187  }
Here is the caller graph for this function:

◆ setProductId()

void org.turro.erp.entity.OrderItem.setProductId ( long  productId)

Definition at line 193 of file OrderItem.java.

193  {
194  this.productId = productId;
195  }
Here is the caller graph for this function:

◆ setProvider()

void org.turro.erp.entity.OrderItem.setProvider ( Contract  provider)

Definition at line 341 of file OrderItem.java.

341  {
342  providerId = this.provider.setEntity(provider);
343  }
Here is the caller graph for this function:

◆ setProviderFixed()

void org.turro.erp.entity.OrderItem.setProviderFixed ( boolean  providerFixed)

Definition at line 201 of file OrderItem.java.

201  {
202  this.providerFixed = providerFixed;
203  }
Here is the caller graph for this function:

◆ setProviderId()

void org.turro.erp.entity.OrderItem.setProviderId ( long  providerId)

Definition at line 209 of file OrderItem.java.

209  {
210  this.providerId = providerId;
211  }
Here is the caller graph for this function:

◆ setProviderProduct()

void org.turro.erp.entity.OrderItem.setProviderProduct ( ProductByContractor  providerProduct)

Definition at line 357 of file OrderItem.java.

357  {
358  providerProductId = this.providerProduct.setEntity(providerProduct);
359  }

◆ setProviderProductId()

void org.turro.erp.entity.OrderItem.setProviderProductId ( long  providerProductId)

Definition at line 217 of file OrderItem.java.

217  {
218  this.providerProductId = providerProductId;
219  }
Here is the caller graph for this function:

◆ setReceiptItems()

void org.turro.erp.entity.OrderItem.setReceiptItems ( Set< ReceiptItem receiptItems)

Definition at line 237 of file OrderItem.java.

237  {
238  this.receiptItems = receiptItems;
239  }

◆ setRelated()

void org.turro.erp.entity.OrderItem.setRelated ( OrderItem  related)

Definition at line 245 of file OrderItem.java.

245  {
246  this.related = related;
247  }
Here is the caller graph for this function:

◆ setRequiredUsage()

void org.turro.erp.entity.OrderItem.setRequiredUsage ( RequiredUsage  requiredUsage)

Definition at line 253 of file OrderItem.java.

253  {
254  this.requiredUsage = requiredUsage;
255  }
Here is the caller graph for this function:

◆ setResource()

void org.turro.erp.entity.OrderItem.setResource ( Resource  resource)

Definition at line 261 of file OrderItem.java.

261  {
262  this.resource = resource;
263  }
Here is the caller graph for this function:

◆ setSent()

void org.turro.erp.entity.OrderItem.setSent ( boolean  sent)

Definition at line 269 of file OrderItem.java.

269  {
270  this.sent = sent;
271  }
Here is the caller graph for this function:

◆ setTax()

void org.turro.erp.entity.OrderItem.setTax ( double  tax)

Definition at line 277 of file OrderItem.java.

277  {
278  this.tax = tax;
279  }
Here is the caller graph for this function:

◆ setUnits()

void org.turro.erp.entity.OrderItem.setUnits ( double  units)

Definition at line 153 of file OrderItem.java.

153  {
154  this.units = units;
155  }
Here is the caller graph for this function:

◆ startReceipt() [1/2]

ReceiptItem org.turro.erp.entity.OrderItem.startReceipt ( Date  startWorking)

Definition at line 409 of file OrderItem.java.

409  {
410  return startReceipt(startWorking, units);
411  }
ReceiptItem startReceipt(Date startWorking)
Definition: OrderItem.java:409

◆ startReceipt() [2/2]

ReceiptItem org.turro.erp.entity.OrderItem.startReceipt ( Date  startWorking,
double  receiptUnits 
)

Definition at line 413 of file OrderItem.java.

413  {
414  ReceiptItem ri = new ReceiptItem();
415  ri.setOrderItem(this);
416  ri.setDocumentDate(documentDate);
417  ri.setDocumentNumber(documentNumber);
418  ri.setHumanResource(humanResource);
419  ri.setResource(resource);
420  ri.setProductId(productId);
421  ri.setProviderId(providerId);
422  ri.setProviderProductId(providerProductId);
423  ri.setProductDescription(productDescription);
424  ri.setDescription(description);
425  ri.setUnits(receiptUnits);
426  ri.setDedication(dedication);
427  ri.setStartWorking(startWorking);
428  ri.setCost(cost);
429  ri.setTax(tax);
430  return ri;
431  }
Here is the call graph for this function:

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