fferpcore.TaxCalculationServiceglobal with sharing class TaxCalculationService
This class provides the functionality required to connect to an external tax calculation service. EnumsAddressTextCaseThe letter case to use for the validated address.
DocumentType
DetailLevelThe level of detail to be returned from the tax service.
VoidRequestReason
Methods
getSettingsglobal static fferpcore.TaxCalculationService.Settings getSettings() Gets the saved tax calculation settings. Return ValueA Settings DTO that contains the tax calculation settings excluding the password/license key. saveSettingsglobal static fferpcore.TaxCalculationService.SaveSettingsResponse saveSettings(fferpcore.TaxCalculationService.Settings settings) Saves the modified settings. If the password is empty, the existing password/license key is not overwritten. Input Parameters
isEnabledglobal static Boolean isEnabled() Determines whether external tax calculation is enabled. Return ValueTrue if the endpoint service is enabled. testConnectionglobal static fferpcore.TaxCalculationService.TestConnectionResponse testConnection(fferpcore.TaxCalculationService.Settings settings) Calls the external tax calculation service with the saved settings to validate values. This method bypasses the enabled flag. Return ValueA Response object that contains the state of the connection and errors that occurred. validateAddressglobal static fferpcore.TaxCalculationService.ValidateAddressResponse validateAddress(fferpcore.TaxCalculationService.Address address) Calls the external tax calculation service with the address to be validated. Return ValueA ValidateAddressResponse object that contains the validated address. calculateTaxglobal static fferpcore.TaxCalculationService.TaxResponse calculateTax(fferpcore.TaxCalculationService.TaxDocument document) Calls the external tax calculation service with the document for which tax is to be calculated. Return ValueA TaxResponse object that contains the tax values for the document. commitTaxglobal static fferpcore.TaxCalculationService.TaxResponse commitTax(fferpcore.TaxCalculationService.TaxDocument document) Calls the external tax calculation service with a document for which tax is to be calculated and committed. Return ValueA TaxResponse object that contains the tax values for the document. commitTaxglobal static fferpcore.TaxCalculationService.TaxResponse commitTax(fferpcore.TaxCalculationService.CommitRequest request) Calls the external tax calculation service with a request to commit a draft document. Return ValueA TaxResponse object that contains the tax values for the document. calculateReversalglobal static fferpcore.TaxCalculationService.ReversalResponse calculateReversal(fferpcore.TaxCalculationService.CreditDocument document) Calls the external tax calculation service with a credit document for which tax is to be calculated. The monetary values in the document are expected to be positive. The returned tax values will also be positive. Return ValueA ReversalResponse object that contains the tax values for the credit document. commitReversalglobal static fferpcore.TaxCalculationService.ReversalResponse commitReversal(fferpcore.TaxCalculationService.CreditDocument document) Calls the external tax calculation service with a credit document for which tax is to be calculated and committed. The monetary values in the document are expected to be positive. The returned tax values will also be positive. Return ValueA ReversalResponse object that contains the tax values for the credit document. commitReversalglobal static fferpcore.TaxCalculationService.ReversalResponse commitReversal(fferpcore.TaxCalculationService.CommitRequest request) Calls the external tax calculation service with a request to commit a draft return document. The returned tax values will be positive. Return ValueA ReversalResponse object that contains the tax values for the credit document. uncommitTaxglobal static fferpcore.TaxCalculationService.UncommitResponse uncommitTax(fferpcore.TaxCalculationService.UncommitRequest request) Calls the external tax calculation service with a request to uncommit a document. Return ValueAn UncommitResponse object. uncommitReversalglobal static fferpcore.TaxCalculationService.UncommitResponse uncommitReversal(fferpcore.TaxCalculationService.UncommitRequest request) Calls the external tax calculation service with a request to uncommit a return document. Return ValueAn UncommitResponse object. voidTaxglobal static fferpcore.TaxCalculationService.VoidResponse voidTax(fferpcore.TaxCalculationService.VoidRequest request) Calls the external tax calculation service with a request to void a previously committed tax document. Return ValueA VoidResponse object. voidReversalglobal static fferpcore.TaxCalculationService.VoidResponse voidReversal(fferpcore.TaxCalculationService.VoidRequest request) Calls the external tax calculation service with a request to void a previously committed credit document. Return ValueA VoidResponse object. unvoidTaxglobal static fferpcore.TaxCalculationService.UnvoidResponse unvoidTax(fferpcore.TaxCalculationService.UnvoidRequest request) Calls the external tax calculation service with a request to unvoid a previously voided document. Return ValueAn UnvoidResponse object. unvoidReversalglobal static fferpcore.TaxCalculationService.UnvoidResponse unvoidReversal(fferpcore.TaxCalculationService.UnvoidRequest request) Calls the external tax calculation service with a request to unvoid a previously voided credit document. Return ValueAn UnvoidResponse object. verifyTaxglobal static fferpcore.TaxCalculationService.VerifyResponse verifyTax(fferpcore.TaxCalculationService.VerifyRequest request) Calls the external tax calculation service with a request to verify a previously created uncommitted document. Return ValueA VerifyResponse object. verifyReversalglobal static fferpcore.TaxCalculationService.VerifyResponse verifyReversal(fferpcore.TaxCalculationService.VerifyRequest request) Calls the external tax calculation service with a request to verify a previously created uncommitted return document. The monetary values in the request are expected to be positive. Return ValueA VerifyResponse object. createWorkScopeglobal static fferpcore.Disposable createWorkScope() Creates a scope to facilitate grouping tax operations together. Scopes can be nested. Return ValueA Disposable object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. public void calculateTax(List<Document> documents) { fferpcore.Disposable workScope = fferpcore.TaxCalculationService.createWorkScope(); try { for(Document document : documents) { // The calculateTax method marshals the Document, calculates tax and unmarshals // the result. calculateTax(document); } } finally { // Use of try-finally ensures that the work scope is always disposed, // even if calculateTax results in an exception. workScope.dispose(); } } fferpcore.TaxCalculationService.Settingsglobal inherited sharing class Settings This class wraps the tax calculation settings in a Salesforce org. Properties
Methodsfferpcore.TaxCalculationService.AdvancedMessageglobal inherited sharing class AdvancedMessage fferpcore.Message data with enhanced information. Properties
fferpcore.TaxCalculationService.Responseglobal inherited sharing virtual class Response Data returned from the external tax provider. Properties
fferpcore.TaxCalculationService.SaveSettingsResponseglobal inherited sharing class SaveSettingsResponse extends Response Data concerning an attempt to save settings. This class extends fferpcore.TaxCalculationService.Response Properties
Methods
SaveSettingsResponseglobal SaveSettingsResponse() SaveSettingsResponseglobal SaveSettingsResponse(fferpcore.TaxCalculationService.TestConnectionResponse response) fferpcore.TaxCalculationService.TestConnectionResponseglobal inherited sharing class TestConnectionResponse extends Response Data returned from the external tax provider following a connection test. This class extends fferpcore.TaxCalculationService.Response fferpcore.TaxCalculationService.ValidateAddressResponseglobal inherited sharing class ValidateAddressResponse extends Response Data returned from the external tax provider after validating an address. This class extends fferpcore.TaxCalculationService.Response Properties
fferpcore.TaxCalculationService.TaxResponseglobal inherited sharing virtual class TaxResponse extends Response Data returned from the external tax provider after calculating tax. This class extends fferpcore.TaxCalculationService.Response Properties
MethodsTaxResponseglobal TaxResponse() fferpcore.TaxCalculationService.TaxResponseLineglobal inherited sharing class TaxResponseLine Data concerning the calculated tax for a provided request line. Properties
fferpcore.TaxCalculationService.Addressglobal inherited sharing virtual class Address Data concerning an address. Properties
fferpcore.TaxCalculationService.ValidatedAddressglobal inherited sharing class ValidatedAddress extends Address Data concerning a validated address. This class extends fferpcore.TaxCalculationService.Address Properties
MethodsValidatedAddressglobal ValidatedAddress() fferpcore.TaxCalculationService.DocumentIdentityglobal inherited sharing virtual class DocumentIdentity Data that identifies a document. Properties
MethodsDocumentIdentityglobal DocumentIdentity(String companyCode, String documentCode) Construct a document identity with the given company code and document code. Input Parameters
fferpcore.TaxCalculationService.TaxDocumentglobal inherited sharing virtual class TaxDocument extends DocumentIdentity Document data provided to the external tax calculation service to calculate tax. This class extends fferpcore.TaxCalculationService.DocumentIdentity Properties
fferpcore.TaxCalculationService.CommitRequestglobal inherited sharing class CommitRequest Data provided to the external tax calculation service to commit an existing document. Properties
Methods
CommitRequestglobal CommitRequest() CommitRequestglobal CommitRequest(fferpcore.TaxCalculationService.DocumentIdentity document, fferpcore.TaxCalculationService.DetailLevel detailsToInclude) Construct a commit request for an existing document, specifying the level of detail to include in the tax response. Input Parameters
fferpcore.TaxCalculationService.TaxRequestLineglobal inherited sharing class TaxRequestLine Data concerning a tax line for calculation. Properties
fferpcore.TaxCalculationService.CreditDocumentglobal inherited sharing class CreditDocument extends TaxDocument Credit document data provided to the external tax calculation service to calculate tax. This class extends fferpcore.TaxCalculationService.TaxDocument Properties
fferpcore.TaxCalculationService.ReversalResponseglobal inherited sharing class ReversalResponse extends TaxResponse Data returned from the external tax provider following the tax calculation of a credit document. This class extends fferpcore.TaxCalculationService.TaxResponse MethodsReversalResponseglobal ReversalResponse() fferpcore.TaxCalculationService.UncommitRequestglobal inherited sharing class UncommitRequest Data provided to the external tax calculation service to uncommit an existing document. Properties
Methods
UncommitRequestglobal UncommitRequest() UncommitRequestglobal UncommitRequest(fferpcore.TaxCalculationService.DocumentIdentity document) Construct an uncommit request for an existing document. Input Parameters
fferpcore.TaxCalculationService.UncommitResponseglobal inherited sharing class UncommitResponse extends Response Data returned from the external tax provider following the uncommit of a document. This class extends fferpcore.TaxCalculationService.Response Properties
MethodsUncommitResponseglobal UncommitResponse() fferpcore.TaxCalculationService.VoidRequestglobal inherited sharing class VoidRequest Data provided to the external tax calculation service to void a document. Properties
Methods
VoidRequestglobal VoidRequest(fferpcore.TaxCalculationService.DocumentIdentity document, fferpcore.TaxCalculationService.VoidRequestReason reason) Construct a Void Request for the given Document with the given Reason. Input Parameters
VoidRequestglobal VoidRequest(String companyCode, String documentCode, fferpcore.TaxCalculationService.VoidRequestReason reason) Construct a Void Request for the given Document with the given Reason. Input Parameters
fferpcore.TaxCalculationService.VoidResponseglobal inherited sharing class VoidResponse extends Response Data returned from the external tax provider following the voiding of a document. This class extends fferpcore.TaxCalculationService.Response MethodsVoidResponseglobal VoidResponse() fferpcore.TaxCalculationService.TaxDetailglobal inherited sharing class TaxDetail Tax details by jurisdiction. Properties
fferpcore.TaxCalculationService.UnvoidRequestglobal inherited sharing class UnvoidRequest Data provided to the external tax calculation service to unvoid a void document. Properties
Methods
UnvoidRequestglobal UnvoidRequest() UnvoidRequestglobal UnvoidRequest(fferpcore.TaxCalculationService.DocumentIdentity document) Construct an unvoid request for an existing void document. Input Parameters
fferpcore.TaxCalculationService.UnvoidResponseglobal inherited sharing class UnvoidResponse extends Response Data returned from the external tax provider following the unvoiding of a document. This class extends fferpcore.TaxCalculationService.Response Properties
MethodsUnvoidResponseglobal UnvoidResponse() fferpcore.TaxCalculationService.VerifyRequestglobal inherited sharing class VerifyRequest Data provided to the external tax calculation service to verify a document. Properties
MethodsVerifyRequestglobal VerifyRequest() fferpcore.TaxCalculationService.VerifyResponseglobal inherited sharing class VerifyResponse extends Response Data returned from the external tax provider following the verifying of a document. This class extends fferpcore.TaxCalculationService.Response Properties
MethodsVerifyResponseglobal VerifyResponse() |