You are here: Development Standards > Routines > Application-SpecificRoutines > INCALCPR.PUB

# INCALCPR.PUB

INCALCPR.PUB is a public program that calculates a sales price based on item, quantity and customer criteria. It is called by INUPD.PUB, INPRCALC.PUB and INQTYDSP.PUB.

`0045 ENTER FILE[ALL],PCALC$,INUPD3$,MSG$,INVE$,INUM$,INLD$,INPS$,INLP$,INUP$,`
`0045:INSN$,INPP$,O2$`

Variable | Description
FILE[ALL] | Standard file array used for the data file channel number
PCALC$ | INCALCPR.PUB data string (see table below)
INUPD3$ | File array template (see INUPD.PUB)
MSG$ | Returns a message string if an error occurs
INVE$ | INVExxx file template (Item Master file)
INUM$ | INUMxxx file template (Unit of Measure file)
INLD$ | INLDxxx file template (Location Detail file)
INPS$ | INPSxxx file template (Price Structures file)
INUP$ | INUPxxx file template (Unit of Measure Pricing file)
INSN$ | INSNxxx file template (Serial Number file)
INPP$ | INPPxxx file template (Promotional Pricing file)
O2$ | Inventory options string

Exit Points | Explanation
EXIT | INCALCPR.PUB does not return any errors.

PCALC$ String Template Definition

The PCALC$ string template is used to pass information to the INCALCPR.PUB program. The fields in the template are defined in the following table. If INCALCPR.PUB is CALLed with PCALC$ set to “”, the program will DIMension PCALC$ using the template and EXIT back to the CALLing program.

Field | Type | Len | Description
ITEM$ | C | 20 | Item being sold
SERN$ | C | 35 | If a serial number is specified, the program calculates the price for that serial number; if not, the program calculates a generic item price
LOCA$ | C | 6 | Item location ID for the sale
PRID$ | C | 6 | Price ID to be used in the calculation
CUST$ | C | 6 | Customer ID (optional)
CLVL$ | C | 6 | Customer Level
UNIT$ | C | 5 | Unit of measure for the sale
SQTY | B | 8 | Quantity to be sold
SDAT | N | 7 | Date of the sale
PROMO | C | 6 | Returns the promotional price ID used in the calculation
UPRC | B | 8 | Returns the unit price of the item
EPRC | B | 8 | Returns the extended price of the item
OPRC | B | 8 | Returns the item’s unit price without the promotional price applied
MPRC | B | 8 | Returns the minimum price for the item