Skip to main content
Coming soon - a new Avalara Knowledge Center
Avalara Help Center

Tax Calculation for Salesforce Cloud Discount Functionality

AvaTax can calculate tax dynamically for any transaction, which considers both the discounted amount and the Storefront tax type setting in the B2B & B2C connector settings (Gross / Net).

AvaTax supports the below discount types of Salesforce:

  • Header Level Discount
  • Tiered Discount
  • Itemized Discount

Before you Begin

  • In Salesforce, go to App Launch >> Flows, create a Promotion Sub Flow, as explained here.
  • For Header level discount, add Coupon code and Promotion code components to your Storefront, as explained here.
  • Set up a Promotion Segment, as explained here.

Calculated Tax for Tier level Discounts

The CartItem table in Salesforce will contain the calculated tax amounts for the Tier level discounts applied in any transaction.

  • In the developer console, go to the CartItem table
  • In the CartItem table, tax amount for the discounted price will be stored as positive value in the AdjustmentTaxAmount column for the respective product.

Calculated Tax for Itemized Discounts

The CartTax table in Salesforce will show contain the calculated tax amounts and rates for the discounts applied in any transaction.To see the calculated tax for the header level and itemized discounts:

  • In the developer console, go to the CartTax table
  • In the CartTax table, tax amount for the discounted price will be passed in negative value for respective line items.

Calculated Tax for Header Discounts

Follow the below steps:

  • In the developer console, go to the CartItemPriceAdjusment (C.I.P.A.) table
  • In the CIPA table, the discounted price will be passed in negative from the TotalAmount field to AvaTax
  • NetUnitPrice and GrossUnitPrice will be calculated based on the Storefront tax type
  • To see the calculated tax for the header discounts, see CartTax table for results

Storefront TaxType

Storefront tax type can either be set to Net or Gross. NetUnitPrice and GrossUnitPrice of the CartItem table will be calculated as shown below:

Tax Type

Net unit price

Gross unit price

Net

CartItem.TotalLineAmount / CartItem.Quanity

(CartItem.TotalLineAmount + CartItem.TotalLineTaxAmount) / CartItem.Quantity

Gross

(CartItem.TotalLineAmount - CartItem.TotalLineTaxAmount) / CartItem.Quantity

CartItem.TotalLineAmount / CartItem.Quanit

  • Was this article helpful?