VerifyQuantityCostExtended

Verify Quantity Cost Extended

Minor Business Rule

Object Name: B4100030

Parent DLL: COPBASE

Location: Client/Server

Language: C

1.Functional Description
1.1Purpose
To validate the cost, quantity, extended amount combination for a transaction.  If all three are entered, make sure that it is a valid combination.  If any 
one is missing, issue an error if necessary or calculate the third field.  If the cost is blank and a quantity is entered, the cost will be retrieved from the 

F4105.  The cost entered will be converted to primary unit of measure for later functions.


1.2Setup Notes and Prerequisites

• The PRRC field will return the PRIMARY unit cost to be used for later functions.

1.3Special Logic

Will need to convert the unit cost to primary unit of measure and return in PRRC fields.

2.Technical Specifications


2.1Parameters:

Data Item Data Structure DescriptionI/ORequiredNotes
TRQTTransaction QuantityBYes

UNCSTransaction Unit CostBYes

PAIDExtended CostBYes

PRRCPrimary Unit CostONo

QAVALPrimary Transaction QtyONo

CONVConv  Factor Qty to PrimaryIY

CONVConv Factor Price to PrimaryIY

CRYRCurrency ControlIN

FCSTRForeign Unit CostIN

FOPNRForeign Extended CostIN

QTYQty Converted to PrimaryIN


2.4Processing 

The following edits will be performed.

*One of the three fields (transaction quantity, unit cost, extended cost) must be entered.  If not, issue error '0003'.

*If only the unit cost is entered, issue error '0003'.

*If cost and extended are entered, but no quantity, issue error '0003'.

*If the quantity and extended cost fields have opposite signs, issue error '0252'.

*If cost and quantity are entered,but extended is zero,  calculate the extended


   If Extended Amount = 0, and Quantity & Unit Cost are not 0:

   Extended Amount = 

(Unit Cost  /  Conv Factor Price to Primary)  * Primary Quantity)


   If Currency Control not = ' ' and Currency Control not ='N'

      If Foreign Extended Amount = 0, and Quantity & Foreign Unit Cost are not 0:


    Foreign  Extended Amount = 

 ((Foreign Unit Cost  /  Conv Factor Price to Primary)  * Primary Quantity)


*If quantity and extended are entered, but cost is zero,  calculate the cost


 If Unit Cost = 0, and Quantity & Extended Amount are not 0:

Unit Cost = 

   (((Extended Amount  /  Quantity)  /  Conv Factor Quantity to Primary)  * 

     Conv Fact Price to Primary)


   If Currency Control not = ' ' and Currency Control not ='N'

      If Foreign Unit Cost = 0, and Quantity & Foreign Ext Amount are not 0:


Foreign Unit Cost = 

      (((Foreign Ext Amount  /  Quantity)  /  Conv Factor Quantity to Primary)  *     Conv 

Fact Price to Primary


*If all three fields are entered, make sure they balance 


Check the following:


((Unit Cost  /  Conv Factor Qty to Primary)  * Primary Quantity)  =  Extended Amount


If not successful, check

    (((Extended Amount  /  Primary Quantity)  =  (Unit Cost / Conv Fact Qty to Primary)

  

   If not successful, issue error message 0252, and highlight the Extended Amount.

// Calculate Primary Unit Cost


Divide Transaction Unit Cost by Conv Factor Qty to Primary resulting in Primary Unit Cost





^

Data Structure

D4100030 - Verify Quantity Cost Extended

Parameters:
Data Item Data Structure DescriptionI/ORequired
TRQTTransaction QuantityBYes

UNCSTransaction Unit CostBYes

PAIDExtended CostBYes

PRRCPrimary Unit CostONo

QAVALPrimary Transaction QtyONo

CONVConv  Factor Qty to PrimaryIY

CONVConv Factor Price to PrimaryIY

CRYRCurrency ControlIN

FCSTRForeign Unit CostIN

FOPNRForeign Extended CostIN

QTYQty Converted to PrimaryIN


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnTransactionQuantityTRQTMATH_NUMERICNONENONE

A value that represents the available quantity, which might consist of the on-hand balance minus commitments, reservations, and 
backorders. You enter this value in the Branch/Plant Constants program (P41001).

mnTransactionUnitCostUNCSMATH_NUMERICNONENONE

The amount per unit, derived by dividing the total cost by the unit quantity.

mnExtendedCostPAIDMATH_NUMERICNONENONE

The extended cost or price value of an inventory transaction for an inventory item.

mnPrimaryUnitCostPRRCMATH_NUMERICNONENONE

The unit cost of one item, as purchased from the supplier, excluding freight,taxes, discounts, and other factors that might modify the actual 
unit cost you record when you receive the item.

mnConversionFactorFromToPrimryCONVMATH_NUMERICNONENONE

The factor that the system uses to convert one unit of measure to another unit of measure.

mnConversionFactorPriceToPrimCONVMATH_NUMERICNONENONE

The factor that the system uses to convert one unit of measure to another unit of measure.

cCurrencyControlCRYRcharNONENONE

A code that specifies whether to use multi-currency accounting, and the method of multi-currency accounting to use: Codes are:    N Do not 
use multi-currency accounting. Use if you enter transactions in only one currency for all companies. The multi-currency fields will not appear 
on forms. The system supplies a value of N if you do not enter a value.    Y Activate multi-currency accounting and use multipliers to convert 
currency. The system multiplies the foreign amount by the exchange rate to calculate the domestic amount.    Z Activate multi-currency 
accounting and use divisors to convert currency. The system divides the foreign amount by the exchange rate to calculate the domestic amount.

mnForeignUnitCostFCSTRMATH_NUMERICNONENONE

mnForeignExtendedCostFOPNRMATH_NUMERICNONENONE

mnPrimaryTransactionQuantityQAVALMATH_NUMERICNONENONE

A number that indicates the quantity that is available. For example, the available quantity might consist of the on-hand quantity minus 
commitments, reservations, and backorders.  Availability is user defined. You can set up availability in the Branch/Plant Constants program (P41001).  

mnQuantityConvertedToPrimaryQTYMATH_NUMERICNONENONE

The number of units associated with an asset.

Related Functions

None

Related Tables

None