gtJCTimesheetLine
This function records the line item data needed for a Job Cost Timesheet document. Each timesheet is uploaded to Greentree Desktop as a complete transaction set. The timesheet either uploads in its entirety or nothing of the document is loaded into Greentree Desktop.
Reference
This must be the unique identifier generated by the gtJCTimesheet function call. It has the format JCTIME-nnn. This ensures the lines are of the correct timesheet header details and it ensures Excel creates the header information before attempting to calculate and create the timesheet line item details.
JobCode
The job code the timesheet is to be posted to.
ActivityCode
The activity code that the adjustment is to be assigned to.
WorkCentre
The work centre that the adjustment is to be assigned to.
Quantity
The number of hours to be posted with the job for the employee.
StartTime
The hour of the day that the employee started on the job — for example, 8.00 (8:00am)
FinishTime
The hour of the day that the employee finished on the job — for example, 16.00 (4:00pm)
TheDate
The date of the adjustment line item.
Narration
The line item narration.
Returns
- Ok - If there are no errors.
- Error - If there is an error.
Errors Returned
- Timesheet header error
- Invalid timesheet header reference
- The timesheet reference is required
- The job number is required
- The activity code is required
- The work centre is required
- The quantity is required
- The start time must be specified
- The finish time must be specified
- Invalid date, must be a date or omitted
- The weekend date is invalid
- This employee could not be found
- The timesheet could not be found
- The date is not valid
- The job cannot be found
- Cannot post to this job as it is finalised
- Cannot post to this job as it is closed
- The work centre cannot be found
- The activity code could not be found
- The quantity cannot be zero
- The start time is not valid
- The finish time is not valid
Note About Quantity
To get the Quantity to be a calculated field from the start and end time, enter the Start and Finish time as Text, then format the Qty as Numeric with a calculation of (Finish Time - Start Time) x 24. The result returns the Qty calculation. For example:
Start Time 8:10 formatted as text = 0.340278.
Finish Time 10:00 formatted as text = 0.416667.
Qty = (Finish Time - Start Time) x 24.
= (0.416667 - 0.340278) x 24.
= 1.83.