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

Public Member Functions

long getContractId ()
 
void setContractId (long contractId)
 
String getDescription ()
 
void setDescription (String description)
 
boolean isDraft ()
 
void setDraft (boolean draft)
 
Set< WorkOrdergetExtensions ()
 
void setExtensions (Set< WorkOrder > extensions)
 
long getId ()
 
void setId (long id)
 
Set< OrderReferencegetOrderReferences ()
 
void setOrderReferences (Set< OrderReference > orderReferences)
 
WorkOrder getParent ()
 
void setParent (WorkOrder parent)
 
String getPetitionerId ()
 
void setPetitionerId (String petitionerId)
 
long getProductId ()
 
void setProductId (long productId)
 
OwnedAptitude getSupervised ()
 
void setSupervised (OwnedAptitude supervised)
 
long getViewId ()
 
void setViewId (long viewId)
 
Date getWorkOrderDate ()
 
void setWorkOrderDate (Date workOrderDate)
 
long getWorkOrderId ()
 
void setWorkOrderId (long workOrderId)
 
Product getProduct ()
 
void setProduct (Product product)
 
Contract getContract ()
 
void setContract (Contract contract)
 
Contact getPetitioner ()
 
void setPetitioner (Contact petitioner)
 
RegisterView getView ()
 
void setView (RegisterView view)
 
String getSomeDescription ()
 
String getHtmlDescription ()
 
boolean isProductOrder ()
 
boolean isEmpty ()
 
void clearEmptyLines ()
 
void prepareForSaving ()
 
String getFullDescription ()
 
Set< OrderReferencegetSavedOrderReferences ()
 
long getNextBudgetNumber ()
 
double getPrice ()
 
double getCost ()
 

Static Public Member Functions

static WorkOrder getByWorkOrderId (long value)
 

Detailed Description

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

Definition at line 44 of file WorkOrder.java.

Member Function Documentation

◆ clearEmptyLines()

void org.turro.erp.entity.WorkOrder.clearEmptyLines ( )

Definition at line 297 of file WorkOrder.java.

297  {
298  Iterator<OrderReference> it = orderReferences.iterator();
299  while(it.hasNext()) {
300  OrderReference or = it.next();
301  if(or.isEmpty()) {
302  or.setWorkOrder(null);
303  it.remove();
304  }
305  }
306  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getByWorkOrderId()

static WorkOrder org.turro.erp.entity.WorkOrder.getByWorkOrderId ( long  value)
static

Definition at line 365 of file WorkOrder.java.

365  {
366  if(value > 0) {
367  Dao dao = new ErpPU();
368  return (WorkOrder) dao.getSingleResultOrNull(
369  "select wo from WorkOrder as wo " +
370  "where wo.workOrderId = ?",
371  new Object[] { value });
372  }
373  return null;
374  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContract()

Contract org.turro.erp.entity.WorkOrder.getContract ( )

Definition at line 214 of file WorkOrder.java.

214  {
215  return contract.getEntity(contractId);
216  }
Here is the caller graph for this function:

◆ getContractId()

long org.turro.erp.entity.WorkOrder.getContractId ( )

Definition at line 84 of file WorkOrder.java.

84  {
85  return contractId;
86  }
Here is the caller graph for this function:

◆ getCost()

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

Definition at line 357 of file WorkOrder.java.

357  {
358  double cost = 0;
359  for(OrderReference or : orderReferences) {
360  cost += or.getCost();
361  }
362  return cost;
363  }

◆ getDescription()

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

Definition at line 92 of file WorkOrder.java.

92  {
93  return description;
94  }
Here is the caller graph for this function:

◆ getExtensions()

Set<WorkOrder> org.turro.erp.entity.WorkOrder.getExtensions ( )

Definition at line 108 of file WorkOrder.java.

108  {
109  return extensions;
110  }

◆ getFullDescription()

String org.turro.erp.entity.WorkOrder.getFullDescription ( )

Definition at line 322 of file WorkOrder.java.

322  {
323  return (isDraft() ? "" : workOrderId + " - ") +
324  Strings.truncateAndWarn(getSomeDescription(), 100);
325  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHtmlDescription()

String org.turro.erp.entity.WorkOrder.getHtmlDescription ( )

Definition at line 273 of file WorkOrder.java.

273  {
274  return StringParser.toHTML(getSomeDescription());
275  }
Here is the call graph for this function:

◆ getId()

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

Definition at line 116 of file WorkOrder.java.

116  {
117  return id;
118  }
Here is the caller graph for this function:

◆ getNextBudgetNumber()

long org.turro.erp.entity.WorkOrder.getNextBudgetNumber ( )

Definition at line 337 of file WorkOrder.java.

337  {
338  long num = 1;
339  for(OrderReference or : getOrderReferences()) {
340  if(!or.isEmpty()) {
341  for(Budget b : or.getBudgets()) {
342  num = Math.max(num, b.getBudgetNumber() + 1);
343  }
344  }
345  }
346  return num;
347  }
Set< OrderReference > getOrderReferences()
Definition: WorkOrder.java:124
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOrderReferences()

Set<OrderReference> org.turro.erp.entity.WorkOrder.getOrderReferences ( )

Definition at line 124 of file WorkOrder.java.

124  {
125  return orderReferences;
126  }
Here is the caller graph for this function:

◆ getParent()

WorkOrder org.turro.erp.entity.WorkOrder.getParent ( )

Definition at line 132 of file WorkOrder.java.

132  {
133  return parent;
134  }

◆ getPetitioner()

Contact org.turro.erp.entity.WorkOrder.getPetitioner ( )

Definition at line 230 of file WorkOrder.java.

230  {
231  return petitioner.getEntity(petitionerId);
232  }

◆ getPetitionerId()

String org.turro.erp.entity.WorkOrder.getPetitionerId ( )

Definition at line 140 of file WorkOrder.java.

140  {
141  return petitionerId;
142  }

◆ getPrice()

double org.turro.erp.entity.WorkOrder.getPrice ( )

Definition at line 349 of file WorkOrder.java.

349  {
350  double price = 0;
351  for(OrderReference or : orderReferences) {
352  price += or.getPrice();
353  }
354  return price;
355  }

◆ getProduct()

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

Definition at line 198 of file WorkOrder.java.

198  {
199  return product.getEntity(productId);
200  }
Here is the caller graph for this function:

◆ getProductId()

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

Definition at line 148 of file WorkOrder.java.

148  {
149  return productId;
150  }
Here is the caller graph for this function:

◆ getSavedOrderReferences()

Set<OrderReference> org.turro.erp.entity.WorkOrder.getSavedOrderReferences ( )

Definition at line 327 of file WorkOrder.java.

327  {
328  HashSet<OrderReference> set = new HashSet<OrderReference>();
329  for(OrderReference or : orderReferences) {
330  if(or.getId() > 0) {
331  set.add(or);
332  }
333  }
334  return set;
335  }
Here is the caller graph for this function:

◆ getSomeDescription()

String org.turro.erp.entity.WorkOrder.getSomeDescription ( )

Definition at line 256 of file WorkOrder.java.

256  {
257  if(productId > 0) {
258  Product p = getProduct();
259  return p != null ? p.getProductString() : "";
260  } else {
261  if(!Strings.isBlank(description)) {
262  return description;
263  } else {
264  MultipleString ms = new MultipleString();
265  for(OrderReference or : getOrderReferences()) {
266  ms.add(or.getSomeDescription());
267  }
268  return ms.getString(100);
269  }
270  }
271  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSupervised()

OwnedAptitude org.turro.erp.entity.WorkOrder.getSupervised ( )

Definition at line 156 of file WorkOrder.java.

156  {
157  return supervised;
158  }
Here is the caller graph for this function:

◆ getView()

RegisterView org.turro.erp.entity.WorkOrder.getView ( )

Definition at line 246 of file WorkOrder.java.

246  {
247  return view.getEntity(viewId);
248  }
Here is the caller graph for this function:

◆ getViewId()

long org.turro.erp.entity.WorkOrder.getViewId ( )

Definition at line 164 of file WorkOrder.java.

164  {
165  return viewId;
166  }

◆ getWorkOrderDate()

Date org.turro.erp.entity.WorkOrder.getWorkOrderDate ( )

Definition at line 172 of file WorkOrder.java.

172  {
173  return workOrderDate;
174  }
Here is the caller graph for this function:

◆ getWorkOrderId()

long org.turro.erp.entity.WorkOrder.getWorkOrderId ( )

Definition at line 180 of file WorkOrder.java.

180  {
181  return workOrderId;
182  }
Here is the caller graph for this function:

◆ isDraft()

boolean org.turro.erp.entity.WorkOrder.isDraft ( )

Definition at line 100 of file WorkOrder.java.

100  {
101  return draft;
102  }
Here is the caller graph for this function:

◆ isEmpty()

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

Definition at line 283 of file WorkOrder.java.

283  {
284  boolean empty = workOrderDate == null;
285  if(!empty) {
286  empty = true;
287  for(OrderReference or : orderReferences) {
288  if(!or.isEmpty()) {
289  empty = false;
290  break;
291  }
292  }
293  }
294  return empty;
295  }

◆ isProductOrder()

boolean org.turro.erp.entity.WorkOrder.isProductOrder ( )

Definition at line 279 of file WorkOrder.java.

279  {
280  return productId > 0;
281  }
Here is the caller graph for this function:

◆ prepareForSaving()

void org.turro.erp.entity.WorkOrder.prepareForSaving ( )

Definition at line 308 of file WorkOrder.java.

308  {
309  clearEmptyLines();
310  for(WorkOrder wo : extensions) {
311  wo.prepareForSaving();
312  }
313  for(OrderReference or : orderReferences) {
314  or.prepareForSaving();
315  }
316  if(workOrderId == 0 && !draft) {
317  workOrderId = IdUtils.getMaxLongIdFromLong(
318  new ErpPU(), "WorkOrder", "workOrderId");
319  }
320  }
Here is the call graph for this function:

◆ setContract()

void org.turro.erp.entity.WorkOrder.setContract ( Contract  contract)

Definition at line 218 of file WorkOrder.java.

218  {
219  contractId = this.contract.setEntity(contract);
220  }
Here is the caller graph for this function:

◆ setContractId()

void org.turro.erp.entity.WorkOrder.setContractId ( long  contractId)

Definition at line 88 of file WorkOrder.java.

88  {
89  this.contractId = contractId;
90  }

◆ setDescription()

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

Definition at line 96 of file WorkOrder.java.

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

◆ setDraft()

void org.turro.erp.entity.WorkOrder.setDraft ( boolean  draft)

Definition at line 104 of file WorkOrder.java.

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

◆ setExtensions()

void org.turro.erp.entity.WorkOrder.setExtensions ( Set< WorkOrder extensions)

Definition at line 112 of file WorkOrder.java.

112  {
113  this.extensions = extensions;
114  }

◆ setId()

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

Definition at line 120 of file WorkOrder.java.

120  {
121  this.id = id;
122  }

◆ setOrderReferences()

void org.turro.erp.entity.WorkOrder.setOrderReferences ( Set< OrderReference orderReferences)

Definition at line 128 of file WorkOrder.java.

128  {
129  this.orderReferences = orderReferences;
130  }

◆ setParent()

void org.turro.erp.entity.WorkOrder.setParent ( WorkOrder  parent)

Definition at line 136 of file WorkOrder.java.

136  {
137  this.parent = parent;
138  }

◆ setPetitioner()

void org.turro.erp.entity.WorkOrder.setPetitioner ( Contact  petitioner)

Definition at line 234 of file WorkOrder.java.

234  {
235  petitionerId = this.petitioner.setEntity(petitioner);
236  }

◆ setPetitionerId()

void org.turro.erp.entity.WorkOrder.setPetitionerId ( String  petitionerId)

Definition at line 144 of file WorkOrder.java.

144  {
145  this.petitionerId = petitionerId;
146  }

◆ setProduct()

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

Definition at line 202 of file WorkOrder.java.

202  {
203  productId = this.product.setEntity(product);
204  }
Here is the caller graph for this function:

◆ setProductId()

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

Definition at line 152 of file WorkOrder.java.

152  {
153  this.productId = productId;
154  }

◆ setSupervised()

void org.turro.erp.entity.WorkOrder.setSupervised ( OwnedAptitude  supervised)

Definition at line 160 of file WorkOrder.java.

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

◆ setView()

void org.turro.erp.entity.WorkOrder.setView ( RegisterView  view)

Definition at line 250 of file WorkOrder.java.

250  {
251  viewId = this.view.setEntity(view);
252  }

◆ setViewId()

void org.turro.erp.entity.WorkOrder.setViewId ( long  viewId)

Definition at line 168 of file WorkOrder.java.

168  {
169  this.viewId = viewId;
170  }

◆ setWorkOrderDate()

void org.turro.erp.entity.WorkOrder.setWorkOrderDate ( Date  workOrderDate)

Definition at line 176 of file WorkOrder.java.

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

◆ setWorkOrderId()

void org.turro.erp.entity.WorkOrder.setWorkOrderId ( long  workOrderId)

Definition at line 184 of file WorkOrder.java.

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

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