CalculateTierDiscPercandDueDate

Calculate Tier Discount Percent and Due Date

Minor Business Rule

Object Name: N0000570

Parent DLL: CFIN

Location: Client/Server

Language: NER

Functional Description

Purpose

This function is used to determine the new discount percentage and the new discount due date for 
invoice or voucher pay items that use multi-tiered payment terms. This function should only be called by 

the batch update applications for multi-tiered payment terms processing
. These applications are Batch 
Update for Multi-Tiered A/R (R005142) and Batch Update for Multi-Tiered A/P (R005141).


Setup Notes and Prerequisites

None.


Special Logic

None.



Technical Specification



Parameters

Item DescriptionI/OReq?Notes

DATE01jdAsOfDateIYDate the batch update applications are processing 
(value from processing options or current system date).

DATE01jdBasedOnDateIYInvoice Date, G/L Date, or Tax/Service Date.

DYT1mnToDayTier1IyIf blank, use zero.

DYT2mnToDayTier2IyIf blank, use zero.

DYT3mnToDayTier3IyIf blank, use zero.

DYT4mnToDayTier4IYIf blank, use zero.

DYT5mnToDayTier5IYIf blank, use zero.

DCP1mnDiscountPercTier1IY

DCP2mnDiscountPercTier2IY

DCP3mnDiscountPercTier3IY

DCP4mnDiscountPercTier4IY

DCP5mnDiscountPercTier5IY

WKDYcWorkDayRuleIN

CALNszCalendarIN

0SADDmnDaystoAddIN

NDDRszNetDueDateRuleIY

DCPmnCurrentTierDiscounONNew discount percentage.

DDNJjdCurrentTierDueDateONNew discount due data 

rule.



Related Tables

None.


Related Functions

B0000149Is Date A Work Date
B0000150Advance Work Days

X03021New Due Date Calculation


Processing

Identify first open-ended tier.

Determine new end dates for each non-open tier.

If a work day calendar and a work day rule were specified,

For each non-open tier,

Determine if end day is a work day by calling B0000149.

If end day is not a work day,

Adjust end day to be a work day by calling B0000150.

Endif.

End for loop.

Endif.

Identify the current tier.

Determine the new discount percentage based on the current tier.

Determine the new discount due date based on the current tier.


Data Structure

D0000570 - Calculate Tier Discount Percent and Due Date

Parameter NameData ItemData TypeReq/OptI/O/Both
jdAsOfDateDATE01JDEDATEREQINPUT

Event point for JDE Date.

jdBasedOnDateDATE01JDEDATEREQINPUT

Event point for JDE Date.

mnToDayTier1DYT1MATH_NUMERICREQINPUT

The final number of the range of days for the first of five tiers that can be set up for multitiered discounts. The system uses this field in 
conjunction with the From field (DYF1) to establish the range of days after the date specified in the Based on Date field (DABS) for which the 
corresponding discount percentage (DCP1) applies.  For example, if the range of days specified for tier one is 1 through 5, and the corresponding 
discount percentage is .15, and the based on date is invoice date, the system allows a 15% discount if the invoice or voucher is paid 
between 1 and 5 days after the invoice date.  Note: The value that you enter must be equal to or greater than the value entered in the From field for 
the first tier. Do not specify a day range unless you specify a discount percent.

mnToDayTier2DYT2MATH_NUMERICREQINPUT

The final number of the range of days for the second of five tiers that can be set up for multitiered discounts. The system uses this field in 
conjunction with the From field (DYF2) to establish the range of days after the date specified in the Based on Date field (DABS) for which the 
corresponding discount percentage (DCP2) applies.  For example, if the range of days specified for tier two is 6 through 10, and the 
corresponding discount percentage is .10, and the based on date is invoice date, the system allows a 10% discount if the invoice or voucher is paid 
between 6 and 10 days after the invoice date. Note: The value that you enter must be equal to or greater than the value entered in the From field 
for the second tier. Do not specify a day range unless you specify a discount percent. 

mnToDayTier3DYT3MATH_NUMERICREQINPUT

The final number of the range of days for the third of five tiers that can be set up for multitiered discounts. The system uses this field in 
conjunction with the From field (DYF3) to establish the range of days after the date specified in the Based on Date field (DABS) for which the 
corresponding discount percentage (DCP3) applies.  For example, if the range of days specified for tier three is 11 through 20, and the 
corresponding discount percentage is .05, and the based on date is invoice date, the system allows a 5% discount if the invoice or voucher is paid 
between 11 and 20 days after the invoice date. Note: The value that you enter must be equal to or greater than the value entered in the From field 
for the third tier. Do not specify a day range unless you specify a discount percent. 

mnToDayTier4DYT4MATH_NUMERICREQINPUT

The final number of the range of days for the fourth of five tiers that can be set up for multitiered discounts. The system uses this field in 
conjunction with the From field (DYF4) to establish the range of days after the date specified in the Based on Date field (DABS) for which the 
corresponding discount percentage (DCP4) applies.  For example, if the range of days specified for tier four is 21 through 25, and the corresponding 
discount percentage is .03, and the based on date is invoice date, the system allows a 3% discount if the invoice or voucher is paid 
between 21 and 25 days after the invoice date. Note: The value that you enter must be equal to or greater than the value entered in the From field for 
the fourth tier. Do not specify a day range unless you specify a discount percent. 

mnToDayTier5DYT5MATH_NUMERICREQINPUT

The final number of the range of days for the fifth of five tiers that can be set up for multitiered discounts. The system uses this field in 
conjunction with the From field (DYF5) to establish the range of days after the date specified in the Based on Date field (DABS) for which the 
corresponding discount percentage (DCP5) applies.  For example, if the range of days specified for tier five is 26 through 30, and the corresponding 
discount percentage is .01, and the based on date is invoice date, the system allows a 1% discount if the invoice or voucher is paid 
between 26 and 30 days after the invoice date. Note: The value that you enter must be equal to or greater than the value entered in the From field for 
the fifth tier. Do not specify a day range unless you specify a discount percent. 

mnDiscountPercTier1DCP1MATH_NUMERICREQINPUT

The percentage that the invoice or voucher will be discounted if it is paid within the day range specified in the first tier. Enter this value as a 
decimal. For example, enter .15 to specify a 15% discount.

mnDiscountPercTier2DCP2MATH_NUMERICREQINPUT

The percentage that the invoice or voucher will be discounted if it is paid within the day range specified in the second tier. Enter this value 
as a decimal. For example, enter .10 to specify a 10% discount.

mnDiscountPercTier3DCP3MATH_NUMERICREQINPUT

The percentage that the invoice or voucher will be discounted if it is paid within the day range specified in the third tier. Enter this value as a 
decimal. For example, enter .05 to specify a 5% discount.

mnDiscountPercTier4DCP4MATH_NUMERICREQINPUT

The percentage that the invoice or voucher will be discounted if it is paid within the day range specified in the fourth tier. Enter this value as 
a decimal. For example, enter .03 to specify a 3% discount.

mnDiscountPercTier5DCP5MATH_NUMERICREQINPUT

The percentage that the invoice or voucher will be discounted if it is paid within the day range specified in the fifth tier. Enter this value as a 
decimal. For example, enter .01 to specify a 1% discount.

cWorkDayRuleWKDYcharOPTINPUT

A code that specifies whether to include nonworking days in the due date calculation and whether to change the due date if it is on a 
nonworking day. Valid values are: Blank Use the due date that the system calculates regardless of whether it is a nonworking day. 1 Do not include 
nonworking days in the due date calculation. For example, if the system adds 15 days to the invoice date to calculate the due date, and 
weekend days are specified as nonworking days, the system does not count them when it adds the 15 days. Therefore, if the invoice date is 6/01/05, 
which is a Wednesday, the system calculates the due date on 6/22/05. 2 Include nonworking days in the due date calculation, but if the due 
date is on a nonworking day, move it forward to the next working day. 3 Include nonworking days in the due date calculation, but if the due date 
is on a nonworking day, move it back to the previous working day. Note: The system considers any value entered in the calendar other than 
W to be nonworking.

szCalendarCALNcharOPTINPUT

The name of the calendar, which is the description of the branch/plant, that you set up to differentiate between working days, holidays, 
weekends, and so forth. The calendar name that you specify must exist in the Workday Calendar table (F0007). The system uses the calendar in 
conjunction with the work day rule specified to determine the due date if the system calculates it on a weekend or holiday. 

mnDaystoAddDADDMATH_NUMERICOPTINPUT

The number of days that the system adds to or subtracts from, if you specify negative days, the date specified in the Based on Date field 
(DABS) to calculate the discount due date or net due date on the invoice or voucher.

szNetDueDateRuleNDDRcharREQINPUT

The rule that the system uses to calculate the net due date of a voucher or invoice. 

mnCurrentTierDiscountPercDCPMATH_NUMERICOPTOUTPUT

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.

jdCurrentTierDueDateDDNJJDEDATEOPTOUTPUT

In the Accounts Receivable system, the date that the invoice must be paid to receive the discount. The system calculates the discount due 
date based on the payment term. If the payment term does not specify a discount, the system completes this field with the net due date. In the 
Accounts Payable system, the date that the voucher is due.

cErrorStatusEV01charREQOUTPUT

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

Related Functions

None

Related Tables

None