Timesheet/Client.php
Client timesheet service file
- Author
- Dave Cutler
- Copyright
- 2011 SOS Staffing Inc.
- Package
- Service
- Subpackage
- Timesheet
\Service_Timesheet_Client
Client timesheet
- Parent(s)
- \Service_Timesheet
- Api
- Author
- Dave Cutler
- Copyright
- 2011 SOS Staffing Inc.
Method List
Constants
Methods
calculateTotals
Calculates timesheet totals per day and as a whole
- Link: https://webservices.sosstaffing.com/timesheet/calculateTotals
-
Parameters:
- entries
- List of entries being calculated
- state
- Assignment state
- weekly_pay
- (Optional) The weekly pay total
- assignment_mileage
- (Optional) The per-mile reimbursement amount
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <state>[ST]</state> <weekly_pay>[#.##]</weekly_pay> <assignment_mileage>[#.##]</assignment_mileage> <entries> <entry> <date>[YYYY-MM-DD]</date> <type>[type]</type> <time_in>[HH:MM]</time_in> <time_out>[HH:MM]</time_out> <explanation>[explanation]</explanation> <unit_number>[#]</unit_number> <treatment_number>[#]</treatment_number> <expense>[#.##]</expense> </entry> <entry> <...> </entry> </entries> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <params> <state>[ST]</state> <weekly_pay>[#.##]</weekly_pay> <assignment_mileage>[#.##]</assignment_mileage> <entries> <entry> <date>[YYYY-MM-DD]</date> <type>[type]</type> <time_in>[HH:MM]</time_in> <time_out>[HH:MM]</time_out> <explanation>[explanation]</explanation> <unit_number>[#]</unit_number> <treatment_number>[#]</treatment_number> <expense>[#.##]</expense> </entry> <entry> <...> </entry> </entries> </params> </responseHeader> <response> <totals> <expense_total>[#.##]</expense_total> <taxable_meals>[#.##]</taxable_meals> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <days> <day> <date>[YYYY-MM-DD]</date> <expense_total>[#.##]</expense_total> <total_time>[#.##]</total_time> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <hours>[#]</hours> <minutes>[#]</minutes> </day> <day> <...> </day> </days> </totals> </response> </result>
countTimesheets
Returns a count of all timesheets for the approver, optionally limited by status
- Link: https://webservices.sosstaffing.com/timesheet_client/countTimesheets?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- statuses
- (Optional) The list of statuses to return
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <statuses> <status>[incomplete|submitted|accepted|rejected|exported|inactive]</status> </statuses> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> <params> <statuses> <status>[incomplete|submitted|accepted|rejected|exported|inactive]</status> </statuses> </params> </responseHeader> <response> <total>##</total> <statuses> <status> <incomplete>##</incomplete> <submitted>##</submitted> <accepted>##</accepted> <rejected>##</rejected> <exported>##</exported> <inactive>##</inactive> </status> </statuses> </response> </result>
getAllConstants
Returns all constants for the current service
- Link: https://webservices.sosstaffing.com/timesheet/getAllConstants
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> </responseHeader> <response> <constants> <constant> <name>[name]</name> <value>[value]</value> </constant> <constant> <...> </constant> </constants> </response> </result>
getConstant
Returns a specific constant for the current service by name
- Link: https://webservices.sosstaffing.com/timesheet/getConstant
-
Parameters:
- name
- The name of the constant to return (case-sensitive)
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <name>[name]</name> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <params> <name>[name]</name> </params> </responseHeader> <response> <value>[value]</value> </response> </result>
getCustomerFields
Returns a list of timesheet entry types allowed by customer
- Link: https://webservices.sosstaffing.com/timesheet/getCustomerFields
-
Parameters:
- customer_number
- The customer number from the timesheet assignment
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <customer_number>[customer_number]</customer_number> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <params> <customer_number>[customer_number]</customer_number> </params> </responseHeader> <response> <fields> <field> <name>[name]</name> <type>[time|expense]</type> <field> <field> <...> </field> </fields> </response> </result>
getLocation
Returns location information from a customer number
- Link: https://webservices.sosstaffing.com/timesheet/getLocation
-
Parameters:
- customer_number
- The customer number from the timesheet assignment
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <customer_number>[customer_number]</customer_number> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <params> <customer_number>[customer_number]</customer_number> </params> </responseHeader> <response> <location> <customer_number>[customer_number]</customer_number> <branch>[###]</branch> <department>[department]</department> <sub_department>[sub_department]</sub_department> <cust5>[#####]</cust5> <name>[name]</name> <week_ending>[week_ending]</week_ending> </location> <is_extended>[0|1]</is_extended> </response> </result>
getTimesheet
Will load an approver-accessible timesheet by an ID or assignment/week ending date. This method will only return timesheets that can by reviewed by the current user.
- Link: https://webservices.sosstaffing.com/timesheet_client/getTimesheet?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- timesheet_id
- ID of timesheet to load (Supercedes assignment_id and week_ending)
- assignment_id
- Assignment ID on timesheet to load (Requires week_ending, soslogin_id)
- week_ending
- Week ending on timesheet to load (Requires assignment_id, soslogin_id)
- soslogin_id
- SOS Login ID (person ID) on timesheet to load (Requires assignment_id, week_ending)
- return
- Amount of information to return. Can be id, full, details, entries
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <timesheet_id>[##]</timesheet_id> <assignment_id>[##]</assignment_id> <week_ending>[YYYY-MM-DD]</week_ending> <soslogin_id>[#####]</soslogin_id> <return>[id|full|entries|details]</return> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <token>[token]</token> <params> <timesheet_id>[id]</timesheet_id> <assignment_id>[##]</assignment_id> <week_ending>[YYYY-MM-DD]</week_ending> <soslogin_id>[#####]</soslogin_id> <return>[return]</return> </params> </responseHeader> <response> <timesheet> <!-- Always returned, only node returned for "id" --> <timesheet_id>[timesheet_id]</timesheet_id> <!-- Returned for "full" or "details" --> <week_ending>[YYYY-MM-DD]</week_ending> <soslogin_id>[soslogin_id]</soslogin_id> <employee_id>[employee_id]</employee_id> <branch_id>[branch_id]</branch_id> <timecard_lrn>[timecard_lrn]</timecard_lrn> <assignment_id>[assignment_id]</assignment_id> <assignment_title>[assignment_title]</assignment_title> <assignment_address>[assignment_address]</assignment_address> <assignment_state>[ST]</assignment_state> <assignment_mileage>[#.##]</assignment_mileage> <taxable_meals>[#.##]</taxable_meals> <expense_total>[#.##]</expense_total> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <employee_signed_date>[YYYY-MM-DD]</employee_signed_date> <approval_date>[YYYY-MM-DD]</approval_date> <approval_name>[approval_name]</approval_name> <flags>[##]</flags> <supervisor_email>[supervisor_email]</supervisor_email> <supervisor_name>[supervisor_name]</supervisor_name> <customer_number>[customer_number]</customer_number> <comment_id>[##]</comment_id> <comment>[comment]</comment> <timesheet_values_id>[timesheet_values_id]</timesheet_values_id> <parent_timesheet_values_id>[parent_timesheet_values_id]</parent_timesheet_values_id> <created_date>[YYYY-MM-DD HH:ii:ss]</created_date> <status>[status]</status> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <area>[area]</area> <area_number>[area_number]</area_number> <apply_cash_advance>[apply_cash_advance]</apply_cash_advance> <pay>[pay]</pay> <gin_number>[gin_number]</gin_number> <cost_center>[###]</cost_center> <cost_center_number>[cost_center_number]</cost_center_number> <rec_pay_for_min_hours>[rec_pay_for_min_hours]</rec_pay_for_min_hours> <weekly_pay>[weekly_pay]</weekly_pay> <location> <customer_number>[customer_number]</customer_number> <branch>[###]</branch> <department>[department]</department> <sub_department>[###]</sub_department> <cust5>[#####]</cust5> <name>[name]</name> <week_ending>[week_ending]</week_ending> </location> <is_extended>[0|1]</is_extended> <!-- Returned for "full" or "entries" --> <days> <day> <date>[YYYY-MM-DD]</date> <expense_total>[#.##]</expense_total> <total_time>[#.##]</total_time> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <hours>[##]</hours> <minutes>[##]</minutes> <entries> <entry> <timesheet_entry_id>[timesheet_entry_id]</timesheet_entry_id> <parent_timesheet_entry_id>[parent_timesheet_entry_id]</parent_timesheet_entry_id> <timesheet_id>[timesheet_id]</timesheet_id> <created>[YYYY-MM-DD HH:ii:ss]</created> <modified>[YYYY-MM-DD HH:ii:ss]</modified> <date>[YYYY-MM-DD]</date> <status>[#]</status> <type>[type]</type> <time_in>[##:##]</time_in> <time_out>[##:##]</time_out> <total_time>[#.##]</total_time> <explanation>[explanation]</explanation> <unit_number>[unit_number]</unit_number> <treatment_number>[treatment_number]</treatment_number> <expense>[#.##]</expense> </entry> <entry> <...> </entry> </entries> </day> <day> <...> </day> </days> </timesheet> </response> </result>
listTimesheets
Lists all timesheets that can be approved by the approver
- Link: https://webservices.sosstaffing.com/timesheet_client/listTimesheets?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- per_page
- (Optional) Number of timesheets to display per page
- page_number
- (Optional) Page number to load timesheets from
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <per_page>[##]</per_page> <page_number>[##]</page_number> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> </responseHeader> <response> <timesheets> <timesheet> <timesheet_id>[timesheet_id]</timesheet_id> <full_name>[full_name]</full_name> <week_ending>[YYYY-MM-DD]</week_ending> <employee_id>[employee_id]</employee_id> <branch_id>[###]</branch_id> <assignment_id>[assignment_id]</assignment_id> <assignment_title>[assignment_title]</assignment_title> <expense_total>[#.##]</expense_total> <customer_number>[customer_number]</customer_number> <taxable_meals>[#.##]</taxable_meals> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <flags>[##]</flags> <customer_name>[customer_name]</customer_name> <status>[status]</status> </timesheet> <timesheet> <...> </timesheet> </timesheets> <total>[##]</total> <page>[##]</page> </response> </result>
printTimesheets
Returns a PDF representation of the selected timesheets
- Link: https://webservices.sosstaffing.com/timesheet_client/printTimesheets?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- timesheet_ids
- Timesheet IDs to print
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <timesheet_ids> <timesheet_id>[#####]</timesheet_id> <timesheet_id><...></timesheet_id> </timesheet_ids> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> <params> <timesheet_ids> <timesheet_id>[#####]</timesheet_id> <timesheet_id><...></timesheet_id> </timesheet_ids> </params> </responseHeader> <response> <timesheet_file> <mime>[mime]</mime> <bytes>[####]</bytes> <data>[base64_encoded_binary]</data> </timesheet_file> </response> </result>
reviewTimesheet
Submits an approver review for a timesheet
- Link: https://webservices.sosstaffing.com/timesheet_client/reviewTimesheet?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- timesheet_id
- The timesheet to review
- review
- The review for the timesheet, can be either accept or reject
- comment
- An explanation of the review, required when rejecting the timesheet
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <timesheet_id>[timesheet_id]</timesheet_id> <review>[accept|reject]</review> <comment>[comment]</comment> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> <params> <timesheet_id>[timesheet_id]</timesheet_id> <review>[accept|reject]</review> <comment>[comment]</comment> </params> </responseHeader> <response> <message>Timesheet review has been saved</message> </response> </result>
saveDetails
Saves details to an existing timesheet
- Link: https://webservices.sosstaffing.com/timesheet_client/saveTimesheet?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- details
- The timesheet details to save
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <details> <timesheet_id>[timesheet_id]</timesheet_id> <state>[ST]</state> <weekly_pay>[#.##]</weekly_pay> <assignment_id>[#####]</assignment_id> <week_ending>[YYYY-MM-DD]</week_ending> <employee_id>[#####]</employee_id> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <cost_center>[###]</cost_center> <gin_number>[#####]</gin_number> </details> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> <params> <details> <timesheet_id>[timesheet_id]</timesheet_id> <state>[ST]</state> <weekly_pay>[#.##]</weekly_pay> <assignment_id>[#####]</assignment_id> <week_ending>[YYYY-MM-DD]</week_ending> <employee_id>[#####]</employee_id> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <cost_center>[###]</cost_center> <gin_number>[#####]</gin_number> </details> </params> </responseHeader> <response> <message>Timesheet details have been saved</message> <timesheet> <timesheet_id>[timesheet_id]</timesheet_id> <week_ending>[YYYY-MM-DD]</week_ending> <soslogin_id>[soslogin_id]</soslogin_id> <employee_id>[employee_id]</employee_id> <branch_id>[###]</branch_id> <timecard_lrn>[timecard_lrn]</timecard_lrn> <assignment_id>[assignment_id]</assignment_id> <assignment_title>[assignment_title]</assignment_title> <assignment_address>[assignment_address]</assignment_address> <assignment_state>[ST]</assignment_state> <assignment_mileage>[#.##]</assignment_mileage> <taxable_meals>[#.##]</taxable_meals> <expense_total>[#.##]</expense_total> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <employee_signed_date>[YYYY-MM-DD]</employee_signed_date> <approval_date>[YYYY-MM-DD]</approval_date> <approval_name>[approval_name]</approval_name> <flags>[##]</flags> <supervisor_email>[supervisor_email]</supervisor_email> <supervisor_name>[supervisor_name]</supervisor_name> <customer_number>[customer_number]</customer_number> <comment_id>[##]</comment_id> <comment>[comment]</comment> <timesheet_values_id>[timesheet_values_id]</timesheet_values_id> <parent_timesheet_values_id>[parent_timesheet_values_id]</parent_timesheet_values_id> <created_date>[YYYY-MM-DD HH:ii:ss]</created_date> <status>[status]</status> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <area>[area]</area> <area_number>[area_number]</area_number> <apply_cash_advance>[apply_cash_advance]</apply_cash_advance> <pay>[pay]</pay> <gin_number>[gin_number]</gin_number> <cost_center>[###]</cost_center> <cost_center_number>[cost_center_number]</cost_center_number> <rec_pay_for_min_hours>[rec_pay_for_min_hours]</rec_pay_for_min_hours> <weekly_pay>[#.##]</weekly_pay> <location> <customer_number>[customer_number]</customer_number> <branch>[###]</branch> <department>[department]</department> <sub_department>[###]</sub_department> <cust5>[#####]</cust5> <name>[name]</name> <week_ending>[week_ending]</week_ending> </location> <is_extended>[0|1]</is_extended> </timesheet> </response> </result>
saveEntries
Saves entries to an existing timesheet
- Link: https://webservices.sosstaffing.com/timesheet_client/saveEntries?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- timesheet_id
- The timesheet ID to which the entries are being saved
- entries
- The entries being saved
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <timesheet_id>[timesheet_id]</timesheet_id> <entries> <entry> <timesheet_entry_id>[#####]</timesheet_entry_id> <date>[YYYY-MM-DD]</date> <removed>[0|1]</removed> <type>[type]</type> <time_in>[##:##]</time_in> <time_out>[##:##]</time_out> <explanation>[explanation]</explanation> <expense>[#.##]</expense> </entry> <entry> <...> </entry> </entries> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> <params> <timesheet_id>[timesheet_id]</timesheet_id> <entries> <entry> <timesheet_entry_id>[#####]</timesheet_entry_id> <date>[YYYY-MM-DD]</date> <removed>[0|1]</removed> <type>[type]</type> <time_in>[##:##]</time_in> <time_out>[##:##]</time_out> <explanation>[explanation]</explanation> <expense>[#.##]</expense> </entry> <entry> <...> </entry> </entries> </params> </responseHeader> <response> <message>Entries have been saved</message> <saved_entries> <entry> <date>[YYYY-MM-DD]</date> <type>[type]</type> <time_in>[##:##]</time_in> <time_out>[##:##]</time_out> <explanation>[explanation]</explanation> <expense>[#.##]</expense> <total_time>[#.##]</total_time> <hours>[##]</hours> <minutes>[##]</minutes> <timesheet_entry_id>[#####]</timesheet_entry_id> </entry> <entry> <...> </entry> </saved_entries> <totals> <expense_total>[#.##]</expense_total> <taxable_meals>[#.##]</taxable_meals> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <days> <day> <date>[YYYY-MM-DD]</date> <expense_total>[#.##]</expense_total> <total_time>[#.##]</total_time> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <hours>[##]</hours> <minutes>[##]</minutes> </day> <day> <...> </day> </days> </totals> </response> </result>
validateEntry
Validates a new entry, optionally checks against an existing list of entries
- Link: https://webservices.sosstaffing.com/timesheet/validateEntry
-
Parameters:
- new_entry
- The entry information to validate
- timesheet_id
- (Optional) The timesheet ID to validate against
- days
- (Optional) The list of days/entries to validate against
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <new_entry> <timesheet_entry_id>[####]</timesheet_entry_id> <date>[YYYY-MM-DD]</date> <removed>[0|1]</removed> <type>[type]</type> <time_in>[HH:MM]</time_in> <time_out>[HH:MM]</time_out> <explanation>[explanation]</explanation> <unit_number>[#]</unit_number> <treatment_number>[#]</treatment_number> <expense>[#.##]</expense> </new_entry> <timesheet_id>[timesheet_id]</timesheet_id> <days> <day> <date>[YYYY-MM-DD]</date> <expense_total>[#.##]</expense_total> <total_time>[#.##]</total_time> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <hours>[#]</hours> <minutes>[#]</minutes> </day> <day> <...> </day> </days> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <params> <new_entry> <timesheet_entry_id>[####]</timesheet_entry_id> <date>[YYYY-MM-DD]</date> <removed>[0|1]</removed> <type>[type]</type> <time_in>[HH:MM]</time_in> <time_out>[HH:MM]</time_out> <explanation>[explanation]</explanation> <unit_number>[#]</unit_number> <treatment_number>[#]</treatment_number> <expense>[#.##]</expense> </new_entry> <timesheet_id>[timesheet_id]</timesheet_id> <days> <day> <date>[YYYY-MM-DD]</date> <expense_total>[#.##]</expense_total> <total_time>[#.##]</total_time> <regular_time>[#.##]</regular_time> <over_time>[#.##]</over_time> <double_time>[#.##]</double_time> <hours>[#]</hours> <minutes>[#]</minutes> </day> <day> <...> </day> </days> </params> </responseHeader> <response> <message>Timesheet entry is valid</message> </response> </result>