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

Public Member Functions

Date getDelivery ()
 
void setDelivery (Date delivery)
 
long getDepartmentId ()
 
void setDepartmentId (long departmentId)
 
String getDescription ()
 
void setDescription (String description)
 
Date getEndDate ()
 
void setEndDate (Date endDate)
 
Set< RequiredUsagegetRequiredUsages ()
 
void setRequiredUsages (Set< RequiredUsage > requiredUsages)
 
long getId ()
 
void setId (long id)
 
boolean isMilestone ()
 
void setMilestone (boolean milestone)
 
String getName ()
 
void setName (String name)
 
AptitudeDegree getAptitudeDegree ()
 
void setAptitudeDegree (AptitudeDegree aptitudeDegree)
 
OrderReference getOrderReference ()
 
void setOrderReference (OrderReference orderReference)
 
Set< PredecessorgetPredecessors ()
 
void setPredecessors (Set< Predecessor > predecessors)
 
Date getStartDate ()
 
void setStartDate (Date startDate)
 
TaskStatus getStatus ()
 
void setStatus (TaskStatus status)
 
OwnedAptitude getSupervised ()
 
void setSupervised (OwnedAptitude supervised)
 
boolean isValidated ()
 
void setValidated (boolean validated)
 
boolean isWaiting ()
 
void setWaiting (boolean waiting)
 
boolean isEmpty ()
 
void clearEmptyLines ()
 
void prepareForSaving ()
 
TaskStatusWrapper getStatusWrapper ()
 
TaskStatusWrapper getStatusWrapper (Date now)
 
double getEstimatedDuration ()
 
double getRealDuration ()
 
Collection< AptitudeDegreegetAptitudeDegrees ()
 
boolean checkStatus (Date now)
 
String getFullDescription ()
 
String getHtmlDescription ()
 
Contract getDepartment ()
 
void setDepartment (Contract contract)
 
boolean fits (IContact contact)
 
boolean isValidationPending ()
 
boolean canStart ()
 
boolean isProductOrder ()
 
boolean fits (HumanResource humanResource)
 
double getCost ()
 

Detailed Description

Member Function Documentation

◆ canStart()

boolean org.turro.erp.entity.Task.canStart ( )

Definition at line 341 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

341  {
342  if(orderReference.getWorkOrder().isDraft()) {
343  return false;
344  }
345  if(orderReference.getStatusWrapper().getCurrent().equals(ReferenceStatus.REFERENCE_PENDING)) {
346  return false;
347  }
348  return !waiting;
349  }
ReferenceStatusWrapper getStatusWrapper()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkStatus()

boolean org.turro.erp.entity.Task.checkStatus ( Date  now)

Definition at line 287 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

287  {
288  return new TaskStatusWrapper(this, now).isChanged();
289  }
Here is the caller graph for this function:

◆ clearEmptyLines()

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

Definition at line 220 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

220  {
221  Iterator<Predecessor> itp = predecessors.iterator();
222  while(itp.hasNext()) {
223  Predecessor p = itp.next();
224  if(p.isEmpty()) {
225  p.setTask(null);
226  itp.remove();
227  }
228  }
229  Iterator<RequiredUsage> ith = requiredUsages.iterator();
230  while(ith.hasNext()) {
231  RequiredUsage hru = ith.next();
232  if(hru.isEmpty()) {
233  hru.setTask(null);
234  ith.remove();
235  }
236  }
237  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fits() [1/2]

boolean org.turro.erp.entity.Task.fits ( HumanResource  humanResource)

Definition at line 357 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

357  {
358  for(RequiredUsage ru : requiredUsages) {
359  if(ru.fits(humanResource)) {
360  return true;
361  }
362  }
363  return false;
364  }

◆ fits() [2/2]

boolean org.turro.erp.entity.Task.fits ( IContact  contact)

Definition at line 324 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

324  {
325  for(RequiredUsage ru : getRequiredUsages()) {
326  if(ru.getHumanResource() != null && ru.getHumanResource().fits(contact)) {
327  return true;
328  }
329  }
330  if(supervised != null && supervised.getHumanResource() != null &&
331  supervised.getHumanResource().fits(contact)) {
332  return true;
333  }
334  return false;
335  }
boolean fits(IContact contact)
Here is the call graph for this function:

◆ getAptitudeDegree()

AptitudeDegree org.turro.erp.entity.Task.getAptitudeDegree ( )

Definition at line 148 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getAptitudeDegrees()

Collection<AptitudeDegree> org.turro.erp.entity.Task.getAptitudeDegrees ( )

Definition at line 279 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

279  {
280  ArrayList<AptitudeDegree> list = new ArrayList<AptitudeDegree>();
281  if(aptitudeDegree != null) {
282  list.add(aptitudeDegree);
283  }
284  return list;
285  }
Here is the caller graph for this function:

◆ getCost()

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

Definition at line 366 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

366  {
367  double cost = 0;
368  for(RequiredUsage ru : getRequiredUsages()) {
369  cost += ru.getMostRealCost();
370  }
371  return cost;
372  }
Here is the call graph for this function:

◆ getDelivery()

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

Definition at line 84 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getDepartment()

Contract org.turro.erp.entity.Task.getDepartment ( )

Definition at line 303 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

303  {
304  return new DaoEntity<Contract, Long>() {
305  @Override
306  protected Dao createDao() {
307  return new FinancialsPU();
308  }
309  @Override
310  protected boolean shouldLog() {
311  return false;
312  }
313  }.find(departmentId);
314  }
Here is the caller graph for this function:

◆ getDepartmentId()

long org.turro.erp.entity.Task.getDepartmentId ( )

Definition at line 92 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getDescription()

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

Definition at line 100 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getEndDate()

Date org.turro.erp.entity.Task.getEndDate ( )

Definition at line 108 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

108  {
109  return endDate;
110  }
Here is the caller graph for this function:

◆ getEstimatedDuration()

double org.turro.erp.entity.Task.getEstimatedDuration ( )

Definition at line 252 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

252  {
253  double estimatedDuration = 0.0;
254 
255  for(RequiredUsage hru : requiredUsages) {
256  estimatedDuration = Math.max(hru.getEstimatedDuration(), estimatedDuration);
257  }
258 
259  if(estimatedDuration == 0.0) {
260  if(startDate != null && endDate != null) {
261  estimatedDuration = (endDate.getTime() - startDate.getTime()) * (1000.0 * 60.0 * 60.0);
262  estimatedDuration = ((estimatedDuration / 24.0) / 7.0) * 5.0 * 8.0;
263  }
264  }
265 
266  return estimatedDuration;
267  }

◆ getFullDescription()

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

Definition at line 293 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

293  {
294  return id + " - " + Strings.truncateAndWarn(name + (description == null ? "" : " - " + description), 50);
295  }
Here is the caller graph for this function:

◆ getHtmlDescription()

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

Definition at line 297 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

297  {
298  return StringParser.toHTML(description);
299  }
Here is the call graph for this function:

◆ getId()

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

Definition at line 124 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getName()

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

Definition at line 140 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

140  {
141  return name;
142  }
Here is the caller graph for this function:

◆ getOrderReference()

OrderReference org.turro.erp.entity.Task.getOrderReference ( )

Definition at line 156 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getPredecessors()

Set<Predecessor> org.turro.erp.entity.Task.getPredecessors ( )

Definition at line 164 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

164  {
165  return predecessors;
166  }
Here is the caller graph for this function:

◆ getRealDuration()

double org.turro.erp.entity.Task.getRealDuration ( )

Definition at line 269 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

269  {
270  double realDuration = 0.0;
271 
272  for(RequiredUsage hru : requiredUsages) {
273  realDuration = Math.max(hru.getRealDuration(), realDuration);
274  }
275 
276  return realDuration;
277  }

◆ getRequiredUsages()

Set<RequiredUsage> org.turro.erp.entity.Task.getRequiredUsages ( )

Definition at line 116 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getStartDate()

Date org.turro.erp.entity.Task.getStartDate ( )

Definition at line 172 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getStatus()

TaskStatus org.turro.erp.entity.Task.getStatus ( )

Definition at line 180 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ getStatusWrapper() [1/2]

TaskStatusWrapper org.turro.erp.entity.Task.getStatusWrapper ( )

Definition at line 244 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

244  {
245  return new TaskStatusWrapper(this, new Date());
246  }

◆ getStatusWrapper() [2/2]

TaskStatusWrapper org.turro.erp.entity.Task.getStatusWrapper ( Date  now)

Definition at line 248 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

248  {
249  return new TaskStatusWrapper(this, now);
250  }

◆ getSupervised()

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

Definition at line 188 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

188  {
189  return supervised;
190  }
Here is the caller graph for this function:

◆ isEmpty()

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

Definition at line 214 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

214  {
215  clearEmptyLines();
216  return Strings.isBlank(name) ||
217  departmentId == 0;
218  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isMilestone()

boolean org.turro.erp.entity.Task.isMilestone ( )

Definition at line 132 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

132  {
133  return milestone;
134  }
Here is the caller graph for this function:

◆ isProductOrder()

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

Definition at line 351 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

351  {
352  return orderReference != null &&
353  orderReference.getWorkOrder() != null &&
354  orderReference.getWorkOrder().isProductOrder();
355  }
Here is the call graph for this function:

◆ isValidated()

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

Definition at line 196 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

196  {
197  return validated;
198  }

◆ isValidationPending()

boolean org.turro.erp.entity.Task.isValidationPending ( )

Definition at line 337 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

337  {
338  return supervised != null && status.equals(TaskStatus.TASK_FINISHED) && !validated;
339  }

◆ isWaiting()

boolean org.turro.erp.entity.Task.isWaiting ( )

Definition at line 204 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

204  {
205  return waiting;
206  }
Here is the caller graph for this function:

◆ prepareForSaving()

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

Definition at line 239 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

239  {
240  clearEmptyLines();
241  checkStatus(new Date());
242  }
Here is the call graph for this function:

◆ setAptitudeDegree()

void org.turro.erp.entity.Task.setAptitudeDegree ( AptitudeDegree  aptitudeDegree)

Definition at line 152 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setDelivery()

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

Definition at line 88 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setDepartment()

void org.turro.erp.entity.Task.setDepartment ( Contract  contract)

Definition at line 316 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

316  {
317  if(contract != null) {
318  departmentId = contract.getId();
319  } else {
320  departmentId = 0;
321  }
322  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDepartmentId()

void org.turro.erp.entity.Task.setDepartmentId ( long  departmentId)

Definition at line 96 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setDescription()

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

Definition at line 104 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setEndDate()

void org.turro.erp.entity.Task.setEndDate ( Date  endDate)

Definition at line 112 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setId()

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

Definition at line 128 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setMilestone()

void org.turro.erp.entity.Task.setMilestone ( boolean  milestone)

Definition at line 136 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setName()

void org.turro.erp.entity.Task.setName ( String  name)

Definition at line 144 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setOrderReference()

void org.turro.erp.entity.Task.setOrderReference ( OrderReference  orderReference)

Definition at line 160 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setPredecessors()

void org.turro.erp.entity.Task.setPredecessors ( Set< Predecessor predecessors)

Definition at line 168 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

168  {
169  this.predecessors = predecessors;
170  }

◆ setRequiredUsages()

void org.turro.erp.entity.Task.setRequiredUsages ( Set< RequiredUsage requiredUsages)

Definition at line 120 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

120  {
121  this.requiredUsages = requiredUsages;
122  }

◆ setStartDate()

void org.turro.erp.entity.Task.setStartDate ( Date  startDate)

Definition at line 176 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setStatus()

void org.turro.erp.entity.Task.setStatus ( TaskStatus  status)

Definition at line 184 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setSupervised()

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

Definition at line 192 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

◆ setValidated()

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

Definition at line 200 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

200  {
201  this.validated = validated;
202  }

◆ setWaiting()

void org.turro.erp.entity.Task.setWaiting ( boolean  waiting)

Definition at line 208 of file BrightSide/bserp-core/src/main/java/org/turro/erp/entity/Task.java.

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

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