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

PropertyReturnsDescription
batchTimesheetBatchThe timesheet batch this entry has been grouped into for submission or approval, or null if it is not yet batched.
deletedByProfileThe 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.
deletedDateDateThe date and time this entry was soft deleted, or null if it is still live.
hoursdoubleThe 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.
idlongDatabase generated primary key for this timesheet entry.
invoiceInvoiceThe invoice this entry was billed on, or null if it has not been invoiced yet. Lazily loaded.
invoicedDateDateThe 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.
invoiceRefStringFree 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.
labelStringFree 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.
leadLeadThe 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.
notesStringLong form notes about the work, up to 10000 characters. Optional, and intended for detail that does not fit in the label.
statusStringWorkflow 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.
statusChangedByProfileThe profile who last changed the status. Always set, and initialised to the profile who created the entry.
statusDateDateThe date and time the status was last changed. Set to the creation time when the entry is first created.
taskTaskThe task the work was done against, or null if the entry is against a lead or a free text label only.
workedByProfileThe profile who did the work being recorded. Always set, and lazily loaded.
workedDateDateThe 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.

ParameterDescription
invoicethe 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.

ParameterDescription
invoiceRefthe invoice reference to record, up to 500 characters

setInvoicedDate(Date invoicedDate)

Returns: void

Sets the date this entry was invoiced.

ParameterDescription
invoicedDatethe 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.

ParameterDescription
workedBythe 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.

ParameterDescription
workedDatethe 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.

ParameterDescription
hoursthe 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.

ParameterDescription
leadthe 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.

ParameterDescription
taskthe 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.

ParameterDescription
labelthe 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.

ParameterDescription
statusthe 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.

ParameterDescription
statusDatethe 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.

ParameterDescription
statusChangedBythe 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.

ParameterDescription
organisationthe 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.

ParameterDescription
deletedBythe 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.

ParameterDescription
deletedDatethe 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.

ParameterDescription
notesthe 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.

ParameterDescription
batchthe batch to add the entry to, or null to remove it from its batch
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.