Example of How Pricing Algorithms Price Items, Part 7

Learn how pricing algorithms calculate tax.

7. Calculate Tax

Here are some ways you can set up tax pricing to meet your specific needs.

  • Help make your Order Entry Specialist happy. Use an extensible flexfield and write an order management extension that copies the value from the Exemption Certificate Number attribute on the order header to the order line each time the user adds a line. Use this value as the default on the line. This way, the Order Entry Specialist doesn't have to manually enter the value on every order line.

  • The tax API uses the product fiscal classification when it calculates tax. Create an interface between the Product Fiscal Classification attribute for the item in Product Information Management and the tax API.

  • Set up a pricing algorithm to create an interface between the Order Date attribute on the sales order and the TransactionDate attribute in the tax API.

  • Use the segment of an extensible flexfield to help calculate the assessable value of more than one charge.

For this example, reprice the sales order in the Order Management work area and see what happens.

reprice the sales order in the Order Management work area and see what happens

Note

  • Click Actions > Reprice Order.

  • Click the amount.

  • Notice the breakdown now includes a line for Exclusive tax and adds the tax to the net price. This tax doesn't affect margin because its exclusive to calculating margin for the item.

Here are the SDOs.

reprice the sales order in the Order Management work area

Note

  • The output SDO from the Get the Invoice Price step provides the input SDO.

  • The CalculateTaxFlag attribute on the header contains Y. This step calculates tax only if CalculateTaxFlag contains Y. For example, if the Quantity attribute on the order line in Order Management contains 0, then Order Management sets CalculateTaxFlag to N, and pricing skips this step.

  • The algorithm uses the charge and charge components on the order line in the input SDO to calculate tax.

  • Charge components on the input SDO include the net price and list price.

  • The TaxLineDetail entity on the output SDO stores tax details for the sales order.

  • The three large dots indicate more potential ChargeComponents. The diagram doesn't include them because they're not relevant to this discussion.

  • The algorithm uses your set ups in the Pricing Administration work area.

Here's what the algorithm does.

What the Algorithm Does

How the Algorithm Does It

1.Populate tax header.

Use header attributes from the sales order to populate header attributes on the tax.

2. Populate tax lines from charges.

Use values from each charge and each order line to populate values for each tax line.

3. Call the Calculate Tax API.

Call the tax API in Oracle Applications.

If Oracle Applications uses a third party tax API, then pricing can use it.

4. Handle tax calculation errors.

Handle any errors that the tax API in Oracle Applications returns to the algorithm.

5. Add the charge component for inclusive tax.

The tax API in Oracle Applications calculates the tax line detail for each tax. For example, it calculates city tax, county tax, state tax, federal tax, and so on.

The tax amount includes a boolean attribute on the tax line detail that specifies whether the tax is inclusive.

For each charge, the API adds up the tax amounts for the inclusive tax, creates a charge component for them, then stores these tax values in one component charge for the inclusive tax. It stores the tax as the unit price for the total of the tax amounts.

The API stores the value in one charge component. It stores the net price excluding the exclusive tax. Its the net price minus the total inclusive tax.

6. Add the charge component for exclusive tax.

The tax API uses the same logic that it uses to calculate and store exclusive tax, except it stores the net price plus the total exclusive tax.

The tax API might store inclusive and exclusive tax for each charge, depending on how you set up the API.

In this example, the sales order has only exclusive tax.

Here are details about attributes in the SDOs.

Entity

Attributes in Input SDO

Attributes in Output SDO

ChargeComponent for exclusive tax

(parent of TaxLineDetail)

-

ChargeComponentId: 10
ChargeId: 1
CurrencyCode: USD
ExtendedAmount: 120.0 USD
PriceElementCode: QP_EXCLUSIVE_TAX
PriceElementUsageCode: EXCLUSIVE_TAX
RollupFlag: N
SequenceNumber: 1009
SkipRunningPrice: Y
TaxIncludedFlag: N
UnitPrice: 60.0 USD

There's only one exclusive tax, so the output SDO includes only one ChargeComponent for exclusive tax.

Unit Price is the tax amount.

TaxLineDetail

-

ChargeComponentId: 10
CurrencyCode: USD
HeaderCurrencyCode: USD
TaxAmount: 60USD
TaxAmountInclusiveFlag: N
TaxJurisdictionCode: FUS_STCC JURIS_UES
TaxJurisdictionName: FUS_STCC JURIS_UES
TaxLineDetailId: 1
TaxRate: 20
TaxRateCode: VAT20
TaxRateId: 300100148455853
TaxRateName: VAT20
TaxRegimeCode: FUS_STCC_REGIME_UES
TaxRegimeName: FUS_STCC_REGIME_UES
TaxStatusCode: FUS_STCC_TAX_STD-UES
TaxableAmount: 300 USD

ChargeComponent for net price plus tax

(below TaxLineDetail)

-

ChargeComponentId: 11
ChargeId: 1
CurrencyCode: USD
ExtendedAmount: 720.00 USD
PriceElementCode: QP_NET_PRICE_PLUS_TAX
PriceElementUsageCode: NET_PRICE_PLUS_TAX
PriceValidFrom: 2019-05-29 @ 06:35:10
RollupFlag: N
SequenceNumber: 1010
SkipRunningPrice: Y
TaxIncludedFlag: N
UnitPrice: 360.00 USD

Unit Price contains the net price of 300 plus tax of 60.

Extended Amount is quantity 2 multiplied by Unit Price 360 equals 720.00.

Note

  • If the sales order includes exclusive tax, then the algorithm creates one charge component for the exclusive tax and another one for net price plus tax.

  • If the sales order includes inclusive and exclusive tax, then the algorithm creates one charge component for the exclusive tax, another one for the inclusive tax, and another one for net price plus tax.

Here are some of the functions you can use with the Compute Sales Taxes algorithm. All functions are view object lookups, except for createChargeComponent and getPartialPeriodDuration, which are scripts.

Function Name

Description

createChargeComponent

Script that creates components for the tax charge.

getChargeDefinition

Get the charge definition.

getCurrencyRelatedAttributes

Get the currency attributes.

getLedgerId

Get the value that uniquely identifies the ledger.

getOKCUomMappings

Query the time unit mappings to get details from the contracts okc_ tables.

getPartialPeriodDuration

Script that calls the contracts API to get the duration for part of the time frame when the tax applies.