BrightSide Workbench Full Report + Source Code
org.turro.erp.time.XMLTimeControlUtil Class Reference

Public Member Functions

 XMLTimeControlUtil (IConstructor constructor)
 
XMLHumanResource getHumanResource ()
 
void setHumanResource (XMLHumanResource humanResource)
 
List< XMLTimeControlgetPendingControl ()
 
XMLTimeControl start ()
 
synchronized XMLTimeControl start (Date date)
 
XMLTimeControl end (XMLTimeControl tc)
 
synchronized XMLTimeControl end (XMLTimeControl tc, Date date)
 
List< XMLTimeControlgetFromDate (Date date)
 

Detailed Description

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

Definition at line 32 of file XMLTimeControlUtil.java.

Constructor & Destructor Documentation

◆ XMLTimeControlUtil()

org.turro.erp.time.XMLTimeControlUtil.XMLTimeControlUtil ( IConstructor  constructor)

Definition at line 37 of file XMLTimeControlUtil.java.

37  {
38  this.constructor = constructor;
39  }

Member Function Documentation

◆ end() [1/2]

XMLTimeControl org.turro.erp.time.XMLTimeControlUtil.end ( XMLTimeControl  tc)

Definition at line 80 of file XMLTimeControlUtil.java.

80  {
81  return end(tc, null);
82  }
XMLTimeControl end(XMLTimeControl tc)
Here is the caller graph for this function:

◆ end() [2/2]

synchronized XMLTimeControl org.turro.erp.time.XMLTimeControlUtil.end ( XMLTimeControl  tc,
Date  date 
)

Definition at line 84 of file XMLTimeControlUtil.java.

84  {
85  XMLTimeControlSet xtcs = new XMLTimeControlSet(constructor);
86  for(XMLTimeControl xtc : xtcs) {
87  if(xtc.getHumanResourceId() == tc.getHumanResourceId() &&
88  xtc.getStartTime().equals(tc.getStartTime())) {
89  if(date == null) {
90  xtc.setEndTime(new Date());
91  } else {
92  xtc.setEndTime(date);
93  }
94  xtcs.saveCollection();
95  return xtc;
96  }
97  }
98  return null;
99  }
Here is the call graph for this function:

◆ getFromDate()

List<XMLTimeControl> org.turro.erp.time.XMLTimeControlUtil.getFromDate ( Date  date)

Definition at line 101 of file XMLTimeControlUtil.java.

101  {
102  CheckDate d = new CheckDate(date);
103  ArrayList<XMLTimeControl> list = new ArrayList<XMLTimeControl>();
104  XMLTimeControlSet xtcs = new XMLTimeControlSet(constructor);
105  for(XMLTimeControl tc : xtcs) {
106  if(d.compareDayMonthYear(tc.getStartTime()) == 0 ||
107  (tc.getEndTime() != null && d.compareDayMonthYear(tc.getEndTime()) == 0)) {
108  list.add(tc);
109  }
110  }
111  return list;
112  }
Here is the caller graph for this function:

◆ getHumanResource()

XMLHumanResource org.turro.erp.time.XMLTimeControlUtil.getHumanResource ( )

Definition at line 41 of file XMLTimeControlUtil.java.

41  {
42  return humanResource;
43  }

◆ getPendingControl()

List<XMLTimeControl> org.turro.erp.time.XMLTimeControlUtil.getPendingControl ( )

Definition at line 49 of file XMLTimeControlUtil.java.

49  {
50  ArrayList<XMLTimeControl> list = new ArrayList<XMLTimeControl>();
51  if(humanResource != null) {
52  XMLTimeControlSet xtcs = new XMLTimeControlSet(constructor);
53  for(XMLTimeControl tc : xtcs) {
54  if(tc.getHumanResourceId() == humanResource.getId() && tc.getEndTime() == null) {
55  list.add(tc);
56  }
57  }
58  }
59  return list;
60  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHumanResource()

void org.turro.erp.time.XMLTimeControlUtil.setHumanResource ( XMLHumanResource  humanResource)

Definition at line 45 of file XMLTimeControlUtil.java.

45  {
46  this.humanResource = humanResource;
47  }
Here is the caller graph for this function:

◆ start() [1/2]

XMLTimeControl org.turro.erp.time.XMLTimeControlUtil.start ( )

Definition at line 62 of file XMLTimeControlUtil.java.

62  {
63  return start(null);
64  }
Here is the caller graph for this function:

◆ start() [2/2]

synchronized XMLTimeControl org.turro.erp.time.XMLTimeControlUtil.start ( Date  date)

Definition at line 66 of file XMLTimeControlUtil.java.

66  {
67  XMLTimeControl tc = new XMLTimeControl();
68  tc.setHumanResourceId(humanResource.getId());
69  if(date == null) {
70  tc.setStartTime(new Date());
71  } else {
72  tc.setStartTime(date);
73  }
74  XMLTimeControlSet xtcs = new XMLTimeControlSet(constructor);
75  xtcs.add(tc);
76  xtcs.saveCollection();
77  return tc;
78  }
Here is the call graph for this function:

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