LotProcessing

Lot Processing

Minor Business Rule

Object Name: B4100300

Parent DLL: COPBASE

Location: Client/Server

Language: C

Functional Description

Purpose
To perform edits against lot numbers.  Lot grade and potency edits, assigning of the lot number
and lot number processing.


Setup Notes and Prerequisities

The lot grade and potency fields will need to be passed in.

Special Logic




Technical Specifications


Parameters
Data Item     Data Structure Description     I/O      Required     Notes
ITM           Short Item Number               I    Y
MCU           Branch/Plant                    I           Y

LOTN          Lot Number                      B           N

LOCN          Location                        B           N

LOTG          Lot Grade                       B           Y

LOTP          Lot Potency                     B           Y

MMEJ          Expiration Date                 I           Y

SRCE          Lot Process Type                I           Y

PID           Program ID                      I           Y

EV01          Default from Primary            I           Y

EV01          Suppress Error Message          I           Y

DTAI          Error Message ID                O           Y

OT1Y          Potency Control                 I           N

OT2Y          Grade Control                   I           N

FRDG          From Grade                      I           N

THGD          Thru Grade                      I           N

FRMP          From Potency                    I           N

THRP          Thru Potency                    I           N

STDP          Standard Potency                I           N

STDG          Standard Grade                  I           N

EV01          Item Location Rcd Not Found     I           N      


Related Tables
F41021 - Item Location

Related Business Functions

Verify Duplicate Lot - X41DUP
Lot Number By Process Type - B4100500


Processing

If Lot Number(LOTN) is blank and Lot Grade(LOTG) is not blank, issue error '4190'.
If Lot Number(LOTN) is not blank,

If Grade Control(OT2Y) equals '1' or 'Y', and Lot Grade(LOTG) < From Grade(FRDG)

 or Lot Grade(LOTG) > Thur Grade(THGD), issue error '3892'.  This is only a WARNING.

If Grade Control(OT2Y) is NOT a '1' or 'Y', and Lot Grade(LOTG) is not blank, issue

error'3856'.  This is only a WARNING.

If Grade Control(OT2Y) equals '1' or 'Y' and Lot Grade(LOTG) equals blank, move

Standard Grade(STDG) into Lot Grade(LOTG).

If Lot Number(LOTN) is blank and Lot Potency(LOTP) is not blank, issue error'4190.

If Lot Number(LOTN) is not blank,

If Potency Control(OT1Y) equals '1' or 'Y', and Lot Potency(LOTP) < From Potency(FRMP)

or Lot Potency(LOTP) > Thru Potency(THRP), issue error '4037'.  This is only a WARNING.

If Potency Control(OT1Y) is NOT a '1' or 'Y', and Lot Potency(LOTP) is not blank, issue

error '3857'.  This only a WARNING.

If Potency Control(OT1Y) equals '1' or 'Y' and LOTP equals blank, move Standard

Potency(STDP) into LOTP.


//If location and lot are blank and the primary default flag is on, and you are doing lot 

  processing, need to assign lot number.  Also if you are not defaulting from the primary,

  need to assign lot number.//

If SRCE not equal blanks AND SRCE not equal zeros

If Default equals '1'

If LOCN equals blanks AND LOTN equals blanks

If Item Location Rcd Not Found equals '1',

Call 
LotNumberAssignByProcessType (B4100500)
Else
Call 
LotNumberAssignByProcessType (B4100500)

//Edit for duplicate lot numbers if parameter set to do so.//
If LOTN not blank

Call 
VerifyDuplicateLot (X41DUP).  If error, issue '2501'.

//If lot processing, a lot must be entered.//

If SRCE equals '3' and LOTN equals blank and Default From Potency equals '0', 

error '2745'.



































































































































































































































Data Structure

D4100300 - Lot Processing

Parameters

Data Item
     Data Structure Description     I/O     Required     Notes
ITM           Short Item Number               I         Y
MCU           Branch/Plant                    I         Y

LOTN          Lot Number                      B         N

LOCN          Location                        B         N

LOTG          Lot Grade                       B         Y

LOTP          Lot Potency                     B         Y

MMEJ          Expiration Date                 I         Y

SRCE          Lot Process Type                I         Y

PID           Program ID                      I         Y

EV01          Default from Primary            I         Y

EV01          Suppress Error Message          I         Y

DTAI          Error Message ID                O         Y

OT1Y          Potency Control                 I         N

OT2Y          Grade Control                   I         N

FRDG          From Grade                      I         N

THGD          Thru Grade                      I         N

FRMP          From Potency                    I         N

THRP          Thur Potency                    I         N

STDP          Standard Potency                I         N

STDG          Standard Grade                  I         N

EV01          Item Location Rcd Not Found     I         N

TRDJ          Transaction Date - Julian       I         N


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnShortItemNumberITMMATH_NUMERICNONENONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szBranchPlantMCUcharNONENONE

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.

szLocationLOCNcharNONENONE

The storage location from which goods will be moved.

szLotNumberLOTNcharNONENONE

A number that identifies a lot or a serial number. A lot is a group of items with similar characteristics.

szLotGradeLOTGcharNONENONE

A code that indicates the grade of a lot. The grade is used to indicate the quality of the lot. Examples include the following:    A1   Premium 
grade    A2   Secondary grade  The grade for a lot is stored in the Lot Master table (F4108).

mnLotPotencyLOTPMATH_NUMERICNONENONE

A code that indicates the potency of the lot expressed as a percentage of active or useful material (for example, the percentage of alcohol 
in a solution). The actual potency of a lot is defined in the Lot Master table (F4108).

jdExpirationDateMMEJJDEDATENONENONE

The date on which a lot of items expires. The system automatically enters this date if you have specified the shelf life days for the item on 
Item Master Information or Item Branch/Plant Information. The system calculates the expiration date by adding the number of shelf life days to 
the date that you receive the item. You can commit inventory based on the lot expiration date for items. You choose how the system commits 
inventory for an item on Item Master Information or Item Branch/Plant Information.

cSuppressErrorMessageEV06charNONENONE

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

szErrorMessageIDDTAIcharNONENONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

cPotencyControlOT1YcharNONENONE

A code that indicates whether you control the item by potency.

cGradeControlOT2YcharNONENONE

A code that indicates whether you control the item by grade.

szFromGradeFRGDcharNONENONE

A user defined code (40/LG) that indicates the minimum grade that is acceptable for an item. The system displays a warning message if 
you try to purchase or issue items with grades that do not meet the minimum grade acceptable. The system does not allow you to sell items 
with grades that do not meet the minimum acceptable level.

szThruGradeTHGDcharNONENONE

A user defined code (40/LG) that indicates the maximum grade that is acceptable for an item. The system displays a warning message if 
you try to purchase or issue items with grades that exceed the maximum grade acceptable. The system does not allow you to sell items with 
grades that exceed the maximum grade acceptable.

mnFromPotencyFRMPMATH_NUMERICNONENONE

A number that indicates the minimum potency or percentage of active ingredients acceptable for an item. The system displays a warning 
message if you try to purchase or issue items that do not meet the minimum acceptable potency. The system does not allow you to sell items 
that do not meet the minimum acceptable potency.

mnThruPotencyTHRPMATH_NUMERICNONENONE

A number that indicates the maximum potency or percentage of active ingredients that is acceptable for an item. The system displays a 
warning message if you try to purchase or issue items that have a potency that exceeds the maximum potency acceptable. The system does 
not allow you to sell items that have a potency that exceeds the maximum potency acceptable.

mnStandardPotencySTDPMATH_NUMERICNONENONE

The percentage of active ingredients normally found in an item.

szStandardGradeSTDGcharNONENONE

A code (table 40/LG) that represents the normal grade for an item.

jdTransactionDateTRDJJDEDATENONENONE

The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.

Related Functions

None

Related Tables

None
VerifyLotDateRanges

VerifyLotDateRanges

Lot Processing

Minor Business Rule

Object Name: B4100300

Parent DLL: COPBASE

Location: Client/Server

Language: C

Data Structure

D4100300B - Verify Lot Date Ranges

Parameter NameData ItemData TypeReq/OptI/O/Both
jdExpirationDateMMEJJDEDATEOPTNONE

The date on which a lot of items expires. The system automatically enters this date if you have specified the shelf life days for the item on 
Item Master Information or Item Branch/Plant Information. The system calculates the expiration date by adding the number of shelf life days to 
the date that you receive the item. You can commit inventory based on the lot expiration date for items. You choose how the system commits 
inventory for an item on Item Master Information or Item Branch/Plant Information.

jdBasedOnDateBODJJDEDATEOPTNONE

The date that the system uses in conjunction with the shelf life days to calculate the lot expiration date. You can enter this date during 
inventory completions. In addition to calculating the lot expiration date, the system uses the date that you enter in this field to calculate the following 
lot dates:   o Sell By Date   o Best Before Date   o Lot Effectivity Date   o User Lot Date 1   o User Lot Date 2   o User Lot Date 3   o User Lot Date 
4   o User Lot Date 5

jdOnHandDateOHDJJDEDATEOPTNONE

The date when a lot is considered to be on hand in a branch/plant. The system determines the on-hand date by using the transaction date 
upon which the first inventory for a particular lot is determined to be on hand. The system automatically assigns this date to the Lot Master 
table (F4108).

jdLotEffectivityDateDLEJJDEDATEOPTNONE

The date on which a lot becomes available. The system uses this date for availability and commitment processing to indicate that the lot is 
available on or after the date that you specify. You must complete this field when inventory first becomes an on-hand quantity for the lot. If you 
leave this field blank, the system calculates the effective date of the lot by using the value for Effective Days in the Item Branch File table 
(F4102) or the current date if the value for Effective Days is zero.

jdSellByDateSBDJJDEDATEOPTNONE

The date by which a lot should be completely sold. The system uses this date as a "through" date for commitment processing. The system 
calculates the sell by date using the value in the Sell By Days field, which is contained in the Item Branch File table (F4102), when inventory 
becomes available on-hand.

jdBestBeforeDateBBDJJDEDATEOPTNONE

The last date on which the products in a lot should be consumed. The system calculates the date by retrieving the value from the Best 
Before Days field in the Item Master program (P4101). You can also use this date as a "through" date for commitment processing. You can 
commit a lot by this date by using the Commitment Date Method field in the Item Branch program (P41026).

jdUserLotDate1U1DJJDEDATEOPTNONE

A date that the system can use as a through date for commitment processing. The system stores this date in the Lot Master table (F4108). If 
you leave this field blank, the system can calculate the date by using the value for the User Lot Date 1 Default Days field, which is stored in 
the Item Branch File table (F4102).

jdUserLotDate2U2DJJDEDATEOPTNONE

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to the Lot Expiration 
Date, User Lot Date 2 is a through date for commitment processing. The User Lot Date 2 commitment option is available in the Commitment 
Date Method in the Item Branch table (F4102). The system uses the User Lot Date 2 Default Days from the Item Branch table (F4102) to 
calculate User Lot Date 2 when inventory first goes on hand.

jdUserLotDate3U3DJJDEDATEOPTNONE

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to Lot Expiration Date, 
User Lot Date 3 is a through date for commitment processing. The User Lot Date commitment option is available in the Commitment Date 
Method in the Item Branch table (F4102). The system uses the User Lot Date 3 Default Days from the Item Branch table (F4102) to calculate User 
Lot Date 3 when inventory first goes on hand.   

jdUserLotDate4U4DJJDEDATEOPTNONE

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to Lot Expiration Date, 
User Lot Date 4 is a through date for commitment processing.   The User Lot Date commitment option is available in the Commitment Date 
Method in the Item Branch table (F4102). The system uses the User Lot Date 4 Default Days from the Item Branch table (F4102) to calculate 
User Lot Date 4 when inventory first goes on hand.

jdUserLotDate5U5DJJDEDATEOPTNONE

A user-defined date that can be used for commitment purposes and is stored in the Lot Master table (F4108). Similar to Lot Expiration Date, 
User Lot Date 5 is a through date for commitment processing.   The User Lot Date 5 commitment option is available in the Commitment Date 
Method in the Item Branch table (F4102). The system uses the User Lot Date 5 Default Days from the Item Branch table (F4102) to calculate 
User Lot Date 5 when inventory first goes on hand.

jdDateTransactionTRDJJDEDATEOPTNONE

The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.

cSuppressErrorMsgsEV01charOPTNONE

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

szErrorMsgIDDTAIcharOPTNONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

szProgramIdPIDcharOPTNONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

Related Functions

None

Related Tables

None