TaxEngines Interface

Your tax engine implements this interface. It contains methods for calculating tax, clearing in-memory entities from the previous call, and clearing legal references from the previous call.

Namespace

blng

TaxEngines Methods

Learn more about the methods available with the TaxEngines interface.

The TaxEngines interface includes these methods.

resetSObjectListofIds()

Sets the in-memory IDs, such as credit note IDs, debit note IDs, to null.

Signature

global static Void resetSObjectListofIds()

Return Value

Type: Void

resetLegalEntityReferences()

Sets the in-memory list of legal entities to null.

Signature

global static Void resetLegalEntityReferences()

Return Value

Type: Void

calculateTax(taxParametersInstance)

Returns the calculated tax for the specified taxParametersInstance parameter.

Signature

global static Map<Id,TaxResults> calculateTax(TaxParameters taxParametersInstance)

Parameters

taxParametersInstance
Type: TaxParameters

The taxParametersInstance parameter is populated based on the process that uses tax calculation. These examples show the sample values for each process.

Order is created
TaxParameters:[
 isCommitOnGetTax=false,
 isStandardFromBatch=false,
 legalEntityReference=80105000000i1MqAAI,
 listOfSObjectIds=(),
 listOfSObjects=(),
 mapOfSObjectByUniqueId={},
 mapOfTaxResultsById={},
 mapOfTaxTreatmentById={},
 sObjectId=null,
 sObjectTypeInstance=OrderItem,
 sobjectInstance=null,
 taxMethod=null
]
Bill Now or Invoice is created
TaxParameters:[
 isCommitOnGetTax=false,
 isStandardFromBatch=false,
 legalEntityReference=a2305000000BKIoAAO,
 listOfSObjectIds=(),
 listOfSObjects=(),
 mapOfSObjectByUniqueId={},
 mapOfTaxResultsById={},
 mapOfTaxTreatmentById={},
 sObjectId=null,
 sObjectTypeInstance=blng__InvoiceLine__c,
 sobjectInstance=null,
 taxMethod=null
]
Invoice is manually posted
TaxParameters:[
isCommitOnGetTax=false,
 isStandardFromBatch=false,
 legalEntityReference=null,
 listOfSObjectIds=(a2305000000BKIoAAO),
 listOfSObjects=(),
 mapOfSObjectByUniqueId={},
 mapOfTaxResultsById={},
 mapOfTaxTreatmentById={},
 sObjectId=null,
 sObjectTypeInstance=blng__Invoice__c,
 sobjectInstance=null,
 taxMethod=postTax
]

Return Value

Type: Map<Id,TaxResults>