Versions Compared

Key

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

...

try {

IntimeServiceV2_0Stub.Worker worker = new IntimeServiceV2_0Stub.Worker();

worker.setExternalId("WKR_LTD_001");

worker.setFirstname("Ltd");

worker.setLastname("Worker");

worker.setEmail("x@x.com");

worker.setTitle("Mrs");

worker.setWorkerType("ltd");

worker.setGender("F");

worker.setSelfBilling(false);

worker.setAccountsReference("ACC_REF");

worker.setPaymentFrequency("Monthly");


String[] wConsolidation = new String[] { "destination","source","pay-currency","purchase-tax-code","worker","placement" };

worker.setConsolidation(wConsolidation);

String[] wCrouping = new String[] { "sheet","sheet-rate" };

worker.setGrouping(wCrouping);


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

cal.set(1980, 0, 1, 0, 0, 0);

cal.set(Calendar.MILLISECOND, 0);

worker.setDateOfBirth(cal);

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

cal2.set(2017, 0, 1, 0, 0, 0);

cal2.set(Calendar.MILLISECOND, 0);

worker.setDateOfJoining(cal2);


IntimeServiceV2_0Stub.Address address = new IntimeServiceV2_0Stub.Address();

address.setLine1("Address1");

address.setLine2("Add2");

address.setTown("Town");

address.setCounty("County");

address.setCountry("UK");

address.setPostcode("AB1 2CD");

address.setCountryCode("GB");

worker.setAddress(address);


BankAccount bank = new BankAccount();

bank.setAccountName("Ltd Wkr");

bank.setAccountNumber("12345678");

bank.setBank("bank");

bank.setSortCode("11-22-33");

worker.setBankAccount(bank);


Company ltdCompany = new Company();

ltdCompany.setName("Ltd Co Name");

ltdCompany.setCompanyNo("123456789");

ltdCompany.setCompanyVatNo("1234567890");

ltdCompany.setVatCode("T0");

worker.setLimitedCompany(ltdCompany);


IntimeServiceV2_0Stub.CreateOrUpdateWorker request = new IntimeServiceV2_0Stub.CreateOrUpdateWorker();

request.setToken(ticket);

request.setWorker(worker);


IntimeServiceV2_0Stub.CreateOrUpdateWorkerResponse result=stub.createOrUpdateWorker(request);

if (result != null) {

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

}

} catch (java.lang.Exception e) {

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



createOrUpdatePlacement

try{

IntimeServiceV2_0Stub.Placement placement = new IntimeServiceV2_0Stub.Placement();


//referencing existing participants by External Id

IntimeServiceV2_0Stub.Worker worker = new IntimeServiceV2_0Stub.Worker();

worker.setExternalId("WKR_001");

placement.setWorker(worker);


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

consultant.setExternalId("CONS_001");

placement.setConsultant(consultant);


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

client.setExternalId("CLIENT_001");

placement.setClient(client);


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

manager.setExternalId("MGR_001");

placement.setManager(manager);


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

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(2017, 3, 1, 0, 0, 0);

placement.setStart(cal1);

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

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

placement.setEnd(cal2);


IntimeServiceV2_0Stub.Rate[] rates = new IntimeServiceV2_0Stub.Rate[1];

IntimeServiceV2_0Stub.Rate rate1 = new IntimeServiceV2_0Stub.Rate();

rate1.setName("Standard Day");

rate1.setPay(new BigDecimal(99.99));

rate1.setCharge(new BigDecimal(111.11));

rate1.setPayElementCode("001");

rate1.setPeriod("fixed");

rate1.setPeriodDuration(480);

rate1.setPriorityOrder(0);

rate1.setTimePattern("DEFAULT");

rate1.setTimesheetFields("DECIMAL");

rate1.setSelectableByWorkers(true);

rates[0] = rate1;

placement.setRates(rates);


IntimeServiceV2_0Stub.CreateOrUpdatePlacement request = new IntimeServiceV2_0Stub.CreateOrUpdatePlacement();

request.setToken(ticket);

request.setPlacement(placement);


IntimeServiceV2_0Stub.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);

}



- getPlacement



- update timesheet

...