TaxCalculator

Tax Calculator

Major Business Rule

Object Name: B4001090

Parent DLL: COPBASE

Location: Client/Server

Language: C

Functional Description

Purpose

This function provides a "one-step" method of retrieving tax details.  It simply calls two existing 

business functions "Calculate and Validate Tax Amounts" (X00TAX) and "Calculate Tax Authority Tax 

Amounts" (B0000019), and returns the tax and discount details.


Note:1.  The Payment Terms Code and Discount Percentage parameters are mutually exclusive.  If both 
are passed, only the Payment Terms Code will be applied.


2.  The Goods Value parameter is the "gross amount" as opposed to the Amount Taxable parameter 

which is net.  If one is passed, the other will be calculated and returned.  If both are passed, tax 

is calculated on the Amount Taxable (as normal) and Gross Amount is ignored.


3.  The Item Number Used Flag indicates whether the tax information was retrieved at item 

level.  It will contain '1' or '0', where '1' indicates item-level taxes.



Technical Specification




2.4Processing 


If any errors occur during this business function, return a 'Y' in the error code parameter ERRC.




2.4.1Call CalculateValidateTaxAmounts (X00TAX):


Pass to this business function the following input parameters:


AG(Amount Gross)        - NOT Goods Value as below

ATXA(Amount Taxable)

TXA1(Tax Area1)

EXR1(Tax Explanation Code1)

TRDJ(Order Date)

PTC(Payment Terms)

DCP(Discount Percentage)

CO(Company)

EV01(System Code)

ITM(IdentifierShortItem)

PQOR(Quantity Supplied)

/*AG(Goods Value)*/


and receive:


AG(Amount Gross)

ATXA(Amount Taxable)

STAM(Amount of Tax)

ADSC(Amount of Discount)

ATXN(Amount Tax Exempt)

UPRC(Unrounded Tax Amount)

EV02(Summary/Detail Flag)

EV03(Item Number Used Flag)



2.4.2Call CalcTaxAuthTaxAmts (B0000019):


Pass to this business function the following input parameters:


TXA1(Tax Area1)

TRDJ(Order Date)

ITM(IdentifierShortItem)

EXR1(Tax Explanation Code1)

ATXA(Amount Taxable)

STAM(Amount of Tax) - output from X00TAX.


and receive:


TXR1(Tax Rate 1)

TXR2(Tax Rate 2)

TXR3(Tax Rate 3)

TXR4(Tax Rate 4)

TXR5(Tax Rate 5)

TA1(Tax Authority 1)

 TA2(Tax Authority 2)

 TA3(Tax Authority 3)

 TA4(Tax Authority 4)

 TA5(Tax Authority 5)

STA1(Tax Authority Amount 1)

STA2(Tax Authority Amount 2)

STA3(Tax Authority Amount 3)

STA4(Tax Authority Amount 4)

STA5(Tax Authority Amount 5)

TC2(Tax Calc Method 2 - Tax Compound flag)

TT3(Tax Type 3 - VAT Recoverable flag 3)

TT4(Tax Type 4 - VAT Recoverable flag 4)

TT5(Tax Type 5 - VAT Recoverable flag 5)

TAXA(Tax Area Description)

FVTY(Factor Value Type)

GL01     (GL Class/Tax Area 1)10/9/95

GL02(GL Class/Tax Area 2)10/9/95

GL03(GL Class/Tax Area 3)10/9/95

GL04 (GL Class/Tax Area 4)10/9/95

GL05(GL Class/Tax Area 5)10/9/95

MATH10(Non recoverable GST amount) 10/10/95


2.4.3Calculate the Total Tax Rate:


Calculate the Total Tax Rate as follows:


Note:  Tax Explanation Code (EXR1) is a 2-byte field.



If the 1st byte of EXR1 is "C" or "B" or EXR1 = "V+"


If EXR1 = "V+"
  Compound Tax Flag (TC2) = 'Y'

end


'Total Tax Rate' (TRAT) = TXR1 + TXR2 + TXR3 (if TT3 is not 'R') + TXR4 (if TT4 is not 'R') + TXR5 

(If TT5 is not 'R')


If Compound Tax Flag (TC2) = 'Y'

Add to TRAT the sum of TXR2-5 (excluding TXR3, 4 or 5 if the corresponding TT3, 4 or 5) = 'R') 
as a percentage of TXR1.

end

else


Compound Tax Flag (TC2) = '  ' (blanks)
Total Tax Rate (TRAT) = TXR1 + TXR2 + TXR3 + TXR4 + TXR5


end



For example:


assume the five tax rates (TXR1-5) returned from B0000019 are 3.5, 3.8, 2.1, 1.1and 0.4, and the Tax 

Type field TT4 is 'R'.



EXR1    TC2 (passed back   TC2 (after above   Total Area

         from B0000019)     algorithm)        Tax Rate


S       blank              blank          = 10.9  (3.5 + 3.8 

+ 2.1 + 1.1 + 0.4)


CA      blank              blank          = 9.8 (3.5 + 3.8 + 

2.1 + 0.4)


S       Y                  blank          = 10.9 (3.5 + 3.8 

+ 2.1 + 1.1 + 0.4)


CX      Y                  Y              = 10.021  ((3.5 + 

3.8 + 2.1 + 0.4) +

      ((3.8 + 2.1 + 0.4) 

/ 100 * 3.5)


V+      blank              Y              = 10.021 (same as 

above)


V+      Y                  Y              = 10.021 (same as 

above)


Data Structure

D4001090 - Tax Calculator

Parameter NameData ItemData TypeReq/OptI/O/Both
szTaxArea1TXA1charNONENONE

A code that identifies a tax or geographic area that has common tax rates and tax authorities. The system validates the code you enter 
against the Tax Areas table (F4008). The system uses the tax rate area in conjunction with the tax explanation code and tax rules to calculate tax 
and G/L distribution amounts when you create an invoice or voucher.

szTaxExplanationCode1EXR1charNONENONE

A hard-coded user defined code (00/EX) that controls the algorithm that the system uses to calculate tax and G/L distribution amounts. The 
system uses the tax explanation code in conjunction with the tax rate area and tax rules to determine how the tax is calculated. Each 
transaction pay item can be defined with a different tax explanation code.

jdTransactionDateTRDJJDEDATENONENONE

The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.

szPaymentTermsCode1PTCcharNONENONE

A code that specifies the terms of payment, including the percentage of discount available if the invoice is paid by the discount due date. 
Use a blank code to indicate the most frequently-used payment term. You define each type of payment term on the Payment Terms Revisions 
form. Examples of payment terms include: Blank Net 15 001      1/10 net 30 002      2/10 net 30 003      Due on the 10th day of every month 006     
Due upon receipt  This code prints on customer invoices.

szCompanyCOcharNONENONE

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

mnShortItemNumberITMMATH_NUMERICNONENONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

mnUnitsPrimaryQtyOrderPQORMATH_NUMERICNONENONE

The quantity ordered by the customer expressed in the primary stocking unit of measure.

mnAmountTaxableATXAMATH_NUMERICNONENONE

The amount on which taxes are assessed.

mnAmtTax2STAMMATH_NUMERICNONENONE

The amount assessed and payable to tax authorities. It is the total of the VAT, use, and sales taxes (PST).

mnAmtDiscountAvailableADSCMATH_NUMERICNONENONE

The amount of the invoice or voucher pay item that is eligible to be subtracted from the gross amount when the transaction is paid. The 
system calculates discount amounts based on the payment term entered on the transaction.  Note: If the system calculates the discount, verify 
that it applies to the pay item specified. Usually, freight, sales tax, and labor charges that are included in the gross amount do not qualify for 
discounts.

mnTaxRate1TXR1MATH_NUMERICNONENONE

A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.  
Enter the percentage as a whole number and not as the decimal equivalent. For example, to specify 7 percent, enter 7, not .07. 

mnTaxRate2TXR2MATH_NUMERICNONENONE

A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.  
Enter the percentage as a whole number and not as the decimal equivalent. For example, to specify 7 percent, enter 7, not .07. 

mnTaxRate3TXR3MATH_NUMERICNONENONE

A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.  
Enter the percentage as a whole number and not as the decimal equivalent. For example, to specify 7 percent, enter 7, not .07. 

mnTaxRate4TXR4MATH_NUMERICNONENONE

A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.  
Enter the percentage as a whole number and not as the decimal equivalent. For example, to specify 7 percent, enter 7, not .07. 

mnTaxRate5TXR5MATH_NUMERICNONENONE

A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.  
Enter the percentage as a whole number and not as the decimal equivalent. For example, to specify 7 percent, enter 7, not .07.

mnTaxAuthority1ATA1MATH_NUMERICNONENONE

The address book number of the tax agency that has jurisdiction in the tax area. You pay and report sales, use, or VAT taxes to this 
agency. Examples include states, counties, cities, transportation districts, provinces, and so on. You can specify up to five tax authorities for a single 
tax area.

mnTaxAuthority2TA2MATH_NUMERICNONENONE

The address book number of the tax agency that has jurisdiction in the tax area. You pay and report sales, use, or VAT taxes to this 
agency. Examples include states, counties, cities, transportation districts, provinces, and so on. You can specify up to five tax authorities for a single 
tax area.

mnTaxAuthority3TA3MATH_NUMERICNONENONE

The address book number of the tax agency that has jurisdiction in the tax area. This is the agency to whom you pay and report sales, use, 
or VAT taxes. Examples include states, counties, cities, transportation districts, provinces, and so on. You can specify up to five tax 
authorities for a single tax area.

mnTaxAuthority4TA4MATH_NUMERICNONENONE

The address book number of the tax agency that has jurisdiction in the tax area. You pay and report sales, use, or VAT taxes to this 
agency. Examples include states, counties, cities, transportation districts, provinces, and so on. You can specify up to five tax authorities for a single 
tax area.

mnTaxAuthority5TA5MATH_NUMERICNONENONE

The address book number of the tax agency that has jurisdiction in the tax area. You pay and report sales, use, or VAT taxes to this 
agency. Examples include states, counties, cities, transportation districts, provinces, and so on. You can specify up to five tax authorities for a single 
tax area.

mnAmtSalesTaxTaxAuth1STA1MATH_NUMERICNONENONE

Of the total taxes calculated for this document (invoice, voucher, etc.), the dollar value of the tax liability attributable to the first of five 
possible taxing authorities who may comprise the tax area.

mnAmtSalesTaxTaxAuth2STA2MATH_NUMERICNONENONE

Of the total taxes calculated for this document (invoice, voucher, etc.), the dollar value of the tax liability attributable to the second of five 
possible taxing authorities who may comprise the tax area.

mnAmtSalesTaxTaxAuth3STA3MATH_NUMERICNONENONE

Of the total taxes calculated for this document (invoice, voucher, etc.), the dollar value of the tax liability attributable to the third of five 
possible taxing authorities who may comprise the tax area.

mnAmtSaleStaxTaxAuth4STA4MATH_NUMERICNONENONE

Of the total taxes calculated for this document (invoice, voucher, etc.), the dollar value of the tax liability attributable to the fourth of five 
possible taxing authorities who may comprise the tax area.

mnAmtSalesTaxTaxAuth5STA5MATH_NUMERICNONENONE

Of the total taxes calculated for this document (invoice, voucher, etc.), the dollar value of the tax liability attributable to the fifth of five possible 
taxing authorities who may comprise the tax area.

cTaxCalcMethod2TC2charNONENONE

An option that is used in Canada to specify whether to calculate PST tax after GST has been added to the product value. Valid settings 
are: On The system calculates PST tax after GST has been added to the product value. Off The system calculates the PST before GST has been 
added to the product value.  For example, suppose that you have a tax area set up with 7% GST and 8% PST, and you turn on the option to 
calculate tax on tax. If you enter a voucher for a taxable amount of 1000 CAD, the system calculates the GST as 70 CAD, adds it to the taxable 
amount, and multiplies the PST by that result (1070 CAD). If you do not use compound taxes, the system calculates PST on the taxable 
amount only. Note: This option is valid only for tax explanation codes that begin with the letters B and C. To calculate compound taxes for tax 
explanation code V, use tax explanation code V+.

cTaxType3TT3charNONENONE

An option that indicates the percent of VAT that is not recoverable. You enter the nonrecoverable percentage in the Tax Rate field to the left 
of this option. Valid settings are: On Not recoverable. The system multiplies the percentage that you specify by the total tax amount and 
reduces the amount of VAT that is recoverable from the first tax authority. Off Recoverable. All of the VAT tax is recoverable. Note: This option is 
valid only with tax explanation codes that begin with the letters C, B, and V.

cTaxType4TT4charNONENONE

An option that indicates the percent of VAT that is not recoverable. You enter the nonrecoverable percentage in the Tax Rate field to the left 
of this option. Valid settings are: On Not recoverable. The system multiplies the percentage that you specify by the total tax amount and 
reduces the amount of VAT that is recoverable from the first tax authority. Off Recoverable. All of the VAT tax is recoverable. Note: This option is 
valid only with tax explanation codes that begin with the letters C, B, and V.

cTaxType5TT5charNONENONE

An option that indicates the percent of VAT that is not recoverable. You enter the nonrecoverable percentage in the Tax Rate field to the left 
of this option. Valid settings are: On Not recoverable. The system multiplies the percentage that you specify by the total tax amount and 
reduces the amount of VAT that is recoverable from the first tax authority. Off Recoverable. All of the VAT tax is recoverable. Note: This option is 
valid only with tax explanation codes that begin with the letters C, B, and V.

szDescriptionTaxAreaTAXAcharNONENONE

Text that names or describes the tax rate/area.  You can use this 30-character field, for example, to identify a zip code for a tax area or to 
partially describe the geographic area.

mnTotalAreaTaxRateTRATMATH_NUMERICNONENONE

A number that indicates the total percentage of taxes for the transaction or tax rate area.

cFactorValueTypeFVTYcharNONENONE

A code that indicates whether the factor value is a multiplier (%) or an additional/deductible cash amount ($) when applied to an order's 
price.

cErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

mnDiscountPercentageDCPMATH_NUMERICNONENONE

The percent of the total invoice or voucher that you will discount if it is paid within the discount period. You enter the discount percent as a 
decimal, for example, a 2 percent discount is .02.

cSystemCodeEV01charNONENONE

An option that specifies the type of processing for an event.

mnGoodsValueAGMATH_NUMERICNONENONE

A value that specifies the total amount of the invoice or voucher pay item. The gross amount might include the tax amount, depending on 
the tax explanation code. The system does not decrease the gross amount when payments are applied. When you void a transaction, the 
system clears the gross amount field.

mnAmountTaxExemptATXNMATH_NUMERICNONENONE

The amount upon which taxes are not assessed. This is the portion of the transaction not subject to sales, use, or VAT taxes because the 
products are tax-exempt or zero-rated.

mnUnroundedTaxAmtUPRCMATH_NUMERICNONENONE

The list or base price to be charged for one unit of this item. In sales order entry, all prices must be set up in the Item Base Price File table 
(F4106).

szGLClassByTaxArea1GL01charNONENONE

A code that indicates how to locate the tax account for general ledger entries. This field points to automatic accounting instructions (AAIs) 
that, in turn, point to the tax account. Examples are:        PTyyyy - for A/P (VAT only)        RTyyyy - for A/R (VAT only)        GTyyyy - for G/L (VAT 
only)        4320 - for Sales Orders        4400 and 4410 - for Purchase Orders  When setting up VAT and Canadian GST, PTyyyy, RTyyyy, and 
GTyyyy are the only valid values. For the A/P system, a second G/L Offset (PT_ _ _ _) is required when your tax setup involves VAT plus use 
taxes (tax explanation code B). Use AAI PT_ _ _ _ to designate the use tax portion of the setup. For sales taxes, the Accounts Payable and 
Accounts Receivable systems ignore the values in this field. However, the Sales Order Management and Procurement systems require values in 
this field.

szGLClassByTaxArea2GL02charNONENONE

Code that indicates how to locate the tax account for general ledger entries. This field points to automatic accounting instructions (AAIs) that, 
in turn, point to the tax account. Examples are:   PTxxxx       for A/P (VAT only)   RTxxxx      for A/R (VAT only)   GTxxxx      for G/L (VAT only)   
SOTxxx      for Sales Orders    OPTxxx and OPAxxx      for Purchase Orders  For VAT and Canadian GST, only PTxxxx, RTxxxx, and GTxxxx are valid. 
For sales taxes, the A/P and A/R systems ignore the values in this field. For sales taxes, the Sales Order and Purchaser Order systems 
require values in this field. For the General Accounting system, VAT journal entries require values in this field. At this time, however, the system 
only uses the first G/L offset.

szGLClassByTaxArea3GL03charNONENONE

Code that indicates how to locate the tax account for general ledger entries. This field points to automatic accounting instructions (AAIs) that, 
in turn, point to the tax account. Examples are:   PTxxxx       for A/P (VAT only)   RTxxxx        for A/R (VAT only)   GTxxxx       for G/L (VAT only)   
SOTxxx       for Sales Orders    OPTxxx and OPAxxx       for Purchase Orders  For VAT and Canadian GST, only PTxxxx, RTxxxx, and GTxxxx are 
valid. For sales taxes, the A/P and A/R systems ignore the values in this field. For sales taxes, the Sales Order and Purchaser Order systems 
require values in this field. For the General Accounting system, VAT journal entries require values in this field. At this time, however, the system 
only uses the first G/L offset.

szGLClassByTaxArea4GL04charNONENONE

Code that indicates how to locate the tax account for general ledger entries. This field points to automatic accounting instructions (AAIs) that, 
in turn, point to the tax account. Examples are:   PTxxxx     for A/P (VAT only)   RTxxxx     for A/R (VAT only)   GTxxxx     for G/L (VAT only)   SOTxxx   
  for Sales Orders    OPTxxx and OPAxxx     for Purchase Orders  For VAT and Canadian GST, only PTxxxx, RTxxxx, and GTxxxx are valid. 
For sales taxes, the A/P and A/R systems ignore the values in this field. For sales taxes, the Sales Order and Purchaser Order systems require 
values in this field. For the General Accounting system, VAT journal entries require values in this field. At this time, however, the system only 
uses the first G/L offset.

szGLClassByTaxArea5GL05charNONENONE

Code that indicates how to locate the tax account for general ledger entries. This field points to automatic accounting instructions (AAIs) that, 
in turn, point to the tax account. Examples are:   PTxxxx     for A/P (VAT only)   RTxxxx     for A/R (VAT only)   GTxxxx     for G/L (VAT only)   SOTxxx   
  for Sales Orders    OPTxxx and OPAxxx     for Purchase Orders  For VAT and Canadian GST, only PTxxxx, RTxxxx, and GTxxxx are valid. 
For sales taxes, the A/P and A/R systems ignore the values in this field. For sales taxes, the Sales Order and Purchaser Order systems require 
values in this field. For the General Accounting system, VAT journal entries require values in this field. At this time, however, the system only 
uses the first G/L offset.

mnNonRecoverGSTMATH10MATH_NUMERICNONENONE

Event point for Math Numeric.

cSummaryDetailFlagEV02charNONENONE

An option that specifies the type of processing for an event.

cItemNumberUsedFlagEV03charNONENONE

A radio button that specifies the level at which trace/track result is to be displayed.  Select the Detail to display all transactions except IB, IX, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

mnPSTTaxAmtECSTMATH_NUMERICNONENONE

For accounts receivable and accounts payable, the invoice (gross) amount. For sales orders and purchase orders, the unit cost times the 
number of units.

mnJobnumberAJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

cIsVertexActiveVVTXcharOPTNONE

This flag determines whether to use the Vertex Tax Compliance system for tax calculations.  Values are: Y  Use Vertex system to calculate 
taxes.  N Do not use Vertex system to calculate taxes.  Instead, use JDE tax calculations. 

szAuthority1DescDL01charOPTNONE

A user defined name or remark.

szAuthority3DescDL01charOPTNONE

A user defined name or remark.

szAuthority2DescDL01charOPTNONE

A user defined name or remark.

szAuthority5DescDL01charOPTNONE

A user defined name or remark.

szAuthority4DescDL01charOPTNONE

A user defined name or remark.

mnDocumentOrderInvoiceEDOCOMATH_NUMERICOPTNONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

szOrderTypeDCTOcharOPTNONE

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

szCompanyKeyOrderNoKCOOcharOPTNONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

szOrderSuffixSFXOcharOPTNONE

In the A/R and A/P systems, a code that corresponds to the pay item. In the Sales Order and Procurement systems, this code identifies 
multiple transactions for an original order. For purchase orders, the code is always 000. For sales orders with multiple partial receipts against an 
order, the first receiver used to record receipt has a suffix of 000, the next has a suffix of 001, the next 002, and so on.

mnLineNumberLNIDMATH_NUMERICOPTNONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

cSuppressDiscountCalculationEV01charOPTINPUT

An option that specifies the type of processing for an event.

mnNonRecoverableTaxAmtNRTAMATH_NUMERICOPTNONE

The portion of the tax amount for which you cannot take a credit.

mnAmountDistributeAGMATH_NUMERICOPTNONE

A value that specifies the total amount of the invoice or voucher pay item. The gross amount might include the tax amount, depending on 
the tax explanation code. The system does not decrease the gross amount when payments are applied. When you void a transaction, the 
system clears the gross amount field.

Related Functions

B0000019 Calculate Tax Authority Tax Amts
X00TAX Calculate and Edit Tax Amounts

Related Tables

None