Release 22.06.01

Customer Usage Type

A new UDF is added at Marketing Documents header level: U_ARGNS_CUUT, named Customer Usage Type.

This field is mapped on tax calculations to the Avatax request Customer Usage Type field.


Tax Included

A new UDF U_ARGNS_TAXINCL is added, at Marketing Documents header level, with valid values Yes/No, default to No.

Calculating with this flag set to yes enables sending the tax calculation request to Avatax with the taxIncluded field of the request set to true.

This will indicate Avatax that the amount values for the lines in the calculation request already includes the tax in the total. You may expect then to have the line total result on the calculation response to be same as the requested, and the tax calculated accordly.

Check this sample comparing the calculation response when using the taxIncluded flag or not.

With Tax Included set to No, the calculation will perform as usual, calculating the tax over the total.

Request  Response
Item Quantity Unit Price SAP Total Calculated Tax Rate Calculated Line Amount Calculated Tax Total
SampleItem 1 10.00 10.00 0.0675 10.00 0.68
SampleItem2 2 20.00 40.00 0.0675 40.00 2.70

Now, calculating with Tax Included set to Yes, the result will be the following:

Request  Response
Item Quantity Unit Price SAP Total Calculated Tax Rate Calculated Line Amount Calculated Tax Total
SampleItem 1 10.00 10.00 0.0675 9.37 0.63
SampleItem2 2 20.00 40.00 0.0675 37.47 2.53

From the Avatax refefrence

Applications of TaxIncluded

The TaxIncluded parameter tells AvaTax to use a product’s price as a target for the total sale. Both the tax and amount will be adjusted to correctly match the target price, factoring in the exemption status and the local tax rate.

When you sell a product for a price of $100, tax is calculated on the amount and added to the total sale price. The local tax rate in Irvine, California totals 7.75% for our test company, so with tax you’ll pay $107.75; and the store selling you the product will remit $7.750 to the tax authority on their next sales tax filing. The end result is that you get your product, the store gets $100, and the tax authority gets $7.75.

Now, let’s introduce the TaxIncluded parameter. When you set TaxIncluded to true, AvaTax will perform slightly different math. Instead of calculating the tax on top of the purchase amount, the tax is calculated to ensure that the final amount equals $100 directly.

The end result is that you still calculate the correct tax rate, but the store knows the revenue amount when the sale is made, with no month-end finagling. The store keeps $92.81, and remits $7.19 of tax – which reflects the correct tax rate of 7.75%.


Reverse Tax Calculation

A new feature is added, to leverage the Tax Included feature, and perform a “reverse calculation” in SAP B1.

This means the sales document is created with line items already including the sales tax in the line total. The use case is to provide the ability to calculate taxes with that price, and set back the tax result (as usual), but also set the unit price before taxes in the SAP document, achieving the desired result, that is having the SAP document matching the original total, but after reversing the unit price to the price before taxes.

For this, a new UDF is added to the Marketing Documents, Tax Reverse Calculation (U_ARGNS_REVCALC), that is a Yes/No UDF, to indicate if the reverse logic must be applied for the tax calculation on the document.

Another UDF Unit Price with Taxes (U_ARGNS_ATXUPWT) is added to the marketing documents rows level. For each line in the document, the original unit price with taxes for the item must be completed in this UDF. This value will not be changed by the Avatax solution during the calculation, it will be used as the source unit price for the request as detailed below.

Having this Unit Price with Taxes will permit tax recalculating, partial lines closing and document updates without losing the original unit price value (because the SAP native unit price will be updated by the solution).

The reverse calculation will only be executed when:

  • Tax Included UDF (U_ARGNS_TAXINCL) is set to Yes.
  • Tax Reverse Calculation UDF (U_ARGNS_REVCALC) is set to Yes.

The behavior will be:

  • Send the tax calculation request using:
    • TaxIncluded set to true.
    • Line quantity read from the native SAP quantity field.
    • Line total will be calculated, using the Unit Price with Taxes (U_ARGNS_ATXUPWT) UDF field at line level.
      • Line total in the request will be Unit Price with Taxes * Quantity.
  • Receive the tax calculation response from Avatax and:
    • Set the document line Avatax UDFs as usual (tax calculated rate, tax calculated amount, tax code, vat code, invoice message).
    • Update the SAP native Unit Price, setting the avatax response lineAmount value returned for that line divide by the line quantity.
      • This is doing TaxResponse.Line.LineAmount / TaxResponse.Line.Quantity and setting the result to the unit price.
    • Update the SAP native LineTotal value with the TaxResponse.Line.LineAmount, that is the line total amount.

By doing this, the line total will always match the original expected value, by breaking the original unit price with taxes in the net + tax amounts.

Reconcile documents with custom DocumentCode

By default, the document code used to post documents to Avatax is the SAP Document Number.

When using the reconcile documents, now there is an option to use the Customer Reference Number from the marketing document in SAP as the Document Code in avatax.

Use this option before loading the documents in the Reconcile module: