Billing Central Apex API Developer Reference
|
ffbc.BillingDocumentsServiceglobal with sharing class BillingDocumentsService This class provides service functionality for billing documents. EnumsTypeAn enum that represents the valid types of billing documents.
StatusAn enum that represents the valid statuses of billing documents.
Methods
validateForCompleteglobal static ffbc.BillingDocumentsService.ValidateCompleteResponse validateForComplete(ffbc.BillingDocumentsService.ValidateCompleteRequest request) Validates that the billing documents supplied can be completed. Input Parameters
Return ValueObject containing information about the Validate for Complete process including valid billing documents and the errors that occurred. completeglobal static List<ffbc.BillingDocumentsService.CompleteResponse> complete(Set<Id> billingDocumentIds) Completes the supplied billing documents by changing their status to Complete and updating the billed data in related contract line items. Input Parameters
Return ValueList of results for each billing document provided. completeAndUpdateBilledDataThe functionality of this service has been moved into the complete service. global static List<ffbc.BillingDocumentsService.CompleteResponse> completeAndUpdateBilledData(Set<Id> billingDocumentIds) Completes the supplied billing documents by changing their status to Complete and updating the billed data in related contract line items. Input Parameters
Return ValueList of results for each billing document provided. getTotalsglobal static List<ffbc.BillingDocumentsService.Total> getTotals(Set<Id> billingDocumentIds) Returns a list of totals for the billing documents supplied. Input Parameters
Return ValueList of Totals that contains the billing document ID and its calculated totals. global static Messaging.SendEmailResult email(Id billingDocumentId, Id billingContactId) Sends the billing document to the billing contact by email using the Messaging.sendEmail method and updates the Date Issued field of the billing document if successful. This method can be called a maximum number of ten times in a single execution context. Input Parameters
Exceptions Thrown
Return ValueThe response from the email service. See Messaging.SendEmailResult for more details. loadglobal static List<ffbc.BillingDocumentsService.BillingDocument> load(Set<Id> billingDocumentIds) Retrieves the billing documents from the IDs provided and returns a wrapper for each billing document. The additional fields to be shown on the enhanced Billing Document page are retrieved. Input Parameters
Return ValueThe wrappers for the billing documents. saveglobal static Set<Id> save(List<ffbc.BillingDocumentsService.BillingDocument> documentsToSave) Saves new or existing billing documents and billing document line items. Billing document line items that belong to the billing documents provided but are not included in the wrapper objects provided are deleted. Input Parameters
Exceptions Thrown
Return ValueThe set of IDs of billing documents that have been saved. deleteBillingDocumentsglobal static void deleteBillingDocuments(Set<Id> billingDocumentIds) Deletes the billing documents with the IDs provided. Input Parameters
discardglobal static ffbc.BillingDocumentsService.DiscardResponse discard(Set<Id> billingDocumentIds) Discards the billing documents supplied by changing their Document Status to Discarded. The related billing schedules are deleted or their link to the billing document is removed. In addition, the related billing document line items are deleted. Input Parameters
Return ValueResponse containing the IDs of discarded Billing Documents and the errors that occurred. discardAsyncglobal static Id discardAsync(Set<Id> billingDocumentIds) Discards the billing documents supplied by changing their Document Status to Discarded. The related billing schedules are deleted or their link to the billing document is removed. In addition, the related billing document line items are deleted. These actions are carried out by an asynchronous process. Input Parameters
Return ValueThe ID of the asynchronous process that is to discard the billing documents. convertInvoiceToCreditNoteAndUpdateBilledDataThis method has been deprecated, use the convertInvoiceToCreditNote instead. global static ffbc.BillingDocumentsService.CreditingResponse convertInvoiceToCreditNoteAndUpdateBilledData(ffbc.BillingDocumentsService.CreditingRequest request) Converts the supplied billing documents to credit notes by copying all the data. Only Complete invoices can be converted. An error message is returned for each billing document that could not be converted. Once a billing document is converted, the Billing Document Line Item field on related schedules is cleared if the option to allow further billing for that invoice was selected. In addition, an asynchronous process is started to update the billed data in related contract line items. Input Parameters
Return ValueObject containing information about the Convert Invoice to Credit Note process including the credit notes created and the errors that occurred. convertInvoiceToCreditNoteAsyncglobal static Id convertInvoiceToCreditNoteAsync(ffbc.BillingDocumentsService.CreditingRequest request) Converts the supplied billing documents to credit notes by copying all the data asynchonously. Only Complete invoices can be converted. An error message is returned for each billing document that could not be converted. Once a billing document is converted, the Billing Document Line Item field on related billing schedules is cleared if the option to allow further billing for that invoice was selected. Input Parameters
Return ValueThe ID of the asynchronous process that is to convert the billing documents. completeAsyncglobal static Id completeAsync(Set<Id> billingDocumentIds) Completes the supplied billing documents asynchronously. After completion, a separate asynchronous job is created to update the billing data of contract line items associated with the billing documents that were successfully completed. Input Parameters
Return ValueThe ID of the asynchronous process that will complete the billing documents. getAdditionalFieldMetadataglobal static List<ffbc.FieldMetadata> getAdditionalFieldMetadata() Retrieves metadata for additional billing document and billing document line item fields that are visible when viewing, creating and editing a billing document. Return ValueObject containing basic field information for the additional fields. updateBilledDataOnRelatedContractLinesglobal static void updateBilledDataOnRelatedContractLines(Set<Id> billingDocumentIds) Updates the total billed value on the related contract line items. You can use this method to update the Total Billed and Billed To fields of related contract line items for complete billing documents. Billing documents are ignored if they are already complete and the billed data in related contract line items is up to date. Input Parameters
convertInvoiceToCreditNoteglobal static ffbc.BillingDocumentsService.CreditingResponse convertInvoiceToCreditNote(ffbc.BillingDocumentsService.CreditingRequest request) Converts the supplied billing documents to credit notes. Only Complete invoices can be converted. An error message is returned for each billing document that could not be converted. Once a billing document is converted, the Billing Document Line Item field on related billing schedules is cleared if the option to allow further billing for that invoice was selected. Input Parameters
Return ValueObject containing information about the Convert Invoice to Credit Note process including the credit notes created and the errors that occurred. ffbc.BillingDocumentsService.CompleteResponseglobal class CompleteResponse This class wraps a response for a request to complete a billing document. Properties
ffbc.BillingDocumentsService.ValidateCompleteRequestglobal class ValidateCompleteRequest This class wraps a request to validate the completion of billing documents. Properties
MethodsValidateCompleteRequestglobal ValidateCompleteRequest() The default constructor for a ValidateCompleteRequest object. ffbc.BillingDocumentsService.ValidateCompleteResponseglobal class ValidateCompleteResponse extends Response This class wraps a response for a request to validate the completion of a billing document. This class extends ffbc.Response Properties
ffbc.BillingDocumentsService.Totalglobal class Total This class contains the totals for the billing document. Properties
ffbc.BillingDocumentsService.BillingDocumentglobal class BillingDocument This models a billing document, including fields that are relevant to creating, viewing and editing. Properties
Methodsffbc.BillingDocumentsService.BillingDocumentLineItemglobal class BillingDocumentLineItem This models a billing document line item, including fields that are relevant to creating, viewing and editing. Properties
MethodsBillingDocumentLineItemglobal BillingDocumentLineItem() The default constructor for a billing document line item object. ffbc.BillingDocumentsService.CreditingRequestglobal class CreditingRequest This class provides the parameters for converting invoices to credit notes. Methods
addBillingDocumentglobal void addBillingDocument(Id billDocId, Boolean allowConvertedInvoiceToBeRebilled) Adds a billing document to be processed. Input Parameters
ffbc.BillingDocumentsService.CreditingResponseglobal class CreditingResponse extends Response This class is returned by methods which convert invoices to credit notes. You can use this class to discover if there were any errors when converting invoice billing documents to credit notes and to get a list of the IDs of documents that were converted to a credit note. This class extends ffbc.Response Properties
ffbc.BillingDocumentsService.DiscardResponseglobal class DiscardResponse extends Response This class is returned by the discard method. You can use this class to discover if there were any errors when discarding billing documents, and to get a list of the IDs of the billing documents that were discarded. This class extends ffbc.Response Properties
|