ForecastAccumulateActuals

Forecast Accumulate Actuals

Major Business Rule

Object Name: B3401050

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function will accumulate the "actuals" for the forecast records.

1.2Setup Notes and Prerequisites


1.3Special Logic



2.Technical Specifications

1.If LastBucketPosition is equal to zero
Move LastDateForActuals to MMDDYY format

Call CalculateBucketPosition 

Move BucketPosition to LastBucketPosition

End


Move RequestDate to MMDDYY format

Call CalculateBucketPosition


If the PntrToCustomers is zero

Create the LinkList for it

End

Lookup CustomerNumber in PntrToCustomer
If not found in list

Add the customer to the list

Create a PntrToActuals to associate with it

Else

Get the PntrToActuals associated with the customer to use

End


If BucketPosition is greater than zero

If PtrToActualValues is not equal to 0

If ClearList is equal to '1'
Initialize all nodes in the the list to zeros and set the NULL flags 

to TRUE

End

Add ForecastQty and ForecastAmt to PntrToActualValues,BucketPosition

Set NULL flag off

End
If PtrToActualValues is equal to 0
Create a new linked list and add BucketPosition nodes to the list with zero 

values and the NULL flag set to TRUE

End

End


2.Calculate Bucket Position 

If MonthlyWeekly = blank
Move MM to BucketPosition

Subtract YearOffFirstDate from YY to get $Z

Multiply $Z by 12

Add $Z to BucketPosition

Else

Subtract YearOffFirstDate from YY to get $Z

Multiply $Z by 52

Look in the PntrToDates for the first date with a year equal to YY = Position1

Look for the date in the list that is greater than or equal to RequestDate = Position2

Add the difference between the two positions to $Z to get BucketPosition

End


^

Data Structure

D3401050 - Forecast Accumulate Actuals

Parameter NameData ItemData TypeReq/OptI/O/Both
idPtrToCustomersGENLNGIDNONENONE

General purpose ID variable.

jdRequestedDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

mnLastBucketPositionMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnYearOffFirstDateYRMATH_NUMERICNONENONE

The calendar year for this calendar.

mnForecastQuantityQTYMATH_NUMERICNONENONE

The number of units associated with an asset.

mnForecastAmountFAMMATH_NUMERICNONENONE

The current amount of the forecasted units for a planning period.

cMonthlyVsWeeklyEV01charNONENONE

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

idPointerToDatesGENLNGIDNONENONE

General purpose ID variable.

cClearListEV01charNONENONE

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

mnCustomerNumberAN8MATH_NUMERICNONENONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

jdLastDateForActualsDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

Related Functions

None

Related Tables

None