Groups the TimesheetEntry rows a member worked over a period into a single unit that is submitted and approved together. A batch covers the half-open period from its start date up to, but not including, its finish date, and holds the total hours claimed for that period. It carries a workflow status of S for submitted or A for approved, along with who last changed the status and when; a batch with any status set counts as closed and should no longer be edited. The find method returns the batches whose period contains a given worked date, which is how an entry is matched to the batch it belongs in.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| closed | boolean | Whether the batch has been closed, meaning it has any non-blank status and should no longer be edited. Derived from the status, not a stored column. |
| finishDate | Date | The moment the batch period ends. Exclusive, so an entry on exactly this date belongs to the next batch rather than this one. Never null. |
| hours | double | Total hours claimed for this batch, as a decimal number of hours. Held on the batch rather than recalculated from the entries each time. |
| id | long | The database identifier of this batch. |
| notes | String | Free-text notes about the batch, for example an explanation for the approver. Up to 10000 characters, and null when nothing was recorded. |
| startDate | Date | First moment of the period this batch covers. The period is half-open, so an entry on exactly this date belongs to this batch. Never null. |
| status | String | Workflow state of the batch: S for submitted, A for approved. Null or blank while the batch is still open for editing. |
| statusChangedBy | Profile | The member who last changed the status, for example the approver. Set to the member who did the work when the batch is first created. Never null for a persisted batch. |
| statusDate | Date | When the status was last changed. Null while the status has never been set. |
| submittedDate | Date | When the batch was submitted for approval. Never null: it is stamped when the batch is created. |
| timesheetEntrys | List<TimesheetEntry> | The timesheet entries grouped into this batch. Note that this includes soft deleted entries, so filter them out yourself if you sum over the list. |
| workedBy | Profile | The member whose work this batch covers. Never null for a persisted batch. |
Methods
getWorkedBy() · setWorkedBy(Profile workedBy) · getSubmittedDate() · setSubmittedDate(Date submittedDate) · getStartDate() · setStartDate(Date startDate) · getFinishDate() · setFinishDate(Date finishDate) · getHours() · setHours(double hours) · getStatus() · setStatus(String status) · getStatusDate() · setStatusDate(Date statusDate) · getStatusChangedBy() · setStatusChangedBy(Profile statusChangedBy) · getId() · setOrganisation(Organisation organisation) · getNotes() · setNotes(String notes) · getTimesheetEntrys() · setTimesheetEntrys(List<TimesheetEntry> timesheetEntrys) · isClosed() · rowId()
getWorkedBy()
Returns: Profile
The member whose work this batch covers. Never null for a persisted batch.
setWorkedBy(Profile workedBy)
Returns: void
Sets the member whose work this batch covers.
| Parameter | Description |
|---|---|
workedBy | the member who did the work |
getSubmittedDate()
Returns: Date
When the batch was submitted for approval. Never null: it is stamped when the batch is created.
setSubmittedDate(Date submittedDate)
Returns: void
Sets the date the batch was submitted for approval.
| Parameter | Description |
|---|---|
submittedDate | the date the batch was submitted |
getStartDate()
Returns: Date
First moment of the period this batch covers. The period is half-open, so an entry on exactly this date belongs to this batch. Never null.
setStartDate(Date startDate)
Returns: void
Sets the first moment of the period this batch covers.
| Parameter | Description |
|---|---|
startDate | the inclusive start of the batch period |
getFinishDate()
Returns: Date
The moment the batch period ends. Exclusive, so an entry on exactly this date belongs to the next batch rather than this one. Never null.
setFinishDate(Date finishDate)
Returns: void
Sets the moment the batch period ends.
| Parameter | Description |
|---|---|
finishDate | the exclusive end of the batch period |
getHours()
Returns: double
Total hours claimed for this batch, as a decimal number of hours. Held on the batch rather than recalculated from the entries each time.
setHours(double hours)
Returns: void
Sets the total hours claimed for this batch.
| Parameter | Description |
|---|---|
hours | the total hours claimed, as a decimal number of hours |
getStatus()
Returns: String
Workflow state of the batch: S for submitted, A for approved. Null or blank while the batch is still open for editing.
setStatus(String status)
Returns: void
Sets the workflow state of the batch. Setting any non-blank value closes the batch.
| Parameter | Description |
|---|---|
status | the status code, S for submitted or A for approved |
getStatusDate()
Returns: Date
When the status was last changed. Null while the status has never been set.
setStatusDate(Date statusDate)
Returns: void
Sets the date the status was last changed.
| Parameter | Description |
|---|---|
statusDate | the date the status changed |
getStatusChangedBy()
Returns: Profile
The member who last changed the status, for example the approver. Set to the member who did the work when the batch is first created. Never null for a persisted batch.
setStatusChangedBy(Profile statusChangedBy)
Returns: void
Sets the member who last changed the status.
| Parameter | Description |
|---|---|
statusChangedBy | the member who last changed the status |
getId()
Returns: long
The database identifier of this batch.
setOrganisation(Organisation organisation)
Returns: void
Sets the organisation the batch belongs to.
| Parameter | Description |
|---|---|
organisation | the owning organisation |
getNotes()
Returns: String
Free-text notes about the batch, for example an explanation for the approver. Up to 10000 characters, and null when nothing was recorded.
setNotes(String notes)
Returns: void
Sets the free-text notes about the batch.
| Parameter | Description |
|---|---|
notes | the batch notes, up to 10000 characters |
getTimesheetEntrys()
Returns: List<TimesheetEntry>
The timesheet entries grouped into this batch. Note that this includes soft deleted entries, so filter them out yourself if you sum over the list.
setTimesheetEntrys(List<TimesheetEntry> timesheetEntrys)
Returns: void
Sets the timesheet entries grouped into this batch.
| Parameter | Description |
|---|---|
timesheetEntrys | the entries belonging to this batch |
isClosed()
Returns: boolean
Whether the batch has been closed, meaning it has any non-blank status and should no longer be edited. Derived from the status, not a stored column.
rowId()
Returns: Long
The database identifier of this batch, as required by the Relational interface.