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:
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
index1 = 2, if '3', index1 = 3, if '4', index1 = 4,......, if '8', index1 = 8.
If Tax Area (TXA1) is not blank
add Amount Field (AA) to array_element TAXABLE[index1]
else
add Amount Taxable (ATXA) to array_element TAXABLE[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]
or '$'.
Build array #2: Tax data summarized by Area and Authority.
'b7'b7'b7'b7
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'
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.
TYPE-2 record) in array2. Reset 'Found' ON or OFF.
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.
add data to a new index position (OFF), depending on whether the data from the input
parameters already exists in array2 or not.
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 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):
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
Amount Taxable (ATXA)
(TXR1)
(TXR1) / 100)
'Tax Amount Work Field'.
(TXR1)
1] +array2_element TAXAMT[index2 - 1]
1].
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]
after the Record-type 2 as follows:
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
Amount Taxable (ATXA)
If Tax Calc Method 2 (TC2) and this calc is not over Tax Rate 1 (TXR1)
(TXR1) / 100)
'Tax Amount Work Field'.
If Tax Calc Method 2 (TC2) and this calc is not over Tax Rate 1 (TXR1)
1] + array2_element TAXAMT[index2 - 1]
1].
'b7'b7'b7'b7
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'
'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.
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 Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
cStoreGetOrInitialize | MODE | char | NONE | NONE |
| ||||
cStoreTaxAreaExplCode | INCL | char | NONE | NONE |
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
| ||||
szTaxArea | TXA1 | char | NONE | NONE |
A code that identifies a tax or geographic area that has common tax rates and tax authorities. The system validates the code you enter
| ||||
szTaxExplanationCode | EXR1 | char | NONE | NONE |
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
| ||||
szTaxAreaDesc | TAXA | char | NONE | NONE |
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
| ||||
mnTaxableAmount | ATXA | MATH_NUMERIC | NONE | NONE |
The amount on which taxes are assessed. | ||||
mnAmountOfTax | STAM | MATH_NUMERIC | NONE | NONE |
The amount assessed and payable to tax authorities. It is the total of the VAT, use, and sales taxes (PST). | ||||
mnForeignTaxableAmount | CTXA | MATH_NUMERIC | NONE | NONE |
That portion of the sale that is subject to tax in foreign currency. | ||||
mnForeignTaxAmount | CTAM | MATH_NUMERIC | NONE | NONE |
The tax amount in foreign currency. This can be the sales, use, or VAT tax. | ||||
mnTotalTaxRateByArea | TRAT | MATH_NUMERIC | NONE | NONE |
A number that indicates the total percentage of taxes for the transaction or tax rate area. | ||||
cFactorType | FVTY | char | NONE | NONE |
A code that indicates whether the factor value is a multiplier (%) or an additional/deductible cash amount ($) when applied to an order's
| ||||
cTaxableYN | TAX1 | char | NONE | NONE |
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
| ||||
mnShortItemNumber | ITM | MATH_NUMERIC | NONE | NONE |
An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item
| ||||
mnTaxableAmountNet | AA | MATH_NUMERIC | NONE | NONE |
A number that identifies the amount that the system will add to the account balance of the associated account number. Enter credits with a
| ||||
mnTaxRate1 | TXR1 | MATH_NUMERIC | NONE | NONE |
A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.
| ||||
mnTaxRate2 | TXR2 | MATH_NUMERIC | NONE | NONE |
A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.
| ||||
mnTaxRate3 | TXR3 | MATH_NUMERIC | NONE | NONE |
A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.
| ||||
mnTaxRate4 | TXR4 | MATH_NUMERIC | NONE | NONE |
A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.
| ||||
mnTaxRate5 | TXR5 | MATH_NUMERIC | NONE | NONE |
A number that identifies the percentage of tax that should be assessed or paid to the corresponding tax authority, based on the tax area.
| ||||
mnTaxAuthority1 | TA1 | MATH_NUMERIC | NONE | NONE |
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
| ||||
mnTaxAuthority2 | TA2 | MATH_NUMERIC | NONE | NONE |
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
| ||||
mnTaxAuthority3 | TA3 | MATH_NUMERIC | NONE | NONE |
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,
| ||||
mnTaxAuthority4 | TA4 | MATH_NUMERIC | NONE | NONE |
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
| ||||
mnTaxAuthority5 | TA5 | MATH_NUMERIC | NONE | NONE |
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
| ||||
cTaxCalcMethod | TC2 | char | NONE | NONE |
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
| ||||
cTaxType3 | TT3 | char | NONE | NONE |
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
| ||||
cTaxType4 | TT4 | char | NONE | NONE |
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
| ||||
cTaxType5 | TT5 | char | NONE | NONE |
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
| ||||
cControlFlag | CTF2 | char | NONE | NONE |
A marker that is used internally to determine whether a Not-To-Exceed limit has been set at any level in the contract. | ||||
cSummaryDisplayMode | PDSP | char | NONE | NONE |
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
| ||||
mnRecordType | RCT1 | MATH_NUMERIC | NONE | NONE |
Special Output Returned
| ||||
idPtrToGroupArray | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
idPtrToAreaAndAuthority | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
idPtrToAreaExplanation | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cErrorCode | ERRC | char | NONE | NONE |
This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document
| ||||
szErrorMsgID | DTAI | char | NONE | NONE |
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
| ||||
cSuppressErrorMsg | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
nCounter | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
mnForeignNonTaxableAmt | AA1 | MATH_NUMERIC | NONE | NONE |
A number that identifies the actual amount. | ||||
cIsVertexActive | VVTX | char | OPT | NONE |
This flag determines whether to use the Vertex Tax Compliance system for tax calculations. Values are:
Y
Use Vertex system to calculate
| ||||
szAuthority1Description | DL01 | char | OPT | NONE |
A user defined name or remark. | ||||
szAuthority2Description | DL01 | char | OPT | NONE |
A user defined name or remark. | ||||
szAuthority3Description | DL01 | char | OPT | NONE |
A user defined name or remark. | ||||
szAuthority4Description | DL01 | char | OPT | NONE |
A user defined name or remark. | ||||
szAuthority5Description | DL01 | char | OPT | NONE |
A user defined name or remark. | ||||
jdDateTax | DSVJ | JDEDATE | OPT | NONE |
A date that indicates when you purchased goods or services, or when you incurred a tax liability. |
None |
None |