InsertPORecInfoToF43199

Insert PO Receipt Info to F43199

Major Business Rule

Object Name: B4300200

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

To insert the necessary Purchase Order Ledger (F43199) transactions for the 
Purchase Receipts program.

The Actions include: 1)Receipt 2)Close 3)Cancel 4)Reversal

The Modes include: 1)PO UOM 2)New UOM 3)Primary UOM


Technical Specification


<
Pre>
Edits:
If GENLNG is NULL or zero, return.

/* Retrieve next status from Order Activity Rules.  */

                                                 

MOVE OrderType    FSDCTO            

MOVE PONextStatus    FSTRTY            

MOVE LineType    FSLNTY            

VerifyActivityRuleStatusCode

IFFSWRTH  Not =  'Y'      OR     Record not found, then exit program without an error.   


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


/*  Move subfile fields to PO Ledger fields.  */         

                                                    

MOVEBranch     OLMCU               

MOVELocation    OLLOCN              

MOVELot    OLLOTN              

MOVESubledgerOLSBL               

MOVESubledger Type   OLSBLT              

MOVELanded Cost RuleOLPDP5              

MOVEAsset ID    OLASID

MOVETax Rate/AreaOLTXA1*** 968601

MOVETax Explanation CodeOLEXR1*** 968601

MOVEQuantity OrderedOLUORG*** 968601

MOVEG/L DateOLDGL*** 968601


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


/*  Load fields if line has been selected for receipt.  */

                                                     


IFAction  =  '1'ORAction  =  '2'

                                                     

     MOVE '1'       Close  (internal variable)

IF   Mode  =  '1'           

                                 

IF Receipt Routing =  '1'   AND Quantity Column to Update  not = 'PQOH' 

MOVE PO Next Status    OLLTTR  

          MOVE PO Next Status PO Last Status 

          MOVE Receipt Status OLNXTR  

          MOVE Receipt Status PO Next Status 

          MOVE '0'   Close 

                                 

          ELSE                   

                                 

IF       PO Open Amount = 0AND PO Primary Quantity Ordered = 0            

   OR   PO Open Quantity = 0AND PO Primary Quantity Ordered  not = 0            


MOVE PO Next Status    OLLTTR  

          MOVE PO Next Status PO Last Status 

          MOVE Close Status OLNXTR  

          MOVE Close Status PO Next Status 

ELSE                      

                                    

IF   Receipt Status  Not =  '   'ANDAction  = '1'              

MOVE PO Next Status    OLLTTR  

          MOVE PO Next Status PO Last Status 

          MOVE Receipt Status OLNXTR  

          MOVE Receipt Status PO Next Status 

END                       

          END                       

          END                       

          END                       


IF    Received UOM  =  PO UOM

   OR  Received UOM  not =  PO UOM   ANDMode = '2'

                MOVEUnit Cost    OLPRRC          

                MOVEQuantity Received    OLUREC          

MOVEAmount Received    OLAREC          

MOVEForeign Amount Received    OLFREC          

MOVEForeign Unit Cost    OLFRRC          

MOVEForeign Amount Received    OLFEA          

MOVEAmount Received    OLECST          

MOVEUnit Cost    OLAMC3          

MOVEForeign Amount Received   OLFEC          

MOVEForeign Unit Cost    OLFUC          

END                            

     
                                          
InsertPurchaseLedger                           

END                             


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                                                 

/*  Load fields if balance of line has been closed.   */

                                                 


IFAction  =  '2'

                                                 

       IF  PO Open Quantity   not = 0  ORPO Open Amount   not = 0                     

                                                 

/*  If not in receipts routing, close line.   */      

                                                 

       IF   Close  = '1'                        

MOVE PO Next Status    OLLTTR  

          MOVE PO Next Status PO Last Status 

          MOVE Close Status OLNXTR  

          MOVE Close Status PO Next Status 

END                             

                                                 

MOVEUnit Cost    OLPRRC          

           MOVEPO Open Quantity OLUREC          

MOVEPO Open Amount OLAREC          

MOVEForeign Amount Received    OLFREC          

MOVE0    OLUOPN          

MOVE0    OLAOPN          

MOVE0    OLFAP          

MOVEForeign Unit Cost    OLFRRC          

MOVEForeign Amount Received OLFEA          

MOVEAmount Received    OLECST          

MOVEUnit Cost    OLAMC3          

MOVEForeign Amount Received    OLFEC          

MOVEForeign Unit Cost    OLFUC          


InsertPurchaseLedger                           

END                               

END  

                             


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                                                   

/*  Load fields if balance of line has been canceled.   */

                                                   


IFAction  =  '3'

                                                   

MOVE PO Next Status    OLLTTR  

          MOVE PO Next Status PO Last Status 

          MOVE Cancel Status OLNXTR  

          MOVE Cancel Status PO Next Status 


MOVEUnit Cost    OLPRRC          

           MOVE0    OLUREC          

MOVE0    OLAREC          

MOVE0    OLFREC          

MOVEForeign Unit Cost    OLFRRC          

MOVEForeign Amount Received    OLFEA          

MOVEAmount Received    OLECST          

MOVEUnit Cost    OLAMC3          

MOVEForeign Amount Received    OLFEC          

MOVEForeign Unit Cost    OLFUC          


InsertPurchaseLedger                           


END                            


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                                                

/*  Load fields if line has been reversed.   */      

                                                


IFAction  =  '4'

                                                

MOVEUnit Cost    OLPRRC          

              MOVEQuantity Received    OLUREC          

MOVEAmount Received    OLAREC          

MOVEForeign Amount Received    OLFREC          

MOVEForeign Unit Cost    OLFRRC          

MOVEForeign Amount ReceivedOLFEA          

MOVEAmount Received    OLECST          

MOVEUnit Cost    OLAMC3          

MOVEForeign Amount Received    OLFEC          

MOVEForeign Unit Cost    OLFUC          


InsertPurchaseLedger                           

END


Retrievals:

Use GENLNG to access F43199 information.


Data Structure

D4300200 - Insert PO Receipt Info to F43199

Parameter NameData ItemData TypeReq/OptI/O/Both
idF43199PointerGENLNGIDNONENONE

General purpose ID variable.

szOrderTypeDCTOcharNONENONE

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

szPOLastStatusLTTRcharNONENONE

A code (system 40/type AT) specifying the last step in the processing cycle that this order line has successfully completed.

szPONextStatusNXTRcharNONENONE

A user defined code (system 40/type AT) indicating the next step in the order flow of the line type.

szLineTypeLNTYcharNONENONE

A code that controls how the system processes lines on a transaction. It controls the systems with which the transaction interfaces, such as 
General Ledger, Job Cost, Accounts Payable, Accounts Receivable, and Inventory Management. It also specifies the conditions under 
which a line prints on reports, and it is included in calculations. Codes include the following: S Stock item   J Job cost   N Nonstock item   F Freight  
T Text information   M Miscellaneous charges and credits   W Work order

cActionEV01charNONENONE

Special Input Expected
1 = Receipt 

2 = Close 

3 = Cancel 

4 = Reversal


^

cModeEV01charNONENONE

Special Input Expected
1 = PO UOM 

2 = New UOM 

3 = Primary UOM)



^

cReceiptRoutingEV01charNONENONE

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

szQuantityColumnToUpdateUPIBcharNONENONE

Indicates which quantity field in the Item Location table that the system updates when quantity is moved from one receipt routing operation 
to another. Valid values:        QTTR - Quantity in Transit         QTIN - Quantity in Inspection         QTO1 - Quantity in User-defined Operation 1         
QTO2 - Quantity in User-defined Operation 2        PQOH - Quantity on Hand PREQ - Quantity on Purchase Order

szReceiptStatusNXTRcharNONENONE

A user defined code (system 40/type AT) indicating the next step in the order flow of the line type.

szCloseStatusNXTRcharNONENONE

A user defined code (system 40/type AT) indicating the next step in the order flow of the line type.

szCancelStatusNXTRcharNONENONE

A user defined code (system 40/type AT) indicating the next step in the order flow of the line type.

szBranchMCUcharNONENONE

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.

szLotLOTNcharNONENONE

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

szSubledgerSBLcharNONENONE

A code that identifies a detailed, auxiliary account within a general ledger account. A subledger can be an equipment item number or an 
address book number. If you enter a subledger, you must also specify the subledger type.

cSubledgerTypeSBLTcharNONENONE

A user defined code (00/ST) that is used with the Subledger field to identify the subledger type and how the system performs subledger 
editing. On the User Defined Codes form, the second line of the description controls how the system performs editing. This is either hard-coded 
or user defined. Valid values include: A Alphanumeric field, do not edit   N Numeric field, right justify and zero fill   C Alphanumeric field, right 
justify and blank fill  

szLandedCostRulePRP5charNONENONE

A user defined code (41/P5) that indicates the landed cost rule for an item. The landed cost rule determines purchasing costs that exceed 
the actual price of an item, such as broker fees or commissions. You set up landed cost rules on the Landed Cost Revisions form.

szAssetIDASIDcharNONENONE

A 25-character alphanumeric number that you can use as an alternate asset identification number. You might use this number to track 
assets by the manufacturer's serial number. You are not required to use a serial number to identify an asset. Every serial number that you enter 
must be unique.

szPOUOMUOMcharNONENONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

szReceivedUOMUOMcharNONENONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

mnQuantityReceivedURECMATH_NUMERICNONENONE

The original quantity of the order line, plus or minus any changes to that quantity, less all quantities shipped, received and/or vouchered to 
date. This number can also be the actual quantity received.

mnPOOpenQuantityUOPNMATH_NUMERICNONENONE

The original quantity for the order detail line, plus or minus any changes to that quantity, minus all quantities shipped, received, and 
vouchered to date.

mnPOPrimaryQuantityOrderedPQORMATH_NUMERICNONENONE

The quantity ordered by the customer expressed in the primary stocking unit of measure.

mnUnitCostPRRCMATH_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.

mnAmountReceivedARECMATH_NUMERICNONENONE

The value of the goods received to date against the original order line.

mnAmountOpenAOPNMATH_NUMERICNONENONE

The amount of the order, invoice, or voucher that is still unpaid or open. When you enter a document (for example, an order, invoice, or 
voucher), the open amount is the original amount of that document. If you change the original amount, the open amount is reduced by the net 
change. For example,payments, shipments, or receipts against a document result in a reduction of the open balance.

mnForeignUnitCostFRRCMATH_NUMERICNONENONE

The foreign unit cost for this item, as purchased directly from the supplier,excluding freight, taxes, discounts and other factors which might 
serve to modify the actual unit cost we record at the time of physical receipt of goods.

mnForeignAmountReceivedFAPMATH_NUMERICNONENONE

The unpaid foreign amount of a transaction.

szTaxRateAreaTXA1charNONENONE

A code that identifies a tax or geographic area that has common tax rates and tax authorities. The system validates the code you enter 
against the Tax Areas table (F4008). The system uses the tax rate area in conjunction with the tax explanation code and tax rules to calculate tax 
and G/L distribution amounts when you create an invoice or voucher.

szTaxExplanationCodeEXR1charNONENONE

A hard-coded user defined code (00/EX) that controls the algorithm that the system uses to calculate tax and G/L distribution amounts. The 
system uses the tax explanation code in conjunction with the tax rate area and tax rules to determine how the tax is calculated. Each 
transaction pay item can be defined with a different tax explanation code.

mnUnitsTransactionQtyUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

jdGLDateForVoucherDGLJDEDATENONENONE

A date that identifies the financial period to which the transaction is to be posted.  The company constants specify the date range for each 
financial period. You can have as many as 14 periods. Generally, period 14 is used for audit adjustments. The system validates this field for 
PBCO (posted before cutoff), PYEB (prior year ending balance), PACO (post after cutoff), and WACO (post way after cutoff) messages.

Related Functions

B4000260 Line Type - Activity Rules
B9800100 Get Audit Information
X43199 Insert Purchase Ledger

Related Tables

F43199 P.O. Detail Ledger File - Flexible Version