updateInvoiceMemoTaxCalculationsAndBreakups API calculates Tax Amount and populates it on the Invoice.

APISignature
updateInvoiceTaxCalculationsAndBreakupsstatic void updateInvoiceTaxCalculationsAndBreakups(Set InvoiceIds, Boolean autoTransitionFromPendingApprovedToApproved)

This API calculates Tax Amount and Tax Breakups for invoices with status as 'Draft' or 'Pending Approved'. After tax computation, it updates the Tax Amount on each invoice line item and creates or updates Invoice Line Item Tax Breakups. It then calculates the Total Tax Amount for the invoice and creates or updates the Invoice Tax Breakups.

If autoTransitionFromPendingApprovedToApproved is set to true, it updates the status of the invoice from Pending Approved to Approved. 

The billing administrator must register a Tax Callback class for updateInvoiceTaxCalculationsAndBreakups API to work. For details on how to register a Tax Callback class, refer to Custom Settings for Tax.

Request

Field

Type

Required?

Description

invoiceIDs

List <Id>

Yes

List of Invoice Ids

autoTransitionFromPendingApprovedToApprovedBooleanYes

If set to true, the API updates the status of the Invoice from Pending Approved to Approved.

If set to false, the invoice status is not updated.


Code Sample

The code sample below helps you calculate and fetch Tax Amount for invoices.

Set<ID> invoiceIDs = new Set<ID>();
invoiceIDs.add('invoiceID')
Apttus_Billing.BillingService.updateInvoiceTaxCalculationsAndBreakups(invoiceIDs,true);
CODE