Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

InTime provides a SOAP Web Service Interface that allows two-way flow of information to external systems. This enables automated and efficient transfer of data to and from your other systems reducing effort and duplication.  

...

try{

//Attempt to read the placement first to check if it already exists

IntimeServiceV3_0Stub.GetPlacementByExternalId getPlacementRequest=new IntimeServiceV3_0Stub.GetPlacementByExternalId();

getPlacementRequest.setId("WEB-PLC-001");

getPlacementRequest.setToken(ticket);

GetPlacementByExternalIdResponse placementResponse=stub.getPlacementByExternalId(getPlacementRequest);

IntimeServiceV3_0Stub.Placement placement=placementResponse.get_return();

if (placement == null) {

    //placement does not exist

    placement = new IntimeServiceV3_0Stub.Placement();

    placement.setExternalId("WEB-PLC-001");

}


//Consultant

IntimeServiceV3_0Stub.Consultant consultant= new IntimeServiceV3_0Stub.Consultant();

IntimeServiceV3_0Stub.GetConsultantsByExternalId getConsultantRequest=new IntimeServiceV3_0Stub.GetConsultantsByExternalId();

getConsultantRequest.setId("WEB-CON01");

getConsultantRequest.setToken(ticket);   //from authenticate call

GetConsultantsByExternalIdResponse consultantResponse=stub.getConsultantsByExternalId(getConsultantRequest);

IntimeServiceV3_0Stub.Consultant[] cons=consultantResponse.get_return();

if (cons== null || cons.size() < 1) {

    //consultant did not exist    

    consultant.setExternalId("WEB-CON01");

    consultant.setFirstname("Web");

    consultant.setLastname("Consultant");

    consultant.setEmail("C@c.com");

    IntimeServiceV3_0Stub.CreateOrUpdateConsultant createConsultantRequest = new IntimeServiceV3_0Stub.CreateOrUpdateConsultant();

    createConsultantRequest.setToken(ticket);

    createConsultantRequest.setConsultant(consultant);

    IntimeServiceV3_0Stub.CreateOrUpdateConsultantResponse createConsultantResult=stub.createOrUpdateConsultant(createConsultantRequest);

    if (createConsultantResult != null) {

System.out.println("Created/updated Consultant with ID:" + createConsultantResult.get_return());

    }

} else {

    consultant = cons[0];

}

placement.setConsultant(consultant);


//Client

IntimeServiceV3_0Stub.Client client = new IntimeServiceV3_0Stub.Client();

IntimeServiceV3_0Stub.GetClientsByExternalId getClientRequest=new IntimeServiceV3_0Stub.GetClientsByExternalId();

getClientRequest.setId("WEB-CLI01");

getClientRequest.setToken(ticket);   //from authenticate call

GetClientsByExternalIdResponse clientResponse=stub.getClientsByExternalId(getClientRequest);

IntimeServiceV3_0Stub.Client[] clients=clientResponse.get_return();

if (clients== null || clients.size() < 1) {

     //client did not exist    

    client.setExternalId("WEB-CLI01");   

    client.setName("Web Client 001");

    client.setTermsTemplateName("Default Charge Terms");

    //populate other fields

    IntimeServiceV3_0Stub.CreateOrUpdateClient createClientRequest = new IntimeServiceV3_0Stub.CreateOrUpdateClient();

    createClientRequest.setToken(ticket);

    createClientRequest.setClient(client);

    IntimeServiceV3_0Stub.CreateOrUpdateClientResponse createClientResult=stub.createOrUpdateClient(createClientRequest);

    if (createClientResult != null) {

System.out.println("Created/updated Client with ID:" + createClientResult.get_return());

    }

} else {

    client = clients[0];

}

placement.setClient(client);


//Manager

IntimeServiceV3_0Stub.Manager manager = new IntimeServiceV3_0Stub.Manager();

IntimeServiceV3_0Stub.GetManagersByExternalId getManagerRequest=new IntimeServiceV3_0Stub.GetManagersByExternalId();
getManagerRequest.setId("WEB-MAN01");
getManagerRequest.setToken(ticket);   //from authenticate call
GetManagersByExternalIdResponse managerResponse=stub.getManagersByExternalId(getManagerRequest);
IntimeServiceV3_0Stub.Manager[] mgrs=managerResponse.get_return();
if (mgrs== null || mgrs.size() < 1) {
    //manager did not exist    
    manager.setExternalId("WEB-MAN01");
    manager.setFirstname("Web");
    manager.setLastname("Manager");
    manager.setEmail("m@m.com");
    manager.setClient(client);
    IntimeServiceV3_0Stub.CreateOrUpdateManager createManagerRequest = new IntimeServiceV3_0Stub.CreateOrUpdateManager();
    createManagerRequest.setToken(ticket);
    createManagerRequest.setManager(manager);
    IntimeServiceV3_0Stub.CreateOrUpdateManagerResponse createManagerResult=stub.createOrUpdateManager(createManagerRequest);
    if (createManagerResult != null) {
        System.out.println("Created/updated Manager with ID:" + createManagerResult.get_return());
    }
} else {
    manager = mgrs[0];
}
placement.setManager(manager);


//Worker

IntimeServiceV3_0Stub.GetWorkersByExternalId getWorkerRequest=new IntimeServiceV3_0Stub.GetWorkersByExternalId();
getWorkerRequest.setId("WEB-WKR01");
getWorkerRequest.setToken(ticket);   //from authenticate call
GetWorkersByExternalIdResponse workerResponse=stub.getWorkersByExternalId(getWorkerRequest);
IntimeServiceV2IntimeServiceV3_9Stub0Stub.Worker[] wkrs=workerResponse.get_return();
if (wkrs== null || wkrs.size() < 1) {
    //worker did not exist    
    worker.setExternalId("WEB-WKR01");
    worker.setFirstname("Web");
    worker.setLastname("Worker");
    worker.setEmail("w@w.com");
    //populate other details


    IntimeServiceV2IntimeServiceV3_9Stub0Stub.CreateOrUpdateWorker createWorkerRequest = new IntimeServiceV2IntimeServiceV3_9Stub0Stub.CreateOrUpdateWorker();
    createWorkerRequest.setToken(ticket);
    createWorkerRequest.setWorker(worker);
    IntimeServiceV2IntimeServiceV3_9Stub0Stub.CreateOrUpdateWorkerResponse createWorkerResult=stub.createOrUpdateWorker(createWorkerRequest);
    if (createWorkerResult != null) {
        System.out.println("Created/updated Worker with ID:" + createWorkerResult.get_return());
    }
} else {
    worker = wkrs[0];
}
placement.setWorker(worker);


//set/update other placement fields

placement.setContractedHours(new BigDecimal(37.5));

placement.setCurrencyForCharge("GBP");

placement.setCurrencyForPayExpenses("GBP");

placement.setCurrencyForPayTimesheets("GBP");

placement.setChargeableExpenseApprovalRoute("Client Manager Approval");

placement.setNonChargeableExpenseApprovalRoute("Auto Approval");

placement.setTimesheetApprovalRoute("Auto Approval");

placement.setExpenseTemplate("Default");

placement.setHolidayAccuralRate(0.12);

placement.setJobDescription("Web Placement 1");

placement.setJobTitle("Web Test 001");

placement.setNoCommunications("");

placement.setPurchaseOrderNum("po_num");

placement.setSalesCostCentre("scc");

placement.setTimesheetDateCalculatorName("weekly");

placement.setPerm(false);


Calendar cal1 = Calendar.getInstance(java.util.TimeZone.getTimeZone("GMT"));

cal1.set(2021, 3, 1, 0, 0, 0);

placement.setStart(cal1);

Calendar cal2 = Calendar.getInstance(java.util.TimeZone.getTimeZone("GMT"));

cal2.set(2023, 3, 1, 0, 0, 0);

placement.setEnd(cal2);


IntimeServiceV2IntimeServiceV3_9Stub0Stub.Rate[] rates = new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.Rate[1];

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Rate rate1 = new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.Rate();

rate1.setName("Standard Hours");

rate1.setPay(new BigDecimal(9.99));

rate1.setCharge(new BigDecimal(11.11));

rate1.setPayElementCode("001");

rate1.setPeriod("Hourly");

rate1.setPeriodDuration(60);

rate1.setPriorityOrder(0);

rate1.setTimePattern("DEFAULT");

rate1.setTimesheetFields("START_FINISH_BREAK");

rate1.setSelectableByWorkers(true);

rates[0] = rate1;

placement.setRates(rates);


IntimeServiceV2IntimeServiceV3_9Stub0Stub.CreateOrUpdatePlacement request = new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.CreateOrUpdatePlacement();

request.setToken(ticket);

request.setPlacement(placement);


IntimeServiceV2IntimeServiceV3_9Stub0Stub.CreateOrUpdatePlacementResponse result=stub.createOrUpdatePlacement(request);

if (result != null) {

System.out.println("Created/updated Placement with ID:" + result.get_return());

}

} catch (java.lang.Exception e) {

System.out.println("Exception occurred: " + e);

}


...

try{

//Attempt to read the placement first 

IntimeServiceV2IntimeServiceV3_9Stub0Stub.GetPlacementByExternalId getPlacementRequest=new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.GetPlacementByExternalId();

getPlacementRequest.setId("WEB-PLC-001");

getPlacementRequest.setToken(ticket);

GetPlacementByExternalIdResponse placementResponse=stub.getPlacementByExternalId(getPlacementRequest);

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Placement placement=placementResponse.get_return();

if (placement == null) {

    //placement does not exist

    placement = new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.Placement();

    //refer to create placement process

}


//Apply any Consultant changes

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Consultant consultant=placement.getConsultant();

consultant.setDepartment("Web testing");


//Apply any Client changes

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Client client=placement.getClient();

client.getInvoicingContact().getAddress().setLine1("123 Test Street");


//Apply any Manager changes

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Manager manager=placement.getManager();
manager.setLastname("Modified");


//Apply any Worker changes

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Worker worker=placement.getWorker();

worker.getLimitedCompany().setCompanyVatNo("67896789");

worker.setDefaultPaymentCurrency("GBP");


//set/update other placement fields

placement.setPurchaseOrderNum("po_num 2");

placement.setSalesCostCentre("scc mod");


for (IntimeServiceV2IntimeServiceV3_9Stub0Stub.Rate rate : placement.getRates()) {

   if(rate.getName() == "Standard Hours") {

      //update pay/charge rate

      rate1.setPay(new BigDecimal(15));

      rate1.setCharge(new BigDecimal(22.50));

   }

}


IntimeServiceV2IntimeServiceV3_9Stub0Stub.CreateOrUpdatePlacement request = new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.CreateOrUpdatePlacement();

request.setToken(ticket);

request.setPlacement(placement);

IntimeServiceV2IntimeServiceV3_9Stub0Stub.CreateOrUpdatePlacementResponse result=stub.createOrUpdatePlacement(request);

if (result != null) {

System.out.println("Created/updated Placement with ID:" + result.get_return());

}

} catch (java.lang.Exception e) {

System.out.println("Exception occurred: " + e);

}

...

try{

//Read the associated placement so we can reference the rates & participants

IntimeServiceV2IntimeServiceV3_9Stub0Stub.GetPlacementByExternalId getPlacementRequest=new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.GetPlacementByExternalId();

getPlacementRequest.setId("WEB-PLC-001");

getPlacementRequest.setToken(ticket);

GetPlacementByExternalIdResponse placementResponse=stub.getPlacementByExternalId(getPlacementRequest);

Placement placement=placementResponse.get_return();


//identify the required rate

Rate rate1 = null;

for (Rate rate : placement.getRates()) {

if (rate.getName().equals("Standard Hours")) {

rate1 = rate;

}

}

Calendar cal = Calendar.getInstance(java.util.TimeZone.getTimeZone("GMT"));

cal.set(2017,9,1,0,0,0);

cal.set(Calendar.MILLISECOND, 0);


//create a timesheetSubmission

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Timesheet timesheetSubmission = new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.Timesheet();

timesheetSubmission.setPlacementExternalRef(placement.getExternalId());

timesheetSubmission.setSubmitterId(placement.getWorker().getId()); //Whoever is creating the Timesheet

timesheetSubmission.setPeriodEndDate(cal.getTime());


//Add the Shifts

IntimeServiceV2IntimeServiceV3_9Stub0Stub.Shift shift = new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.Shift();

shift.setComment("Shift 1 comment");

shift.setDay(cal.getTimeInMillis()); //set the day the shift relates to

shift.setRateId(rate1.getId());


if (rate1.getTimesheetFields().equals("START_FINISH_BREAK")) {

//This rate requires start, finish and break times entered for the shift

Calendar calStart = Calendar.getInstance(java.util.TimeZone.getTimeZone("GMT"));

calStart.set(2017,9,1,0,0,0);

calStart.set(Calendar.MILLISECOND, 0);

calStart.set(Calendar.HOUR_OF_DAY, 8);

shift.setStartTime(calStart.getTimeInMillis());


Calendar calEnd = Calendar.getInstance(java.util.TimeZone.getTimeZone("GMT"));

calEnd.set(2017,9,1,0,0,0);

calStart.set(Calendar.MILLISECOND, 0);

calEnd.set(Calendar.HOUR_OF_DAY, 17);

shift.setFinishTime(calEnd.getTimeInMillis());

shift.setMealBreak(3600000L); //1 hour in milliseconds

} else if (rate1.getTimesheetFields().equals("HOURS")) {

shift.setHours(8 * 60 * 60 * 1000L);

} else if (rate1.getTimesheetFields().equals("DECIMAL")) {

shift.setDecimal(new BigDecimal(1));

} else if (rate1.getTimesheetFields().equals("DAY")) {

shift.setDecimal(new BigDecimal(1));

}

Shift[] shifts = new Shift[1];

shifts[0] = shift;

timesheetSubmission.setShifts(shifts);


IntimeServiceV2IntimeServiceV3_9Stub0Stub.UpdateTimesheet updateTimesheetRequest=new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.UpdateTimesheet();

updateTimesheetRequest.setToken(ticket);

updateTimesheetRequest.setTimesheet(timesheetSubmission);

UpdateTimesheetResponse updateTimesheetResponse=stub.updateTimesheet(updateTimesheetRequest);

Long timesheetId=updateTimesheetResponse.get_return();

System.out.println("Update Timesheet returned:"+timesheetId);

} catch (Exception e) {

System.out.println("Exception occurred: " + e);

}

Submit a Timesheet

try {

IntimeServiceV2IntimeServiceV3_9Stub0Stub.SubmitTimesheet submitTimesheetRequest=new IntimeServiceV2 IntimeServiceV3_9Stub0Stub.SubmitTimesheet();

submitTimesheetRequest.setToken(ticket);

submitTimesheetRequest.setTimesheetId(<timesheet_id>);

SubmitTimesheetResponse submitTimesheetResponse=stub.submitTimesheet(submitTimesheetRequest);

System.out.println("Submit Timesheet returned: "+submitTimesheetResponse.get_return());

} catch (Exception e) {

System.out.println("Exception occurred: " + e);

}

...

FieldConstant

Comment

Notes
Client


invoicePeriod0Weekly

1Two-Weekly

2Four-Weekly

3Calendar Monthly

44-4-5




howSendInvoices0PostInvoice delivery method

1Email

2Fax

3Not sent




Worker


workerTypepayeFor PAYE Workers

ltdFor Ltd Company Workers

external-contractorFor Non Ltd Company Workers

cisFor CIS Workers

umbFor Workers operating through an UmbrellaYou must also reference the umbrella against the worker, otherwise the worker will appear as LTD.

ir35For workers inside scope of IR35 (deemed)




cisBusinessTypeSoleTrader


Company


Trust


Partnership





cisPercentage0


20


30





paymentFrequencyweekly


monthly


<InPay Payroll Name>If InPay connected, for PAYE workers, use the InPay Payroll Name




timesheetsOnInvoices0Timesheets On Invoices

1Timesheets Not On Invoices




paperOnInvoices-1Agency Default

0No Attachments

1Attach Paper Timesheets

2Attach Expense Group Paper

4Attach Expense Receipts Paper

<sum of the above>Attach the appropriate paperFor example, 5 to attach timesheets and receipts




genderM


F





LTD invoice period0Weekly

1Two-Weekly

2Four-Weekly

3Calendar Monthly

44-4-5




Payment Methodbacs
NOT CASE SENSITIVE

cheque
NOT CASE SENSITIVE

cash
NOT CASE SENSITIVE

chaps
NOT CASE SENSITIVE

ach
NOT CASE SENSITIVE

international
NOT CASE SENSITIVE

building society
NOT CASE SENSITIVE




Placement


layoutstandard
See Maintaining Placements

calendar





timesheetDateCalculatorweekly
See Maintaining Placements. You can see all possible values for this in the ui.

monthly


<many more>See UI for all options.




Rates


period60For hourly rates entered in hours format (hours only or start, break, finish).

1440For fixed rates of a specified duration entered in decimal format (decimal or tickbox)




periodDuration<any integer>The duration in minutes for the fixed rate (e.g. 60 for hours, 480 for a day).




timePatterndefaultWill use the selected default time pattern

<any string>The string should match the name of a time pattern in the system




timesheetFieldsSTART_FINISH_BREAKEnter start, break, finishOnly when period above is 60

HOURSEnter hours onlyOnly when period above is 60

DECIMALEnter time as a decimalOnly when period above is 1440

DAYTickbox only (equivalent to entering decimals as 1.00)Only when period above is 1440

InvoiceAdjustmentSettings

(Company / Worker)




AdjustBy0Fixed Amount

1Percentage
AdjustPer0Per Worker

1Per Timesheet

2Per Invoice
AdjustType0Addition

1Deduction

ExpenseType EntryMethod

0Gross valuePopulate the GrossValue and optionally the VatAmount field on an ExpenseItem with this entry method

1Net ValuePopulate the NetValue field on an ExpenseItem with this entry method

2Units and Unit netPopulate the Unit and UnitNet fields on an ExpenseItem with this entry method. E.g. Set Unit = 30 and UnitNet = 0.45 to claim 30 miles at 45p per mile.

3Units and NetPopulate the Unit and Net Value fields on an ExpenseItem with this entry method.