AccumulateGetTaxSummaryInfo

Accumulate Get Tax Summary Info

Major Business Rule

Object Name: B4200220

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

This function has two distict phases:  Accumulate and Retrieve, given the passed parameter 

cStoreGetOrInitialize (modes) 1 = Accumulate and Store Mode, 2 = Retrieve Info Mode, 3 = Initialize Mode. 

 In Accumulate mode, this function accumulates and store tax information for a given Sales Order 

Detail Line in an Array and Linklist for the Group and the AreaCode/Tax Authority.  If the parameter 

cStoreTaxAreaExplCode is Y, then it will also accumulate and store tax info for TaxArea / Explanation.

In Retrieve mode, the parameter cSummaryDisplayMode will need to be passed to indicate how to 

display.  1 = Group, 2 = Area Code, 3 = Tax Authority, 4 = Tax Area/Explanatio


Setup Notes and Prerequisites


Special Logic




Technical Specification

The following validation should be performed on the input parameters.  If there are any errors, 

return a 'Y' in the error code ERRC.  


• MODE can be '1', '2' or '3'.
• When MODE is '1', TXA1, EXR1, TAX1, TAXA and FVTY should be non blank. 
• When MODE is '2', PDSP must be '1', '2', '3' or '4' and CNTF must not be less than 0.
• 'b7'b7'b7'b7


When MODE is 3 (Initialise Array/Linked List):


Mode 3 will be used to initialise (clear) the array or Linked List and should be the first and last 

call made to this function.  No parameters (other than Mode) will be needed.




When MODE is 1 (Accumulate and Store Tax Information):


There will be two or three arrays created.  The first will contain the tax data summarized by Tax 

Group.  The second will contain the tax data summarized by Tax Area and Tax Authority.  The second array 

holds both Tax Area and Tax Authority data because the Tax Authority is a subset of the Tax Area.  The 

third array holds the tax data summarized by Tax Area / Explanation Code and is built only if the 

user has selected INCL = 'Y'.



Array 1 should have the following elements:


      DESC-Tax Area Description (or 'Y' or 'N')
TAXABLE-Taxable Amount
TAXAMT-Amount of Tax

TOTALTAXRATE-Total Tax Rate for Group

FOREIGNTAXABLE-Foreign Taxable Amount (future use)

FOREIGNTAXAMT-Foreign Tax Amount (future use)

FACTOR-Factor Type ('%', '$' or 'X')



Array 2 should have the following elements:


TYPE-Summary Type.  '2' = By Area, '3' = By Authority

DESC-Tax Area (Type '2') or Tax Authority (Type '3')

AREA-Tax Area

TAXABLE-Taxable Amount

TAXAMT-Amount of Tax

FOREIGNTAXABLE-Foreign Taxable Amount (future use)

FOREIGNTAXAMT-Foreign Tax Amount (future use)

TOTALTAXRATE-Total Tax Rate

FACTOR-Factor Type ('%' or '$')

ITEM-Short Item Number



Array 3 should have the following elements:


DESC-Tax Area

EXPLCODE-Tax Explanation Code

TAXABLE-Taxable Amount

TAXAMT-Amount of Tax

FOREIGNTAXABLE-Foreign Taxable Amount (future use)

FOREIGNTAXAMT-Foreign Tax Amount (future use)

TOTALTAXRATE-Total Tax Rate

FACTOR-Factor Type ('%' or '$')

ITEM-Short Item Number











• Build array #1:  Tax data summarized by Group.
• 'b7'b7'b7'b7
Set array index1 (1 to 8) depending on Sales Taxable (TAX1).  If 'Y', index1 = 1, if 'N', 
index1 = 2, if '3', index1 = 3, if '4', index1 = 4,......, if '8', index1 = 8.


If Tax Area (TXA1) is not blank

If index1 is 2
add Amount Field (AA) to array_element TAXABLE[index1]

else

add Amount Taxable (ATXA)  to array_element TAXABLE[index1] 

Store Total Area Tax Rate (TRAT) in array_element TOTALTAXRATE[index1]

Add Amount Tax (STAM) to array_element TAXAMT[index1]

If index1 is 1 or 2
store Sales Taxable (TAX1) in array_element DESC[index1]

else

store the Tax Area Description (TAXA) in array_element DESC[index1]

Store Factor Type (FVTY) in array_element FACTOR[index1].  This will be either '%' 
or '$'.



• Build array #2:  Tax data summarized by Area and Authority.
• 'b7'b7'b7'b7
If Tax Area (TXA1) is not blank, we need to determine if this record exists in array2.  It can 
exist as a Tax Area, or a Tax Area and Item combination:


Look for Tax Area (TXA1) in array2_element DESC (should be a TYPE-2 record).  Set 'Found' 

ON or OFF.


If 'Found' ON, check whether IndentifierShortItem (ITM) equals the Item in 

array_element ITEM (same index position).


If Items are not the same


If Control Flag (CTF2) is '1'

Look up ITM in array2_element ITEM (should be a TYPE-2 record).  
Reset 'Found' ON or OFF.  If 'Found' ON, double check that the Tax Area 

in array2_element AREA for the new index position equals Tax Area 

(TXA1).  If not set 'Found' OFF.

else
Look up zero item element for the Tax Area (TXA1) (should be a 
TYPE-2 record) in array2.  Reset 'Found' ON or OFF.


eg.        If Array2 contains:


   DESCITEMAREA

1.    CO    0CO

2.    DEN    3DEN



1.  Assume Tax Area (TXA1) from input parameters is 'NZL'.  The first search 

for 'NZL' would set FOUND to 'OFF' and processing would skip the rest of the  above 

code.

2.  Assume Tax Area (TXA1) and IdentifierShortItem (ITM) from input 

parameters is 'DEN' and 3.  'FOUND' would be set ON, and the items are the same, so skip rest 

of code.

3. Assume Tax Area (TXA1) and IdenifierShortItem (ITM) from input parameters 

is 'DEN' and 5.  'FOUND' would be set ON.  The items do not match.  Control Flag 

(CTF2) would be '1', so a look up should be performed on the array2_element ITEM 

searching for item 5.  In this case it would NOT be found, so 'FOUND' is set OFF.  If 

there was another array position containing 'DEN' and item 5, the first look up would 

find 'DEN', item 3 record.  The item look up would find item 5, and the double-check 

procedure would confirm that the array2_element AREA attached to item 5 is indeed 

equal to Tax Area (TXA1) from the input parameters ('DEN'), therefore 'Found' is ON.


At this point, we either accumulate the data to an existing index position (Found ON) or 
add data to a new index position (OFF), depending on whether the data from the input 

parameters already exists in array2 or not.


If 'Found' OFF (Tax data does not exist in array2)

Set index2 to the first array position where array2_element DESC is blank
Store the following Tax Area-level records (2).  The Tax Authority-level (3) 
records that are within the Tax Area will be added after the 2-level record  ie. on 

completion of the array2 build, it will contain 1 or more record type 2's, with each 

2-level followed by 1 or more record-type 3's.  eg.  Record Type 2 could be Tax Rate/Area 

'DEN' with Record Type's 3 being "Denver Tax" and "Colorado Tax" authorities.


Store '2' in array2_element TYPE[index2].  This is the 'Record Level' field.
Store Factor Type (FVTY) in array2_element FACTOR[index2].  This will be either '%' 

or '$'.

Add Amount Taxable (ATXA) to array2_element TAXABLE[index2]

Store Total Area Tax Rate (TRAT) to array2_element TOTALTAXRATE[index2]

If Control Flag (CTF2) is '1'

store IdentifierShortItem (ITM) to array2_element ITEM[index2].

Add Amount of Tax (STAM) to array2_element TAXAMT[index2]

Store Tax Area (TXA1) to array2_element DESC[index2].  This element is the Tax Area 

or Description.  It contains the Tax Area for Area-level records (2) and the Tax 

Authority for Authority-level records (3).

Also store Tax Area (TXA1) to array2_element AREA[index2].  This element stores the 

Tax Area only.


Store the following Tax Authority-level records (3):


We need to calculate the Taxable Amount and Tax Amount for each Tax Authority.  
Perform the following for each Tax Rate (TXR1-5), incrementing index2 by 1 before each 

perform.  Do not perform if the Tax Rate is 0, and do not perform for Tax Rates 3, 4 

or 5 (TXR3-5) if the corresponding Tax Type (TT3-5) is 'R'.


Store '3' in array2_element TYPE[index2]

Store Tax Rate x (TXRx) to array2_element TOTALTAXRATE[index2]

Store Tax Area (TXA1) to array2_element AREA[index2].  This element stores 

the Tax Area only.

If Control Flag (CTF2) is '1'

 store IdentifierShortItem (ITM) to array2_element ITEM[index2].

Store Tax Authority x (TAx) to array2_element DESC[index2].


If array2_element TOTALTAXRATE[index2] is not 0

'Tax Amount Work Field' = array2_element TOTALTAXRATE[index2] / 100 * 
Amount Taxable (ATXA)

If Tax Calc Method 2 (TC2) is 'Y' and this calc is not over Tax Rate 1 
(TXR1) 

'Tax Amount Work Field' = 'Tax Amount Work Field' * (1+Tax Rate 1 
(TXR1)  / 100)

If Amount of Tax (STAM) is not 0
array2_element TAXAMT[index2] = array2_element TAXAMT[index2] + 
'Tax Amount Work Field'.

If Tax Calc Method 2 (TC2) is 'Y' and this calc is not over Tax Rate 1 
(TXR1)

array2_element TAXABLE[index2] = array2_element TAXABLE[index2 - 
1] +array2_element TAXAMT[index2 - 1]

else
array2_element TAXABLE[index2] = array2_element TAXABLE[index2 - 
1].



If 'Found' ON (existing array2 position)
Update the Record-type 2 record (Tax Area level) as follows:


Add Amount Taxable (ATXA) to array2_element TAXABLE[index2]
Add Amount of Tax (STAM) to array2_element TAXAMT[index2]


Now we need to update the Record-type 3 records (Tax Authority level) that occur 
after the Record-type 2 as follows:


For each Tax Rate (TXR 1-5) perform the following, remembering to increment 
index2 by 1 for each perform.  Again, only perform if the Tax Rate in question 

is not 0, and do not perform it for Tax Rates 3, 4 or 5 (TXR3-5) if the 

corresponding Tax Type (TT3-5) is 'R'.


Calculation:  (same as above)


If array2_element TOTALTAXRATE[index2] is not 0

'Tax Amount Work Field' = array2_element TOTALTAXRATE[index2] / 100 * 
Amount Taxable  (ATXA)

If Tax Calc Method 2 (TC2) and this calc is not over Tax Rate 1 (TXR1) 

'Tax Amount Work Field' = 'Tax Amount Work Field' * (1+Tax Rate 1 
(TXR1)  / 100)

If Amount of Tax (STAM) is not 0
array2_element TAXAMT[index2] = array2_element TAXAMT[index2] + 
'Tax Amount Work Field'.



If Tax Calc Method 2 (TC2) and this calc is not over Tax Rate 1 (TXR1)

array2_element TAXABLE[index2] = array2_element TAXABLE[index2 - 
1] + array2_element TAXAMT[index2 - 1]

else
array2_element TAXABLE[index2] = array2_element TAXABLE[index2 - 
1].




• Build array #3:  Tax data summarized by Area / Explanation Code.
• 'b7'b7'b7'b7
If the user has optionally selected to build this array (INCL = 'Y'), if Tax Area (TXA1) is not 
blank, we need to determine if this record exists in array3.  It can exist as a Tax Area & 

Explanation Code, or a Tax Area / Explanation Code and Item combination:


Look for Tax Area (TXA1) / Explanation Code (EXR1) in array3_element DESC / 

array3_element EXPLCODE.  Set 'Found' ON or OFF.


If 'Found' ON, check whether IndentifierShortItem (ITM) equals the Item in 

array_element ITEM (same index position).


If Items are not the same


If Control Flag (CTF2) is '1'

Look up ITM in array3_element ITEM.  Reset 'Found' ON or OFF.  If 
'Found' ON, double check that the Tax Area in array3_element AREA and 

Explanation Code in array3_element EXPLCODE  for the new index position 

equals Tax Area (TXA1).  If not set 'Found' OFF.

else

Data Structure

D4200220 - Accumulate Get Tax Summary Info

Special Input Expected
MODEModeProcessing1 = Accumulate & Store Mode

2 = Get Mode

3 = Initialize Mode

INCLIncludeYNY = Optionally build array #3 - Tax data summarized by Tax Area / Explanation Code.

TXA1TaxArea1Received when MODE is '1', passed back to calling program when MODE is '2' as contents of: array_element 

AREA[CNTF].

EXR1TaxExplanationCode1Similar to TXA1: array_element EXPLCODE[CNTF]

TAXADescriptionTaxAreaSimilar to TXA1: array_element DESC[CNTF]

ATXAAmountTaxableSimilar to TXA1: array_element  TAXABLE[CNTF]

STAMAmtTax2Similar to TXA1: array_element TAXAMT[CNTF]

CTXAForeignTaxableAmountSimilar to TXA1: array_element FOREIGNTAXABLE [CNTF] (future use).

CTAMForeignTaxAmountSimilar to TXA1: array_element FOREIGNTAXAMT [CNTF] (future use).

TRATTotalAreaTaxRateSimilar to TXA1: array_element TOTALTAXRATE[CNTF]

FVTYFactorValueTypeI/OSimilar to TXA1:  array_element FACTOR[CNTF]

TAX1Taxable(Y/N)Received when MODE is '1'.

ITMIdentifierShortItemReceived when MODE is '1'.

AAAmountFieldReceived when MODE is '1'.

TXR1TaxRate1Received when MODE is '1'.

TXR2TaxRate2Received when MODE is '1'.

TXR3TaxRate3Received when MODE is '1'.

TXR4TaxRate4Received when MODE is '1'.

TXR5TaxRate5Received when MODE is '1'.

TA1TaxAuthority1AReceived when MODE is '1'.

TA2TaxAuthority2Received when MODE is '1'.

TA3TaxAuthority3Received when MODE is '1'.

TA4TaxAuthority4Received when MODE is '1'.

TA5TaxAuthority5Received when MODE is '1'.

TC2TaxCalcMethod2Received when MODE is '1'.

TT3TaxType3Received when MODE is '1'.

TT4TaxType4Received when MODE is '1'.

TT5TaxType5Received when MODE is '1'.

CTF2ControlFlag2Received when MODE is '1'..  Will contain 0 or 1 and represents the 'Item Found' flag.

PDSPProfileDisplayModeOnly reqd when MODE = 2.  Will equal 1 - Get By Group, 2 - Get By Area Code, 3 - Get by Tax Authority or 4 - Get by 

Tax Area/Explanation Code.

CNTFCountFieldOnly reqd when MODE = 2.  This parameter requests the array element to be retrieved.  It should always be 0 for the 

first call, and incremented by 1 for each subsequent call. 


Special Output Returned

TXA1TaxArea1Received when MODE is '1', passed back to calling program when MODE is '2' as contents of: array_element 

AREA[CNTF].

EXR1TaxExplanationCode1Similar to TXA1: array_element EXPLCODE[CNTF]

TAXADescriptionTaxAreaSimilar to TXA1: array_element DESC[CNTF]

ATXAAmountTaxableSimilar to TXA1: array_element  TAXABLE[CNTF]

STAMAmtTax2Similar to TXA1: array_element TAXAMT[CNTF]

CTXAForeignTaxableAmountSimilar to TXA1: array_element FOREIGNTAXABLE [CNTF] (future use).

CTAMForeignTaxAmountSimilar to TXA1: array_element FOREIGNTAXAMT [CNTF] (future use).

TRATTotalAreaTaxRateSimilar to TXA1: array_element TOTALTAXRATE[CNTF]

FVTYFactorValueTypeI/OSimilar to TXA1:  array_element FACTOR[CNTF]

RCT1RecordType1Passed back to calling program when MODE = 2.  Contents of array_element TYPE[CNTF].  Will be either '2' or '3'.



^

Parameter NameData ItemData TypeReq/OptI/O/Both
cStoreGetOrInitializeMODEcharNONENONE


cStoreTaxAreaExplCodeINCLcharNONENONE

Enter 4 in this field to have the system include this component on the order. If you leave this field blank, the component will not be included 
on the order. If this field is protected, the component was not defined as an optional component or a feature through the Bill of Material 
Revisions screen,which you can access from menu A30.

szTaxAreaTXA1charNONENONE

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.

szTaxExplanationCodeEXR1charNONENONE

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.

szTaxAreaDescTAXAcharNONENONE

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.

mnTaxableAmountATXAMATH_NUMERICNONENONE

The amount on which taxes are assessed.

mnAmountOfTaxSTAMMATH_NUMERICNONENONE

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

mnForeignTaxableAmountCTXAMATH_NUMERICNONENONE

That portion of the sale that is subject to tax in foreign currency.

mnForeignTaxAmountCTAMMATH_NUMERICNONENONE

The tax amount in foreign currency.  This can be the sales, use, or VAT tax. 

mnTotalTaxRateByAreaTRATMATH_NUMERICNONENONE

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

cFactorTypeFVTYcharNONENONE

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

cTaxableYNTAX1charNONENONE

A code that indicates whether the item is subject to sales tax when you sell it. The system calculates tax on the item only if the customer is 
also taxable.

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

mnTaxableAmountNetAAMATH_NUMERICNONENONE

A number that identifies the amount that the system will add to the account balance of the associated account number.  Enter credits with a 
minus sign (-) either before or after the amount. 

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.

mnTaxAuthority1TA1MATH_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.

cTaxCalcMethodTC2charNONENONE

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.

cControlFlagCTF2charNONENONE

A marker that is used internally to determine whether a Not-To-Exceed limit has been set at any level in the contract.

cSummaryDisplayModePDSPcharNONENONE

The action that occurs when a user selects a certain type of data for entry:    1   Screen appears allowing entry of code, amount, dates, etc. In 
this case, multiple entries are allowed for the data type and free form text can be attached to each entry separately.    2   Same as 1 except 
only 1 entry is allowed for the data type.    3   Screen appears allowing entry of free form textual data.    4   A JDE or Custom program is called.

mnRecordTypeRCT1MATH_NUMERICNONENONE

Special Output Returned
RCT1ab  RecordType1ab  ab Passed back to calling program when MODE = 2.  Contents of array_element 

TYPE[CNTF].  Will be either '2' or  '3'.ab 


^

idPtrToGroupArrayGENLNGIDNONENONE

General purpose ID variable.

idPtrToAreaAndAuthorityGENLNGIDNONENONE

General purpose ID variable.

idPtrToAreaExplanationGENLNGIDNONENONE

General purpose ID variable.

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).

szErrorMsgIDDTAIcharNONENONE

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

cSuppressErrorMsgEV01charNONENONE

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

nCounterINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

mnForeignNonTaxableAmtAA1MATH_NUMERICNONENONE

A number that identifies the actual amount.

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. 

szAuthority1DescriptionDL01charOPTNONE

A user defined name or remark.

szAuthority2DescriptionDL01charOPTNONE

A user defined name or remark.

szAuthority3DescriptionDL01charOPTNONE

A user defined name or remark.

szAuthority4DescriptionDL01charOPTNONE

A user defined name or remark.

szAuthority5DescriptionDL01charOPTNONE

A user defined name or remark.

jdDateTaxDSVJJDEDATEOPTNONE

A date that indicates when you purchased goods or services, or when you incurred a tax liability. 

Related Functions

None

Related Tables

None
TOR-Factor Type ('%' or '$')

ITEM-Short Item Number











• Build array #1:  Tax data summarized by Group.
• 'b7'b7'b7'b7
Set array index1 (1 to 8) depending on Sales Taxable (TAX1).  If 'Y', index1 = 1, if 'N', 
index1 = 2, if '3', index1 = 3, if '4', index1 = 4,......, if '8', index1 = 8.


If Tax Area (TXA1) is not blank

If index1 is 2
add Amount Field (AA) to array_element TAXABLE[index1]

else

add Amount Taxable (ATXA)  to array_element TAXABLE[index1] 

Store Total Area Tax Rate (TRAT) in array_element TOTALTAXRATE[index1]

Add Amount Tax (STAM) to array_element TAXAMT[index1]

If index1 is 1 or 2
store Sales Taxable (TAX1) in array_element DESC[index1]

else

store the Tax Area Description (TAXA) in array_element DESC[index1]

Store Factor Type (FVTY) in array_element FACTOR[index1].  This will be either '%' 
or '$'.



• Build array #2:  Tax data summarized by Area and Authority.
• 'b7'b7'b7'b7
If Tax Area (TXA1) is not blank, we need to determine if this record exists in array2.  It can 
exist as a Tax Area, or a Tax Area and Item combination:


Look for Tax Area (TXA1) in array2_element DESC (should be a TYPE-2 record).  Set 'Found' 

ON or OFF.


If 'Found' ON, check whether IndentifierShortItem (ITM) equals the Item in 

array_element ITEM (same index position).


If Items are not the same


If Control Flag (CTF2) is '1'

Look up ITM in array2_element ITEM (should be a TYPE-2 record).  
Reset 'Found' ON or OFF.  If 'Found' ON, double check that the Tax Area 

in array2_element AREA for the new index position equals Tax Area 

(TXA1).  If not set 'Found' OFF.

else
Look up zero item element for the Tax Area (TXA1) (should be a 
TYPE-2 record) in array2.  Reset 'Found' ON or OFF.


eg.        If Array2 contains:


   DESCITEMAREA

1.    CO    0CO

2.    DEN    3DEN



1.  Assume Tax Area (TXA1) from input parameters is 'NZL'.  The first search 

for 'NZL' would set FOUND to 'OFF' and processing would skip the rest of the  above 

code.

2.  Assume Tax Area (TXA1) and IdentifierShortItem (ITM) from input 

parameters is 'DEN' and 3.  'FOUND' would be set ON, and the items are the same, so skip rest 

of code.

3. Assume Tax Area (TXA1) and IdenifierShortItem (ITM) from input parameters 

is 'DEN' and 5.  'FOUND' would be set ON.  The items do not match.  Control Flag 

(CTF2) would be '1', so a look up should be performed on the array2_element ITEM 

searching for item 5.  In this case it would NOT be found, so 'FOUND' is set OFF.  If 

there was another array position containing 'DEN' and item 5, the first look up would 

find 'DEN', item 3 record.  The item look up would find item 5, and the double-check 

procedure would confirm that the array2_element AREA attached to item 5 is indeed 

equal to Tax Area (TXA1) from the input parameters ('DEN'), therefore 'Found' is ON.


At this point, we either accumulate the data to an existing index position (Found ON) or 
add data to a new index position (OFF), depending on whether the data from the input 

parameters already exists in array2 or not.


If 'Found' OFF (Tax data does not exist in array2)

Set index2 to the first array position where array2_element DESC is blank
Store the following Tax Area-level records (2).  The Tax Authority-level (3) 
records that are within the Tax Area will be added after the 2-level record  ie. on 

completion of the array2 build, it will contain 1 or more record type 2's, with each 

2-level followed by 1 or more record-type 3's.  eg.  Record Type 2 could be Tax Rate/Area 

'DEN' with Record Type's 3