GetWCResourceCalendar

Get WC Resource Calendar

Minor Business Rule

Object Name: B3000270

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

Get system calendar for appropriate month and year, calculate offsets, and clear calendar slots prior 

to first of month, then display the calendar.  Finally, clear the slots after the last day of the 

month.


Get the work day calendar for the appropriate month and year.  Determine the type of day, calculate 

offsets, and clear calendar slots prior to first of month.  If it is not a workday, protect field and 

display description for type of day.  If it is a workday, display the resource units available.  Next, 

clear the slots after the last day of the month.


This function should allow updates to the database from the edit fields on the revision form.

This function should allow adds to the database from the edit fields on the revision form


Finally, calculate the Total Resource Units for the month.



2.Technical Specifications


2.4Processing 

Edits:


if Update = 0

1.0   Retrieve the Calendar using YR and MT;

2.0   Determine number of days in that month (y);

3.0   Determine the first day of that month (Sunday, Monday, Tuesday, etc.):

4.0   Calculate the This Month Offset (MN09A),  where Sunday=0, Monday=1, etc.;

5.0   Calculate Next Month Offset (MN09B) by using formula:  (MN09A+y);

6.0   Do for x = 1 to y (number of days in month)

6.1   Put the day of the month (value of x) in the appropriate work field

 [CAL0x+MN09A];

7.0Fetch the F30006 record using WorkCenter and Workcenter Branch as keys. These

two fields are part of the input datastructure. Read the WDCT and WDCK fields

from F30006.

7.0   Retrieve the Work Day Calendar (F0007) using MCU, YR, MT, WDCT and WDCK 

 with index named Branch,Year,+A.;

8.0   If no F0007 record exists, return error message (#1986) and go to end of 

program;

9.0   Retrieve the Work Center Resource Units (F3007) using MMCU, MCU, UM, YR, 

MT , CTRY with the index named Branch,BusinessUnit,+A;

10.0   If no F3007 record exists, initialize value of RU01 through RU35 = 0;

11.0   Initialize Total Resource Units = 0;

12.0   Do for x=1 to y (number of days in the month);

12.1  Get the type of day from F0007;

12.2  If the type of day  = "W", then:

12.2.1   Get the number of resource units (RUx) from F3007,

12.2.2   Add the value to Total Resource Units,

12.2.3   Convert the value to a string, and

12.2.4   Put string to appropriate work field (i.e. WKRUx + MN09A),

12.3  Else retrieve type of day description from UDC table (F0005), and

12.3.1   Put description in appropriate workfield (i.e. WKRUx + 

MN09A).

12.4  Repetitive- If this is an "all shifts record" as indicated by DS parameter 

cAllShiftsRecord, display all days as if they were "W".



If Update = 1

     Update F3007 record with new values from app.

Repetitive- if the current shift is not blank also update the "all shifts record" with the total 

resource units from all shifts.

If Update = 3

     Add skeleton record (MMCU, YR, UM, MCU,MT ,STYL,SHFT, CTRY  and audit info ) to F3007 so that 

the app will find a record and update its resource units. Note: the Work day  calendar (  F0007 ) record 

 is added by the app.

Repetitive- If the current shift is not blank, checks for existence of "all shifts record", and if 

not found, adds it.

If Update = 5

Delete the F3007 record based on full key (Which includes the newly added CTRY). Also subtracts 

the deleted resource units from the blank "all shifts" record. 

  

Issue:

In the future, it may be possible to remove CAL01 from this business function.  The calculation may 

be done in GBR once we have the ability to specify numeric values in GBR.

Data Structure

D300027A - Calendar Data Struct

Parameter NameData ItemData TypeReq/OptI/O/Both
mnCalendarLocation01CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation02CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation03CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation04CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation05CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation06CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation07CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation08CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation09CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation10CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation11CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation12CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation13CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation14CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation15CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation16CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation17CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation18CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation19CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation20CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation21CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation22CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation23CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation24CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation25CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation26CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation27CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation28CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation29CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation30CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation31CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation32CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation33CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation34CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation35CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation36CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation37CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

mnCalendarLocation38CAL01MATH_NUMERICNONENONE

Current calendar date for this month and year.

szResourceUnitsWork01WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork02WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork03WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork04WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork05WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork06WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork07WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork08WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork09WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork10WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork11WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork12WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork13WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork14WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceunitswork15WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork16WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork17WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork18WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork19WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceunitswork20WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork21WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork22WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork23WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork24WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork25WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork26WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork27WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork28WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork29WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork30WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork31WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork32WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork33WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork34WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork35WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szResourceUnitsWork36WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szBranchMMCUcharNONENONE

A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

szWorkCenterMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szUnitOfMeasureUMcharNONENONE

A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box, 
cubic meter, liter, hour, and so on.

mnCalendarYearYRMATH_NUMERICNONENONE

The calendar year for this calendar.

mnCalendarMonthMTMATH_NUMERICNONENONE

A number that corresponds to the month in a calendar year. 

mnThisMonthOffsetMN09AMATH_NUMERICNONENONE

Generic Math Numeric - size 9

mnNextMonthOffsetMN09BMATH_NUMERICNONENONE

Generic Math Numeric - size 9

mnTotalResourceUnitsMN09AMATH_NUMERICNONENONE

Generic Math Numeric - size 9

cUpdateEV01charNONENONE

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

szResourceUnitsWork37WKRU01charNONENONE

A value expressed in units, dollars, hours, floor space, etc., that is used to calculate capacity.

szCostCenterTypeSTYLcharOPTNONE

A user defined code (00/MC) that identifies the classification of the business unit.

cShiftCodeSHFTcharOPTNONE

A user defined code (00/SH) that identifies daily work shifts. In payroll systems, you can use a shift code to add a percentage or amount to 
the hourly rate on a timecard. For payroll and time entry: If an employee always works a shift for which a shift rate differential is applicable, 
enter that shift code on the employee's master record. When you enter the shift on the employee's master record, you do not need to enter the 
code on the timecard when you enter time. If an employee occasionally works a different shift, you enter the shift code on each applicable 
timecard to override the default value.

mnWorkCenterUtilizationWORUMATH_NUMERICOPTNONE

A percentage that indicates how intensively a work center is being used. This value usually refers to machine use. It is the ratio of the direct 
time charged for production activities to the planned hours. The Refresh Resource Units program also uses this value as a default when 
calculating rated capacity. Enter percents as whole numbers. For example, enter 80% as 80.00.

mnWorkCenterEfficiencyWOREMATH_NUMERICOPTNONE

A user defined value that indicates how efficiently a work center operates. This value usually refers to staff efficiency. When you enter a 
value in this field, and the Modify Cost by Work Center Efficiency field in the Job Shop Manufacturing Constants table (F3009) is set to Y, the 
system creates a new cost component (B4) from the cost calculated from the direct labor cost (B1). For example, if the constant is set to Y, the value 
of this field is 80%, and the direct labor cost is 10, the system creates a B4 cost component for 2 in the Item Cost Component Add-Ons table 
(F30026). The Refresh Resource Units program also uses this value as a default when calculating rated capacity. Enter percents as whole 
numbers. For example, enter 80% as 80.00. Note: The system expects that the routing times entered for each operator are the actual times it 
takes to complete an operation. Efficiency does not affect total cost. Efficiency does reassign some of the costs into different cost 
components. Efficiency does not change the duration or backscheduling of a work order.

mnWorkCenterUtilization_2WORUMATH_NUMERICOPTNONE

A percentage that indicates how intensively a work center is being used. This value usually refers to machine use. It is the ratio of the direct 
time charged for production activities to the planned hours. The Refresh Resource Units program also uses this value as a default when 
calculating rated capacity. Enter percents as whole numbers. For example, enter 80% as 80.00.

mnWorkCenterEfficiency_2WOREMATH_NUMERICOPTNONE

A user defined value that indicates how efficiently a work center operates. This value usually refers to staff efficiency. When you enter a 
value in this field, and the Modify Cost by Work Center Efficiency field in the Job Shop Manufacturing Constants table (F3009) is set to Y, the 
system creates a new cost component (B4) from the cost calculated from the direct labor cost (B1). For example, if the constant is set to Y, the value 
of this field is 80%, and the direct labor cost is 10, the system creates a B4 cost component for 2 in the Item Cost Component Add-Ons table 
(F30026). The Refresh Resource Units program also uses this value as a default when calculating rated capacity. Enter percents as whole 
numbers. For example, enter 80% as 80.00. Note: The system expects that the routing times entered for each operator are the actual times it 
takes to complete an operation. Efficiency does not affect total cost. Efficiency does reassign some of the costs into different cost 
components. Efficiency does not change the duration or backscheduling of a work order.

cAllShiftsRecordEV01charOPTNONE

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

cErrorConditionEV01charOPTNONE

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

cFormModeEV01charOPTNONE

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

cBlankShiftDeletedYNEV01charOPTOUTPUT

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

Related Functions

None

Related Tables

F0005 User Defined Codes
F0007 Workday Calendar
F3007 Work Center Resource Units