Package ch.aaap.harvestclient.api
Interface InvoicesApi
- All Superinterfaces:
 Api.Create<Invoice>,Api.Delete<Invoice>,Api.Get<Invoice>,Api.Simple<Invoice>
- All Known Implementing Classes:
 InvoicesApiImpl
- See Also:
 
- 
Method Summary
Modifier and TypeMethodDescriptionaddLineItem(Reference<Invoice> invoiceReference, InvoiceItem creationInfo) Create a new invoice line item and add it to the given invoiceaddLineItems(Reference<Invoice> invoiceReference, List<InvoiceItem> creationInfoList) Create new invoice line items and add it to the given invoiceCreate a new Invoice according to given creation information.createFrom(InvoiceImportInfo invoiceCreationInfo) Create a new Invoice based on time tracked and expense.voidDelete an existing Invoice.deleteLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference) Delete an existing line itemdeleteLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList) Delete an existing line itemlist(InvoiceFilter filter) Return a list of invoices, sorted by issue date, newest first.list(InvoiceFilter filter, int page, int perPage) Return a list of invoices, sorted by issue date, newest first.update(Reference<Invoice> invoiceReference, InvoiceUpdateInfo toChange) Updates an existing Invoice with the properties set in InvoiceUpdateInfo.updateLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference, InvoiceItemUpdateInfo updateInfo) Update an existing line itemupdateLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList, List<InvoiceItemUpdateInfo> updateInfoList) Update an existing line item 
- 
Method Details
- 
list
Return a list of invoices, sorted by issue date, newest first. Use the filter object to filter the list.- Parameters:
 filter- filtering options- Returns:
 - a (filtered) list of Invoices
 
 - 
list
Return a list of invoices, sorted by issue date, newest first. Use the filter object to filter the list. Page and perPage allow controlling how many results to return.- Parameters:
 filter- filtering optionspage- the page numberperPage- how many results to return for one page. Max 100- Returns:
 - a (filtered) list of Invoices
 
 - 
get
 - 
create
Create a new Invoice according to given creation information.- Specified by:
 createin interfaceApi.Create<Invoice>- Parameters:
 invoiceCreationInfo- the creation options- Returns:
 - the newly created Invoice
 
 - 
createFrom
Create a new Invoice based on time tracked and expense.- Parameters:
 invoiceCreationInfo- the creation options- Returns:
 - the newly created Invoice
 
 - 
addLineItem
Create a new invoice line item and add it to the given invoice- Parameters:
 invoiceReference- the invoice to add the item tocreationInfo- the line item to be created- Returns:
 - the updated Invoice
 
 - 
updateLineItem
Invoice updateLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference, InvoiceItemUpdateInfo updateInfo) Update an existing line item- Parameters:
 invoiceReference- the invoice that contains the itemupdateInfo- the line item to be updatedinvoiceItemReference- the line item to be deleted- Returns:
 - the updated Invoice
 
 - 
deleteLineItem
Invoice deleteLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference) Delete an existing line item- Parameters:
 invoiceReference- the invoice that contains the iteminvoiceItemReference- the line item to be deleted- Returns:
 - the updated Invoice
 
 - 
addLineItems
Create new invoice line items and add it to the given invoice- Parameters:
 invoiceReference- the invoice to add the item tocreationInfoList- a list of items to be created- Returns:
 - the updated Invoice
 
 - 
updateLineItems
Invoice updateLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList, List<InvoiceItemUpdateInfo> updateInfoList) Update an existing line item- Parameters:
 invoiceReference- the invoice that contains the iteminvoiceItemReferenceList- a list of the item references to be updated, in the same order as updateInfoListupdateInfoList- a list of the line items to be updated- Returns:
 - the updated Invoice
 
 - 
deleteLineItems
Invoice deleteLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList) Delete an existing line item- Parameters:
 invoiceReference- the invoice that contains the iteminvoiceItemReferenceList- a list of the line items to be deleted- Returns:
 - the updated Invoice
 
 - 
update
Updates an existing Invoice with the properties set in InvoiceUpdateInfo. Be careful: setting a list of InvoiceItem will add them to the existing ones, not replace them. SeedeleteLineItems(Reference, List)to delete existing items- Parameters:
 invoiceReference- the existing invoice to be updatedtoChange- the properties to be updated- Returns:
 - the updated Invoice
 
 - 
delete
Delete an existing Invoice.- Specified by:
 deletein interfaceApi.Delete<Invoice>- Parameters:
 invoiceReference- a reference to an existing Invoice to be deleted
 
 -