Records a block of time worked by a profile on a given day, optionally against a lead, a task or a free text label. Entries belong to an organisation and are the unit that timesheet reporting and invoicing sum over. Each entry carries the number of hours, the date the work was done and who did it, plus a workflow status and the profile who last changed it. Deletion is soft: an entry with deletedBy set is ignored by the finders and by the hours totals, so scripts that query entries directly must exclude it themselves. Once billed, an entry can be linked to an Invoice and stamped with an invoiced date and reference, and it can be grouped into a TimesheetBatch for approval.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| batch | TimesheetBatch | The timesheet batch this entry has been grouped into for submission or approval, or null if it is not yet batched. |
| deletedBy | Profile | The profile who deleted this entry, or null if it is still live. Deletion is soft, so the row remains in the database and this field is what marks it as gone. |
| deletedDate | Date | The date and time this entry was soft deleted, or null if it is still live. |
| hours | double | The number of hours worked, as a decimal, so a quarter hour is 0.25. This is the value summed by the per lead and per task hour totals. |
| id | long | Database generated primary key for this timesheet entry. |
| invoice | Invoice | The invoice this entry was billed on, or null if it has not been invoiced yet. Lazily loaded. |
| invoicedDate | Date | The date and time this entry was invoiced. Null while the entry is still unbilled, so it is a convenient filter for finding work that is ready to bill. |
| invoiceRef | String | Free text reference for the invoice this entry was billed on, typically an invoice number from an external accounting system. Up to 500 characters, and null until the entry is invoiced. |
| label | String | Free text description of what was worked on, used when the entry is not tied to a lead or a task. Existing labels are offered back to the user as suggestions, so reusing the same wording keeps reporting tidy. |
| lead | Lead | The lead the work was done against, or null if the entry is against a task or a free text label only. When an entry is created against a task that has a related lead, that lead is copied here as well so the work still rolls up to the lead. |
| notes | String | Long form notes about the work, up to 10000 characters. Optional, and intended for detail that does not fit in the label. |
| status | String | Workflow status of the entry, for example whether it has been submitted or approved. The set of values is defined by the application using timesheets rather than by the platform, and it may be null. |
| statusChangedBy | Profile | The profile who last changed the status. Always set, and initialised to the profile who created the entry. |
| statusDate | Date | The date and time the status was last changed. Set to the creation time when the entry is first created. |
| task | Task | The task the work was done against, or null if the entry is against a lead or a free text label only. |
| workedBy | Profile | The profile who did the work being recorded. Always set, and lazily loaded. |
| workedDate | Date | The date the work was performed, which is what timesheet reporting groups and filters on. This is the date of the work itself, not the date the entry was created. |
Methods
getInvoice() · setInvoice(Invoice invoice) · getInvoiceRef() · setInvoiceRef(String invoiceRef) · setInvoicedDate(Date invoicedDate) · getInvoicedDate() · getWorkedBy() · setWorkedBy(Profile workedBy) · getWorkedDate() · setWorkedDate(Date workedDate) · getHours() · setHours(double hours) · getLead() · setLead(Lead lead) · getTask() · setTask(Task task) · getLabel() · setLabel(String label) · getStatus() · setStatus(String status) · getStatusDate() · setStatusDate(Date statusDate) · getStatusChangedBy() · setStatusChangedBy(Profile statusChangedBy) · getId() · setOrganisation(Organisation organisation) · getDeletedBy() · setDeletedBy(Profile deletedBy) · getDeletedDate() · setDeletedDate(Date deletedDate) · getNotes() · setNotes(String notes) · getBatch() · setBatch(TimesheetBatch batch)
getInvoice()
Returns: Invoice
The invoice this entry was billed on, or null if it has not been invoiced yet. Lazily loaded.
setInvoice(Invoice invoice)
Returns: void
Links this entry to the invoice it was billed on.
| Parameter | Description |
|---|---|
invoice | the invoice this entry is billed on, or null to unlink it |
getInvoiceRef()
Returns: String
Free text reference for the invoice this entry was billed on, typically an invoice number from an external accounting system. Up to 500 characters, and null until the entry is invoiced.
setInvoiceRef(String invoiceRef)
Returns: void
Sets the external invoice reference recorded against this entry.
| Parameter | Description |
|---|---|
invoiceRef | the invoice reference to record, up to 500 characters |
setInvoicedDate(Date invoicedDate)
Returns: void
Sets the date this entry was invoiced.
| Parameter | Description |
|---|---|
invoicedDate | the date the entry was invoiced, or null to mark it as not yet invoiced |
getInvoicedDate()
Returns: Date
The date and time this entry was invoiced. Null while the entry is still unbilled, so it is a convenient filter for finding work that is ready to bill.
getWorkedBy()
Returns: Profile
The profile who did the work being recorded. Always set, and lazily loaded.
setWorkedBy(Profile workedBy)
Returns: void
Sets the profile who performed the work recorded by this entry.
| Parameter | Description |
|---|---|
workedBy | the profile who did the work, required |
getWorkedDate()
Returns: Date
The date the work was performed, which is what timesheet reporting groups and filters on. This is the date of the work itself, not the date the entry was created.
setWorkedDate(Date workedDate)
Returns: void
Sets the date the work recorded by this entry was performed.
| Parameter | Description |
|---|---|
workedDate | the date the work was done |
getHours()
Returns: double
The number of hours worked, as a decimal, so a quarter hour is 0.25. This is the value summed by the per lead and per task hour totals.
setHours(double hours)
Returns: void
Sets the number of hours this entry records, as a decimal.
| Parameter | Description |
|---|---|
hours | the hours worked, where 0.25 is a quarter of an hour |
getLead()
Returns: Lead
The lead the work was done against, or null if the entry is against a task or a free text label only. When an entry is created against a task that has a related lead, that lead is copied here as well so the work still rolls up to the lead.
setLead(Lead lead)
Returns: void
Attributes this entry to a lead.
| Parameter | Description |
|---|---|
lead | the lead the work was done against, or null |
getTask()
Returns: Task
The task the work was done against, or null if the entry is against a lead or a free text label only.
setTask(Task task)
Returns: void
Attributes this entry to a task.
| Parameter | Description |
|---|---|
task | the task the work was done against, or null |
getLabel()
Returns: String
Free text description of what was worked on, used when the entry is not tied to a lead or a task. Existing labels are offered back to the user as suggestions, so reusing the same wording keeps reporting tidy.
setLabel(String label)
Returns: void
Sets the free text description of what was worked on.
| Parameter | Description |
|---|---|
label | the label describing the work, or null |
getStatus()
Returns: String
Workflow status of the entry, for example whether it has been submitted or approved. The set of values is defined by the application using timesheets rather than by the platform, and it may be null.
setStatus(String status)
Returns: void
Sets the workflow status of this entry. Setting this does not update the status date or the status changer, so set those as well if you want an accurate audit trail.
| Parameter | Description |
|---|---|
status | the new status value, or null |
getStatusDate()
Returns: Date
The date and time the status was last changed. Set to the creation time when the entry is first created.
setStatusDate(Date statusDate)
Returns: void
Sets the date the status was last changed.
| Parameter | Description |
|---|---|
statusDate | the date of the most recent status change |
getStatusChangedBy()
Returns: Profile
The profile who last changed the status. Always set, and initialised to the profile who created the entry.
setStatusChangedBy(Profile statusChangedBy)
Returns: void
Sets the profile recorded as having last changed the status.
| Parameter | Description |
|---|---|
statusChangedBy | the profile making the status change, required |
getId()
Returns: long
Database generated primary key for this timesheet entry.
setOrganisation(Organisation organisation)
Returns: void
Sets the organisation this entry belongs to. Every finder filters on this, so an entry saved against the wrong organisation will not show up in that organisation's timesheets.
| Parameter | Description |
|---|---|
organisation | the owning organisation, required |
getDeletedBy()
Returns: Profile
The profile who deleted this entry, or null if it is still live. Deletion is soft, so the row remains in the database and this field is what marks it as gone.
setDeletedBy(Profile deletedBy)
Returns: void
Marks this entry as deleted by the given profile. Deletion is soft, so the row is kept and simply excluded from the finders and totals.
| Parameter | Description |
|---|---|
deletedBy | the profile deleting the entry, or null to undelete it |
getDeletedDate()
Returns: Date
The date and time this entry was soft deleted, or null if it is still live.
setDeletedDate(Date deletedDate)
Returns: void
Sets the date this entry was soft deleted.
| Parameter | Description |
|---|---|
deletedDate | the deletion date, or null if the entry is live |
getNotes()
Returns: String
Long form notes about the work, up to 10000 characters. Optional, and intended for detail that does not fit in the label.
setNotes(String notes)
Returns: void
Sets the long form notes for this entry.
| Parameter | Description |
|---|---|
notes | the notes to record, up to 10000 characters |
getBatch()
Returns: TimesheetBatch
The timesheet batch this entry has been grouped into for submission or approval, or null if it is not yet batched.
setBatch(TimesheetBatch batch)
Returns: void
Puts this entry into a timesheet batch.
| Parameter | Description |
|---|---|
batch | the batch to add the entry to, or null to remove it from its batch |