Package ch.aaap.harvestclient.impl
Class InvoicesApiImpl
Object
ch.aaap.harvestclient.impl.InvoicesApiImpl
- All Implemented Interfaces:
Api.Create<Invoice>,Api.Delete<Invoice>,Api.Get<Invoice>,Api.Simple<Invoice>,InvoicesApi
-
Constructor Summary
Constructors -
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
-
Constructor Details
-
InvoicesApiImpl
-
-
Method Details
-
list
Description copied from interface:InvoicesApiReturn a list of invoices, sorted by issue date, newest first. Use the filter object to filter the list.- Specified by:
listin interfaceInvoicesApi- Parameters:
filter- filtering options- Returns:
- a (filtered) list of Invoices
-
list
Description copied from interface:InvoicesApiReturn 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.- Specified by:
listin interfaceInvoicesApi- Parameters:
filter- filtering optionspage- the page numberperPage- how many results to return for one page. Max 100- Returns:
- a (filtered) list of Invoices
-
get
- Specified by:
getin interfaceApi.Get<Invoice>- Specified by:
getin interfaceInvoicesApi- Parameters:
invoiceReference- a reference to an existing Invoice- Returns:
- Return a full Invoice object
-
create
Description copied from interface:InvoicesApiCreate a new Invoice according to given creation information.- Specified by:
createin interfaceApi.Create<Invoice>- Specified by:
createin interfaceInvoicesApi- Parameters:
invoiceCreationInfo- the creation options- Returns:
- the newly created Invoice
-
createFrom
Description copied from interface:InvoicesApiCreate a new Invoice based on time tracked and expense.- Specified by:
createFromin interfaceInvoicesApi- Parameters:
invoiceCreationInfo- the creation options- Returns:
- the newly created Invoice
-
addLineItem
Description copied from interface:InvoicesApiCreate a new invoice line item and add it to the given invoice- Specified by:
addLineItemin interfaceInvoicesApi- Parameters:
invoiceReference- the invoice to add the item tocreationInfo- the line item to be created- Returns:
- the updated Invoice
-
updateLineItem
public Invoice updateLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference, InvoiceItemUpdateInfo updateInfo) Description copied from interface:InvoicesApiUpdate an existing line item- Specified by:
updateLineItemin interfaceInvoicesApi- Parameters:
invoiceReference- the invoice that contains the iteminvoiceItemReference- the line item to be deletedupdateInfo- the line item to be updated- Returns:
- the updated Invoice
-
deleteLineItem
public Invoice deleteLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference) Description copied from interface:InvoicesApiDelete an existing line item- Specified by:
deleteLineItemin interfaceInvoicesApi- Parameters:
invoiceReference- the invoice that contains the iteminvoiceItemReference- the line item to be deleted- Returns:
- the updated Invoice
-
addLineItems
public Invoice addLineItems(Reference<Invoice> invoiceReference, List<InvoiceItem> creationInfoList) Description copied from interface:InvoicesApiCreate new invoice line items and add it to the given invoice- Specified by:
addLineItemsin interfaceInvoicesApi- Parameters:
invoiceReference- the invoice to add the item tocreationInfoList- a list of items to be created- Returns:
- the updated Invoice
-
updateLineItems
public Invoice updateLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList, List<InvoiceItemUpdateInfo> updateInfoList) Description copied from interface:InvoicesApiUpdate an existing line item- Specified by:
updateLineItemsin interfaceInvoicesApi- 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
public Invoice deleteLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList) Description copied from interface:InvoicesApiDelete an existing line item- Specified by:
deleteLineItemsin interfaceInvoicesApi- Parameters:
invoiceReference- the invoice that contains the iteminvoiceItemReferenceList- a list of the line items to be deleted- Returns:
- the updated Invoice
-
update
Description copied from interface:InvoicesApiUpdates 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. SeeInvoicesApi.deleteLineItems(Reference, List)to delete existing items- Specified by:
updatein interfaceInvoicesApi- Parameters:
invoiceReference- the existing invoice to be updatedtoChange- the properties to be updated- Returns:
- the updated Invoice
-
delete
Description copied from interface:InvoicesApiDelete an existing Invoice.- Specified by:
deletein interfaceApi.Delete<Invoice>- Specified by:
deletein interfaceInvoicesApi- Parameters:
invoiceReference- a reference to an existing Invoice to be deleted
-