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

Public Member Functions

Set< BreakdowngetBreakdowns ()
 
void setBreakdowns (Set< Breakdown > breakdowns)
 
Set< BudgetgetBudgets ()
 
void setBudgets (Set< Budget > budgets)
 
CustomerOrder getCustomerOrder ()
 
void setCustomerOrder (CustomerOrder customerOrder)
 
boolean isDelivered ()
 
void setDelivered (boolean delivered)
 
String getDescription ()
 
void setDescription (String description)
 
long getId ()
 
void setId (long id)
 
boolean isNoFraction ()
 
void setNoFraction (boolean noFraction)
 
int getOrderRef ()
 
void setOrderRef (int orderRef)
 
double getPrice ()
 
void setPrice (double price)
 
long getProductId ()
 
void setProductId (long productId)
 
double getQuantity ()
 
void setQuantity (double quantity)
 
double getRetention ()
 
void setRetention (double retention)
 
long getServiceId ()
 
void setServiceId (long serviceId)
 
SortedSet< TaskgetTasks ()
 
void setTasks (SortedSet< Task > tasks)
 
double getTax ()
 
void setTax (double tax)
 
boolean isValidated ()
 
void setValidated (boolean validated)
 
WorkOrder getWorkOrder ()
 
void setWorkOrder (WorkOrder workOrder)
 
Product getProduct ()
 
void setProduct (Product product)
 
Contract getService ()
 
void setService (Contract service)
 
String getOrderDescription ()
 
String getSomeDescription ()
 
String getFullDescription ()
 
String getHtmlDescription ()
 
boolean isEmpty ()
 
void clearEmptyLines ()
 
void prepareForSaving ()
 
Set< TaskgetUpdatedTasks ()
 
void initFrom (CustomerOrder cu)
 
ReferenceStatusWrapper getStatusWrapper ()
 
ReferenceStatusWrapper getStatusWrapper (Date now)
 
boolean hasAcceptedBudget ()
 
boolean requiresBudget ()
 
boolean hasPendingBudget ()
 
boolean hasBugdetStopper ()
 
double getCost ()
 

Detailed Description

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

Definition at line 38 of file OrderReference.java.

Member Function Documentation

◆ clearEmptyLines()

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

Definition at line 280 of file OrderReference.java.

280  {
281  Iterator<Task> it = tasks.iterator();
282  while(it.hasNext()) {
283  Task t = it.next();
284  if(t.isEmpty()) {
285  t.setOrderReference(null);
286  it.remove();
287  }
288  }
289  Iterator<Breakdown> itb = breakdowns.iterator();
290  while(itb.hasNext()) {
291  Breakdown b = itb.next();
292  if(b.isEmpty()) {
293  itb.remove();
294  }
295  }
296  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBreakdowns()

Set<Breakdown> org.turro.erp.entity.OrderReference.getBreakdowns ( )

Definition at line 79 of file OrderReference.java.

79  {
80  return breakdowns;
81  }
Here is the caller graph for this function:

◆ getBudgets()

Set<Budget> org.turro.erp.entity.OrderReference.getBudgets ( )

Definition at line 87 of file OrderReference.java.

87  {
88  return budgets;
89  }

◆ getCost()

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

Definition at line 369 of file OrderReference.java.

369  {
370  double cost = 0;
371  for(Task t : getTasks()) {
372  cost += t.getCost();
373  }
374  return cost;
375  }
Here is the call graph for this function:

◆ getCustomerOrder()

CustomerOrder org.turro.erp.entity.OrderReference.getCustomerOrder ( )

Definition at line 95 of file OrderReference.java.

95  {
96  return customerOrder;
97  }
Here is the caller graph for this function:

◆ getDescription()

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

Definition at line 115 of file OrderReference.java.

115  {
116  return description;
117  }
Here is the caller graph for this function:

◆ getFullDescription()

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

Definition at line 264 of file OrderReference.java.

264  {
265  return getSomeDescription() + " (" + workOrder.getFullDescription() + ") ";
266  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHtmlDescription()

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

Definition at line 268 of file OrderReference.java.

268  {
269  return StringParser.toHTML(description);
270  }
Here is the call graph for this function:

◆ getId()

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

Definition at line 123 of file OrderReference.java.

123  {
124  return id;
125  }
Here is the caller graph for this function:

◆ getOrderDescription()

String org.turro.erp.entity.OrderReference.getOrderDescription ( )

Definition at line 255 of file OrderReference.java.

255  {
256  return orderRef + " - " + getSomeDescription();
257  }
Here is the call graph for this function:

◆ getOrderRef()

int org.turro.erp.entity.OrderReference.getOrderRef ( )

Definition at line 139 of file OrderReference.java.

139  {
140  return orderRef;
141  }
Here is the caller graph for this function:

◆ getPrice()

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

Definition at line 147 of file OrderReference.java.

147  {
148  return price;
149  }
Here is the caller graph for this function:

◆ getProduct()

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

Definition at line 229 of file OrderReference.java.

229  {
230  return product.getEntity(productId);
231  }
Here is the caller graph for this function:

◆ getProductId()

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

Definition at line 155 of file OrderReference.java.

155  {
156  return productId;
157  }
Here is the caller graph for this function:

◆ getQuantity()

double org.turro.erp.entity.OrderReference.getQuantity ( )

Definition at line 163 of file OrderReference.java.

163  {
164  return quantity;
165  }
Here is the caller graph for this function:

◆ getRetention()

double org.turro.erp.entity.OrderReference.getRetention ( )

Definition at line 171 of file OrderReference.java.

171  {
172  return retention;
173  }
Here is the caller graph for this function:

◆ getService()

Contract org.turro.erp.entity.OrderReference.getService ( )

Definition at line 245 of file OrderReference.java.

245  {
246  return service.getEntity(serviceId);
247  }
Here is the caller graph for this function:

◆ getServiceId()

long org.turro.erp.entity.OrderReference.getServiceId ( )

Definition at line 179 of file OrderReference.java.

179  {
180  return serviceId;
181  }
Here is the caller graph for this function:

◆ getSomeDescription()

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

Definition at line 259 of file OrderReference.java.

259  {
260  return (productId > 0 ? getProduct().getProductString() : "") +
261  description;
262  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStatusWrapper() [1/2]

ReferenceStatusWrapper org.turro.erp.entity.OrderReference.getStatusWrapper ( )

Definition at line 325 of file OrderReference.java.

325  {
326  return getStatusWrapper(null);
327  }
ReferenceStatusWrapper getStatusWrapper()
Here is the caller graph for this function:

◆ getStatusWrapper() [2/2]

ReferenceStatusWrapper org.turro.erp.entity.OrderReference.getStatusWrapper ( Date  now)

Definition at line 329 of file OrderReference.java.

329  {
330  return new ReferenceStatusWrapper(this, now);
331  }

◆ getTasks()

SortedSet<Task> org.turro.erp.entity.OrderReference.getTasks ( )

Definition at line 187 of file OrderReference.java.

187  {
188  return tasks;
189  }
Here is the caller graph for this function:

◆ getTax()

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

Definition at line 195 of file OrderReference.java.

195  {
196  return tax;
197  }
Here is the caller graph for this function:

◆ getUpdatedTasks()

Set<Task> org.turro.erp.entity.OrderReference.getUpdatedTasks ( )

Definition at line 308 of file OrderReference.java.

308  {
309  if(id > 0) {
310  Dao dao = new ErpPU();
311  tasks = dao.lazyLoader(OrderReference.class, this, "tasks").tasks;
312  }
313  return tasks;
314  }

◆ getWorkOrder()

WorkOrder org.turro.erp.entity.OrderReference.getWorkOrder ( )

Definition at line 211 of file OrderReference.java.

211  {
212  return workOrder;
213  }
Here is the caller graph for this function:

◆ hasAcceptedBudget()

boolean org.turro.erp.entity.OrderReference.hasAcceptedBudget ( )

Definition at line 343 of file OrderReference.java.

343  {
344  if(budgets.isEmpty()) return false;
345  for(Budget b : budgets) {
346  if(b.isAccepted()) {
347  return true;
348  }
349  }
350  return false;
351  }
Here is the caller graph for this function:

◆ hasBugdetStopper()

boolean org.turro.erp.entity.OrderReference.hasBugdetStopper ( )

Definition at line 365 of file OrderReference.java.

365  {
366  return hasAcceptedBudget() || hasDeliveredBudget();
367  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasPendingBudget()

boolean org.turro.erp.entity.OrderReference.hasPendingBudget ( )

Definition at line 357 of file OrderReference.java.

357  {
358  if(!hasAcceptedBudget() && (
359  !budgets.isEmpty() || requiresBudget())) {
360  return true;
361  }
362  return false;
363  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initFrom()

void org.turro.erp.entity.OrderReference.initFrom ( CustomerOrder  cu)

Definition at line 316 of file OrderReference.java.

316  {
317  this.customerOrder = cu;
318  description = cu.getDescription();
319  noFraction = cu.isNoFraction();
320  quantity = cu.getQuantity();
321  price = cu.getPrice();
322  serviceId = cu.getServiceId();
323  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDelivered()

boolean org.turro.erp.entity.OrderReference.isDelivered ( )

Definition at line 107 of file OrderReference.java.

107  {
108  return delivered;
109  }
Here is the caller graph for this function:

◆ isEmpty()

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

Definition at line 274 of file OrderReference.java.

274  {
275  boolean empty = (Strings.isBlank(description) && productId == 0) ||
276  serviceId == 0;
277  return empty;
278  }
Here is the caller graph for this function:

◆ isNoFraction()

boolean org.turro.erp.entity.OrderReference.isNoFraction ( )

Definition at line 131 of file OrderReference.java.

131  {
132  return noFraction;
133  }
Here is the caller graph for this function:

◆ isValidated()

boolean org.turro.erp.entity.OrderReference.isValidated ( )

Definition at line 203 of file OrderReference.java.

203  {
204  return validated;
205  }

◆ prepareForSaving()

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

Definition at line 298 of file OrderReference.java.

298  {
299  if(workOrder.getProductId() > 0) {
300  productId = workOrder.getProductId();
301  }
302  clearEmptyLines();
303  for(Task t : tasks) {
304  t.prepareForSaving();
305  }
306  }
Here is the call graph for this function:

◆ requiresBudget()

boolean org.turro.erp.entity.OrderReference.requiresBudget ( )

Definition at line 353 of file OrderReference.java.

353  {
354  return customerOrder != null && customerOrder.isWantBudget();
355  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBreakdowns()

void org.turro.erp.entity.OrderReference.setBreakdowns ( Set< Breakdown breakdowns)

Definition at line 83 of file OrderReference.java.

83  {
84  this.breakdowns = breakdowns;
85  }

◆ setBudgets()

void org.turro.erp.entity.OrderReference.setBudgets ( Set< Budget budgets)

Definition at line 91 of file OrderReference.java.

91  {
92  this.budgets = budgets;
93  }

◆ setCustomerOrder()

void org.turro.erp.entity.OrderReference.setCustomerOrder ( CustomerOrder  customerOrder)

Definition at line 99 of file OrderReference.java.

99  {
100  this.customerOrder = customerOrder;
101  if(customerOrder != null) {
102  customerOrder.setServiceId(serviceId);
103  customerOrder.setCustomerId(workOrder.getContractId());
104  }
105  }
void setCustomerId(long customerId)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDelivered()

void org.turro.erp.entity.OrderReference.setDelivered ( boolean  delivered)

Definition at line 111 of file OrderReference.java.

111  {
112  this.delivered = delivered;
113  }

◆ setDescription()

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

Definition at line 119 of file OrderReference.java.

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

◆ setId()

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

Definition at line 127 of file OrderReference.java.

127  {
128  this.id = id;
129  }
Here is the caller graph for this function:

◆ setNoFraction()

void org.turro.erp.entity.OrderReference.setNoFraction ( boolean  noFraction)

Definition at line 135 of file OrderReference.java.

135  {
136  this.noFraction = noFraction;
137  }
Here is the caller graph for this function:

◆ setOrderRef()

void org.turro.erp.entity.OrderReference.setOrderRef ( int  orderRef)

Definition at line 143 of file OrderReference.java.

143  {
144  this.orderRef = orderRef;
145  }
Here is the caller graph for this function:

◆ setPrice()

void org.turro.erp.entity.OrderReference.setPrice ( double  price)

Definition at line 151 of file OrderReference.java.

151  {
152  this.price = price;
153  }
Here is the caller graph for this function:

◆ setProduct()

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

Definition at line 233 of file OrderReference.java.

233  {
234  productId = this.product.setEntity(product);
235  }
Here is the caller graph for this function:

◆ setProductId()

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

Definition at line 159 of file OrderReference.java.

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

◆ setQuantity()

void org.turro.erp.entity.OrderReference.setQuantity ( double  quantity)

Definition at line 167 of file OrderReference.java.

167  {
168  this.quantity = quantity;
169  }
Here is the caller graph for this function:

◆ setRetention()

void org.turro.erp.entity.OrderReference.setRetention ( double  retention)

Definition at line 175 of file OrderReference.java.

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

◆ setService()

void org.turro.erp.entity.OrderReference.setService ( Contract  service)

Definition at line 249 of file OrderReference.java.

249  {
250  serviceId = this.service.setEntity(service);
251  }
Here is the caller graph for this function:

◆ setServiceId()

void org.turro.erp.entity.OrderReference.setServiceId ( long  serviceId)

Definition at line 183 of file OrderReference.java.

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

◆ setTasks()

void org.turro.erp.entity.OrderReference.setTasks ( SortedSet< Task tasks)

Definition at line 191 of file OrderReference.java.

191  {
192  this.tasks = tasks;
193  }

◆ setTax()

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

Definition at line 199 of file OrderReference.java.

199  {
200  this.tax = tax;
201  }
Here is the caller graph for this function:

◆ setValidated()

void org.turro.erp.entity.OrderReference.setValidated ( boolean  validated)

Definition at line 207 of file OrderReference.java.

207  {
208  this.validated = validated;
209  }

◆ setWorkOrder()

void org.turro.erp.entity.OrderReference.setWorkOrder ( WorkOrder  workOrder)

Definition at line 215 of file OrderReference.java.

215  {
216  this.workOrder = workOrder;
217  }
Here is the caller graph for this function:

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