1.Functional Description
1.1Purpose
This function will determine the Begin Date, End Date, Last Date needed for actuals, First Date
needed for actuals, and create the link list of date pattern dates by calling B3400730.
1.2Setup Notes and Prerequisites
1.3Special Logic
2.Technical Specifications
1.If the BeginDate is blank
Move todays date to it.
End
Move the BeginDate to an array that breaks it down by MM/DD/YY
2.Load date pattern link list
If the DatePattern to be used for creating the actuals is blank
Call B0000059 to retrieve the Company Constants record for 00000 and use it's date
pattern
End
Call BuildDatePatternLinkList B3400730
If error is returned set error flag and stop processing
Move 1 to $DTERR
Set on ER_ERROR
End
If the BeginDate is less than the first date in the PntrToDates list
Or if no date was found greater than or equal to the BeginDate
Move 2 to $DTERR
set on ER_ERROR and stop processing
End
3.Calculate End Date
Find date greater than or equal to BeginDate in the PntrToDates list
Go NumberOfPeriods minus 1 beyond that date to get EndDate
If EndDate is zero
Move 3 to $DTERR
Set on ER_ERROR and Stop Processing
End
4.Calculate Last Date Needed for Actuals
Look in the PntrToDates list for the date that is greater than or equal to BeginDate and use the
date just before it as LastDateForActulas
5.Calculate First Date Needed for Actuals
Move 01 to DD
Save MM in $MTH
Save YY in $YR
If MonthlyWeekly is equal to 1
Divide each of the methods months by 4 to approximate the number of months they represent
Round up results
End
Move MonthsBestFit to MM
If Method1 is not blank or Method3 is not blank
Add 12 to MM
End
If Method2 is not blank and MM is less than 12 + MonthsBestFit + NumberMonthsMethod2
Move 12 + MonthsBestFit + NumberMonthsMethod2 to MM
End
If Method4 is not blank and MM is less than MonthsBestFit + MoveAvgNumberMonths
Move MonthsBestFit + MoveAvgNumberMonths to MM
End
If Method5 is not blank and MM is less than MonthsBestFit + LinearApproxNoMonths
Move MonthsBestFit + LinearApproxNoMonths to MM
End
If Method6 is not blank and MM is less than MonthsBestFit + LSRNumberMonths
Move MonthsBestFit + LSRNumberMonths to MM
End
If Method7 is not blank and MM is less than MonthsBestFit + 3 * 2ndDegreeApproxNoMonths
Move MonthsBestFit + 3 * 2ndDegreeApproxNoMonths to MM
End
If Method8 is not blank and MM is less than MonthsBestFit +
FlexibleNumberOfMonthsMove FlexibleNumberOfMonths + MonthsBestFit to
MM
End
If Method9 is not blank and MM is less than MonthsBestFit + WeightedAvgNoMonths then
Move MonthsBestFit + WeightedAvgNoMonths to MM
End
If Method10 is not blank and MM is less than MonthsBestFit + LinearSmoothingNoMonths then
Move MonthsBestFit + LinearSmoothingNoMonths to MM
End
If Method11 is not blank and MM is less than MonthsBestFit + ExponNumberOfMonths
Move the ExponNumberOfMonths + MonthsBestFit to MM
End
If Method12 is not blank and MM is less than 24 + MonthsBestFit
Move 24 + MonthsBestFit to MM
End
Divide MM by 12 to get YY
Move the remainder of the above divide to MM
Subtract MM from $MTH to get $M
If $M < 1
Add 1 to YY
Add 12 to $M to get MM
Else
Move $M to MM
End
Subtract YY from $YR to get a new YY
Move the new MM into $MTH
Move the new YY into YearOffFirstDate
Scrub MMDDYY and put it in FirstDateForActuals
If FirstDateForActuals is not in DatePattern link list
Move 4 to $DTERR
Set on ER_ERROR and Stop Processing
End
^
D3400810 - Forecast Calculate Dates
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
jdBeginDate | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
jdEndDate | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
jdFirstDateForActuals | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
jdLastDateForActuals | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
mnYearOffFirstDate | YR | MATH_NUMERIC | NONE | NONE |
The calendar year for this calendar. | ||||
cMonthlyVsWeekly | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cDatePattern | DTPN | char | NONE | NONE |
A code that identifies date patterns. You can use one of 15 codes. You must set up special codes (letters A through N) for 4-4-5, 13-period
| ||||
cDatePatternError | ERR | char | NONE | NONE |
The Data Field Error Code field is simply a generic data field to pass an error condition flag. This field is one of the fields that make up the
| ||||
idPointerToDates | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cDateCalculationError | ERR | char | NONE | NONE |
The Data Field Error Code field is simply a generic data field to pass an error condition flag. This field is one of the fields that make up the
| ||||
mnFlexibleNumberOfMonths | MATH05 | MATH_NUMERIC | NONE | NONE |
Event point for Math Numeric. | ||||
mnExponNumberOfMonths | MATH06 | MATH_NUMERIC | NONE | NONE |
Event point for Math Numeric. | ||||
mnNumberOfPeriods | MATH07 | MATH_NUMERIC | NONE | NONE |
Event point for Math Numeric. | ||||
szProgramID | PID | char | NONE | NONE |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
mnMonthsBestFit | MATH08 | MATH_NUMERIC | NONE | NONE |
Event point for Math Numeric. | ||||
mnMoveAvgNumberOfMonths | MATH09 | MATH_NUMERIC | NONE | NONE |
Event point for Math Numeric. | ||||
szMethod2 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod4 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod5 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod6 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod1 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod3 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod7 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod8 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod9 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod10 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod11 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szMethod12 | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
mnCalcPercentNumberMonths | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mnLSRNumberOfMonths | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mnLinearApproxNoMonths | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mnWeightedAvgNoMonths | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mnLinearSmoothingNoMonths | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mn2ndDegreeApproxNoMonths | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mnMethodError | MN2D0 | MATH_NUMERIC | NONE | NONE |
This is a generic field used as a work field. |
B0000059 RetrieveCoFiscalPtnCode | ||||
B3400730 Build Date Pattern Link List |
None |