Skip to content

Instantly share code, notes, and snippets.

@IntuitDeveloperRelations
Last active December 16, 2015 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntuitDeveloperRelations/5467757 to your computer and use it in GitHub Desktop.
Save IntuitDeveloperRelations/5467757 to your computer and use it in GitHub Desktop.
IPP .NET DevKit v2 - QBO - TimeActivity - Add
//Add QBO TimeActivity
//Documentation: http://goo.gl/DjJyb
List<Employee> employees = commonService.FindAll(new Employee(), 1, 1).ToList<Employee>();
List<Customer> customers = commonService.FindAll(new Customer(), 1, 1).ToList<Customer>();
TimeActivity timeActivity = new TimeActivity();
timeActivity.BillableStatus = BillableStatusEnum.Billable;
timeActivity.BillableStatusSpecified = true;
timeActivity.Hours = "8";
timeActivity.Minutes = "0";
timeActivity.BreakHours = "1";
timeActivity.BreakMinutes = "0";
timeActivity.Taxable = true;
timeActivity.TaxableSpecified = true;
timeActivity.TxnDate = DateTime.Now.Date;
timeActivity.TxnDateSpecified = true;
timeActivity.HourlyRate = new decimal(200);
timeActivity.HourlyRateSpecified = true;
timeActivity.CustomerId = customers[0].Id;
timeActivity.NameOf = TimeActivityTypeEnum.Employee;
timeActivity.NameOfSpecified = true;
timeActivity.Item = new EmployeeRef() { EmployeeId = employees[0].Id, EmployeeName = employees[0].Name };
timeActivity.ItemName = "TestTimeActivity";
timeActivity.ItemType = ItemTypeEnum.Service;
TimeActivity timeActivityResult = commonService.Add(timeActivity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment