MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Distribution > Order Processing > Programs > Pricing/Discount - Purpose > Pricing/Discount - Calculations

Pricing/Discount - Calculations

PRICNG

A.   The program performs three main functions, depending on the Process Mode:

P:   Retrieve base price for line, Retrieve line discount percentage and/or amount, Calculate discount amounts for line.

H:   Validate Header discount code, Retrieve header discount percentage.

VH:  Retrieve and validate volume discount code, Calculate volume discount percentage.

1.   Process Mode P:  Retrieve base price for line, Retrieve line discount percentage and/or amount, Calculate discount amounts for line.

a.   Retrieve base price for line, calculate unit price and extended price.  See section 'B' of the calculations for a more detailed description.

b.   Retrieve line discount code, percentage and/or amount.  The line discount templates are searched based on Reference File category G86 (Template Priority) for a valid line discount code.  The four user defined pricing fields (two from the customer and two from the Part Master) are used in the retrieval.  If no line discount is found using templates, or if no templates are used, then an attempt to retrieve a line discount code just using the four pricing user defined fields is made.  If a line discount is found the discount percentage or amount is retrieved.

c.   Execute routine which will calculate all of the discount amounts for the line.  There are a total of 9 discounts possible for the line:  Contract Discount, Customer Discount, Line Discount, Header Discount 1-5, and Volume Discount.  This subroutine uses Reference File category G95 (Discount Hierarchy) for these calculations.

2.   Process Mode H:  Retrieve and Validate Header discount code, Retrieve header discount percentage.

Retrieve and validate the Header Discount and retrieve the Header Discount Percentage.  The five Header Discounts must be manually entered.  You may enter a valid Header Discount Template or Discount Code for these values.  If a valid Header Discount Template exists, the Header Discount Code related to the template will be retrieved.  Once the Header Discount Code is found the Discount Percentage is retrieved.

3.   Process Mode VH:  Retrieve and validate volume discount code, Retrieve volume discount percentage.

Retrieve and validate the Volume Discount (VH) Code.  If the Volume Discount Code is defaulted from the customer, it will be validated.  If it is entered it may be a Valid Volume Discount Template or Discount Code.  If a Valid Volume Discount Template exists, the Volume Discount Code related to the template will be retrieved.  If the Discount Code is not defaulted from the customer or has not been entered then the Volume Discount Templates are searched based on Reference File category G86 (Template Priority) for a Valid Volume Discount Code.  The Volume Discount percentage is determined based on the Total Order Volume, Total Order Units, Total Order Weight or Total Order Sales.  Once this is determined, the total for the order is checked against the ten Quantity/Sales breaks on the Volume Discount to determine what the percentage will be.

B.   Detailed Processing for Process Mode P, point 'a'.

1.   If the Price Unit of Measure has not been entered, the Price Unit of Measure and its corresponding conversion factors are taken from the warehouse balance record for the part.  If the Price Unit of Measure is entered, then conversion factors passed to the program will be used.

2.   The Order Quantity passed to this subroutine is converted to pricing units.

3.   The Line Price Code is determined:

a.   If the Unit Price has changed and it is not zero, the Line Price Code is set to manual pricing (unless it is already manual, sample, or no charge).

b.   If the Price Unit of Measure has changed and it is not blank, the Line Price Code is set to manual pricing (unless it is already manual, sample, or no charge).

c.   If the Extended Price has changed and it is not blank, the Line Price Code is set to manual pricing (unless it is already manual, sample, or no charge).

d.   If a Line Price Code has not been entered or is automatic pricing, it checks the Contract Price file first.  (Note that contract pricing cannot be used for bundled parts; if the part has a bundles part type, the contract price is not retrieved.)  If it cannot find a contract price record it attempts to find a price list record.  This is either by using the customer default price list or price list template retrieval.  If a price list is not found, or the part is not found on the price list,  defaults to the Customer Price Code on the sales order header record. 

e.   If the Line Price Code is not manual, sample, no charge, contract, or price list, and the Item Price Code from the Warehouse Balance file is manual pricing, the Line Price Code is set to manual pricing.

4.   If the Line Price Code is equal to blanks or 9, Contract Pricing is performed as follows.  Note that the discount is not calculated for bundled parts.

a.   The Unit Price is calculated as:

Base Price = Contract Price

Unit Price = Base Price minus nine discount amounts (Header Discount Amounts 1-5, Customer Discount Amount, Contract Discount Amount, Line Discount Amount, and Volume Discount Amount)

or

Base Price = Price List Base Price or Warehouse Balance Base Price

Unit Price = Base Price (1 - Contract Price Discount)

b.   The Extended Price is calculated as:

Order Quantity (in pricing units) times Unit Price

5.   If the Line Price Code is equal to A, price list pricing is performed as follows.  Note that bundles cannot use price list pricing.  Price list pricing is done if price list prices are found.  The Base Price is retrieved from the Price List Detail file depending on the Pricing Date.  The Price Effectivity Date must be less than or equal to the order line pricing date.  Price List Quantity Breaks are checked

a.   If the Price Break is defined as a Price, the Base Price is set to the Appropriate Quantity Break Price from the price list.

b.   If the Price Break is defined as a Discount:

Base Price = Price List Base Price times (1 minus Price Quantity Break Discounts)

c.   Set the required apply discount flag from the price list if you have not already done so.

6.   If the Line Pricing Code is automatic pricing (no forced price)and the contract and price list prices are not found, warehouse balance automatic pricing is performed:

a.   If the Item Price Code is base price, or if the Order Quantity (in pricing units) is less than the first Quantity Break, standard pricing is performed:

(1)  The Base Price is taken from the Warehouse Balance file.

(2)  The Price Unit of Measure and its corresponding conversion factors are taken from the warehouse balance record for the item.

b.   If the Item Price Code is not base price (and the part type is not bundled), each Order Quantity (in pricing units) is compared to the Quantity Breaks, and the appropriate Quantity Break Price or Discount is taken:

(1)  If the Item Price Code is quantity break price:

(a)  The Base Price is set to the appropriate Quantity Break Price.

(2)  If the Item Price Code is a quantity break discount:

(a)  Base Price = Item Base Price times (1 minus Quantity Break Discount).

(3)  The Price Unit of Measure and its corresponding conversion factors are taken from the warehouse balance record for the item.

7.   If the Line Part Price Code is not automatic pricing, forced pricing is performed as specified below.  Note that none of the nine discounts are applied if the part type is bundled.

                                    Quantity break pricing or
a.     If the Line                    Quantity percent discount
        Price Code is  performed using:

                     1             Price/Discount 1

                     2             Price/Discount 2

                     3             Price/Discount 3

                     4             Price/Discount 4

                     5             Price/Discount 5

(1)  If the Item Price Code is quantity break price or standard pricing:

(a)  The Base Price is set to the appropriate Quantity Break Price.

(2)  If the Item Price Code is a quantity break discount:

(a)  Base Price = Item Base Price times (1 minus Quantity Break Discount).

(3)  The Price Unit of Measure and its corresponding conversion factors are taken from the warehouse balance record for the item.

8.   Calculate the discount amounts.  Discount amounts are calculated depending on the Discount Hierarchy (Reference File category G95),  contract discount, customer discount, header discount amount (1-5), line discount amount and volume discount amounts are calculated.  These discount amounts are calculated and will be used to retrieve and calculate the unit price.  Discount cascading will be done depending on the Reference File category G95.

9.   The Unit Price is calculated as:

Base Price minus nine discount amounts (header 1-5, customer discount amount, contract discount amount, line discount amount and volume discount amount).

10.  The Extended Price is calculated as:

Unit Price times Order Quantity (in pricing units).

11.  If the Line Price Code is manual, sample, or no charge:

(1)  If the Extended Price has been entered and is not zero, and if the Unit Price has not been entered, and if the Order Quantity is not zero:

(a)  The Unit Price is calculated as:

Extended Price divided by Order Quantity (in pricing units).

(b)  The Base Price is set to the Unit Price.

(2)  If the Order Quantity and Unit Price are not zero:

(a)  Base Price is set to the entered Unit Price.

(b)  Unit Price = Base Price minus nine discount amounts (Header Discount Amounts 1-5, Customer Discount Amount, Contract Discount Amount, Line Discount Amount, and Volume Discount Amount)

(c)  The Extended Price is calculated as:

Unit Price times Order Quantity (in pricing units).

(d)  If the Extended Price calculated above is not equal to the Extended Price entered, a warning message is written, and the Extended Price is set to the Extended Price as calculated in step (2c).

(3)  If the Order Quantity is not zero and the Unit Price is zero:

(a)  The Base Price is calculated as:

Extended Price divided by Order Quantity.

(b)  The Unit Price is set to the Base Price.

(4)  If the Order Quantity is zero (Reference Parts):

(a)  If the Extended Price has been entered, the Base Price and Unit Price are set to the extended price.

(b)  If the Extended Price has not been entered, the Extended Price is calculated as:

Base Price minus nine discount amounts (Header Discount Amounts 1-5, Customer Discount Amount, Contract Discount Amount, Line Discount Amount, and Volume Discount Amount).

(c)  The Unit Price is calculated as:

Base Price minus nine discount amounts (Header Discount Amounts 1-5, Customer Discount Amount, Contract Discount Amount, Line Discount Amount, and Volume Discount Amount).

12.  The Base Price, Unit Price, and Extended Price and Discount Amounts are converted to appropriate currency:

a.   If the Line Price Code is manual, sample, no charge, or price list price, then the prices were entered in foreign currency; they are therefore converted to base currency.  If the line price code is a contract discount and the base prices are retrieved from the price list price, then those prices are also retrieved in foreign currency, and as a consequence they are converted to base currency.

b.   If the Line Price Code is zero through 5, then the prices were calculated using base currency; they are therefore converted to foreign currency.  If the line price code is a contract discount and the price list prices are not used in the contract, then those prices are retrieved in base currency, and as a consequence they are converted to foreign currency.

c.   The Change in Extended Price is calculated as the New Extended Price less the Old Extended Price.

d.   The Change in Discount Amount is calculated as the New Discount Amount less the Old Discount Amounts.

13.  Exception flags and warning messages are set:

a.   If manual pricing was used (manual, sample, or no charge):

(1)  The header and line price exception flags are set to yes.

(2)  The manual price exception flag is set to yes.

(3)  A warning message is written.

b.   If the Unit Price and the Extended price are both zero:

(1)  The header and line price exception flags are set to yes.

(2)  The no-price exception flag is set to yes.

(3)  A warning message is written.

c.   If the Extended Price for a line is zero (in OP120E), the Line Price exception flag is set to Y (Yes) to indicate line amount shipped at zero price.

d.   If manual pricing was not used, the manual price exception flag is set to no.

e.   If the Unit Price and the Extended Price are both non-zero, the no-price exception flag is set to no.

f.    If Price List Pricing was attempted but Warehouse Balance Pricing was used, (in a valid price list or a part not found on a price list), the Price List Pricing Exception Flag is set to 'Yes'.

PRICNG Program Menu