updateCreditMemoTaxCalculationsAndBreakups API calculates Tax Amount and populates it on the Credit Memo.

APISignature
updateCreditMemoTaxCalculationsAndBreakupsstatic void updateCreditMemoTaxCalculationsAndBreakups(Set CreditmemoIds, Boolean autoTransitionFromPendingApprovedToApproved)

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

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

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

Request

Field

Type

Required?

Description

creditMemoIDs

Set <Id>

Yes

Set of Credit Memo Ids

autoTransitionFromPendingApprovedToApprovedBooleanYes

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

If set to false, the credit memo status is not updated.


Code Sample

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

Set<ID> creditMemoIDs = new Set<ID>();
//[{creditMemos[0].Id, creditMemos[1].Id};]
Apttus_Billing.BillingService.updateCreditMemoTaxCalculationsAndBreakups(creditMemoIDs, true);
CODE