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

Public Member Functions

 ReferenceStatusWrapper (OrderReference orderReference, Date now)
 
boolean canChangeTo (ReferenceStatus newStatus)
 

Protected Member Functions

ReferenceStatus doCheckStatus (Date now)
 
ReferenceStatus doChangeTo (ReferenceStatus newStatus)
 

Detailed Description

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

Definition at line 33 of file ReferenceStatusWrapper.java.

Constructor & Destructor Documentation

◆ ReferenceStatusWrapper()

org.turro.erp.workorder.ReferenceStatusWrapper.ReferenceStatusWrapper ( OrderReference  orderReference,
Date  now 
)

Definition at line 38 of file ReferenceStatusWrapper.java.

38  {
39  super(null);
40  this.orderReference = orderReference;
41  this.now = now;
42  checkStatus(now);
43  }

Member Function Documentation

◆ canChangeTo()

boolean org.turro.erp.workorder.ReferenceStatusWrapper.canChangeTo ( ReferenceStatus  newStatus)

Definition at line 69 of file ReferenceStatusWrapper.java.

69  {
70  if(current.equals(ReferenceStatus.REFERENCE_PLANNING)) {
71  return EnumSet.of(
72  ReferenceStatus.REFERENCE_READY,
73  ReferenceStatus.REFERENCE_ONWORK,
74  ReferenceStatus.REFERENCE_FINISHED).contains(newStatus) &&
75  taskCouldChange(newStatus);
76  } else if(current.equals(ReferenceStatus.REFERENCE_READY)) {
77  return EnumSet.of(
78  ReferenceStatus.REFERENCE_ONWORK,
79  ReferenceStatus.REFERENCE_FINISHED).contains(newStatus) &&
80  taskCouldChange(newStatus);
81  } else if(current.equals(ReferenceStatus.REFERENCE_ONWORK)) {
82  return EnumSet.of(
83  ReferenceStatus.REFERENCE_FINISHED).contains(newStatus) &&
84  taskCouldChange(newStatus);
85  }
86  return false;
87  }

◆ doChangeTo()

ReferenceStatus org.turro.erp.workorder.ReferenceStatusWrapper.doChangeTo ( ReferenceStatus  newStatus)
protected

Definition at line 64 of file ReferenceStatusWrapper.java.

64  {
65  return newStatus;
66  }

◆ doCheckStatus()

ReferenceStatus org.turro.erp.workorder.ReferenceStatusWrapper.doCheckStatus ( Date  now)
protected

Definition at line 46 of file ReferenceStatusWrapper.java.

46  {
47  ReferenceStatus rs = ReferenceStatus.REFERENCE_FINISHED;
48  if(orderReference.isDelivered()) {
49  rs = ReferenceStatus.REFERENCE_DELIVERED;
50  } if(orderReference.hasPendingBudget()) {
51  rs = ReferenceStatus.REFERENCE_PENDING;
52  } else {
53  for(Task task : orderReference.getTasks()) {
54  TaskStatus ts = task.getStatus();
55  if(rs.getStatusOrder() > ts.getStatusOrder()) {
56  rs = ReferenceStatus.values()[ts.getStatusOrder()];
57  }
58  }
59  }
60  return rs;
61  }
Here is the call graph for this function:

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