F41291CalcLandedCostBeginDoc

Landed Cost Selection

Master Business Function

Object Name: N4300970

Parent DLL: CDIST

Location: Client/Server

Language: NER

Data Structure

D4300970 - Landed Cost Selection

Parameter NameData ItemData TypeReq/OptI/O/Both
cModeProcessingMODEcharNONENONE

The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.

mnOrderNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

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

szCompanyKeyOrderNoKCOOcharNONENONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

jdDtForGlAndVouchDGLJDEDATENONENONE

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.

mnBatchNumberICUMATH_NUMERICNONENONE

A number that identifies a group of transactions that the system processes and balances as a unit. When you enter a batch, you can either 
assign a batch number or let the system assign it using the Next Numbers program.

szBatchTypeICUTcharNONENONE

A code that specifies the system and type of transactions entered in a batch. The system assigns the value when you enter a transaction. 
Valid values are set up in user defined code table 98/IT. You cannot assign new values. All batch types are hard coded.

szDocOrderTypeDCTcharNONENONE

A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
types, such as, vouchers, invoices, receipts, and timesheets. The reserved document type prefixes for codes are: P Accounts payable 
documents R Accounts receivable documents  T Time and Pay documents I Inventory documents  O Purchase order documents  S Sales order 
documents 

cCurrencyModeCRRMcharNONENONE

An option that specifies whether the system displays amounts in the domestic or foreign currency. On  The system displays amounts in the 
foreign currency of the transaction. Off  The system displays amounts in the domestic currency of the transaction.

cGlSummaryFlagSUMcharNONENONE

A Y indicates the summation or total of a field is to be computed.

szCurrencycodeCRCDcharNONENONE

A code that identifies the currency of a transaction. 

mnJobnumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnDocumentReceiptDOCMATH_NUMERICNONENONE

A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
number or let the system assign it using the Next Numbers program (P0002). Matching document numbers (DOCM) identify related documents 
in the Accounts Receivable and Accounts Payable systems. Examples of original and matching documents are: Accounts Payable     o 
Original document - voucher     o Matching document - payment  Accounts Receivable     o Original document - invoice     o Matching document - 
receipt  Note: In the Accounts Receivable system, the following transactions simultaneously generate original and matching documents: 
deductions, unapplied receipts, chargebacks, and drafts.

mnGLLinenumberJELNMATH_NUMERICNONENONE

A number that designates a line within a journal entry. The system uses this field to sequence the journal entry lines for inquiry purposes.

szDocCompanyKeyKCOcharNONENONE

A number that, with the document number, document type and G/L date, uniquely identifies an original document, such as invoice, voucher, 
or journal entry. If you use the Next Numbers by Company/Fiscal Year feature, the Automatic Next Numbers program (X0010) uses the 
document company to retrieve the correct next number for that company. If two or more original documents have the same document number and 
document type, you can use the document company to locate the desired document.

mnLandedCostJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnReceiptJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharNONENONE

mnLineNumberLNIDMATH_NUMERICNONENONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

mnNoOfLinesNLINMATH_NUMERICOPTNONE

A number representing the number of lines on either a purchase or sales order. or The number of receivers recorded during the receipts 
process.  This field will be used in Voucher Matching.

szOrderSuffixSFXOcharOPTNONE

In the A/R and A/P systems, a code that corresponds to the pay item. In the Sales Order and Procurement systems, this code identifies 
multiple transactions for an original order. For purchase orders, the code is always 000. For sales orders with multiple partial receipts against an 
order, the first receiver used to record receipt has a suffix of 000, the next has a suffix of 001, the next 002, and so on.

szVersionVERScharOPTNONE

A user-defined set of specifications that control how applications and reports run. You use versions to group and save a set of user-defined 
processing option values and data selection and sequencing options. Interactive versions are associated with applications (usually as a 
menu selection). Batch versions are associated with batch jobs or reports. To run a batch process, you must choose a version.

cDataFieldErrorCode1ERR1charOPTNONE

cLandedCostSelectionEV01charOPTNONE

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

Related Functions

None

Related Tables

F4311 Purchase Order Detail File
F41291CalcLandedCostEditDoc

F41291CalcLandedCostEditDoc

Landed Cost Selection

Master Business Function

Object Name: N4300970

Parent DLL: CDIST

Location: Client/Server

Language: NER

Functional Description

Purpose

The purpose of this business function is to run the G/L edits and verify cost and extended cost 

balance


Setup Notes and Prerequisites

The F41291 file only has one amount.  That amount is either domestic (currency code = blank) or 

foreign (currency code <> blank).  The currency code is not stored in the F41291.


Technical Specification


Initialization:


If the mode is Inquiry, bypass EditDoc.


Read Landed Cost Cache:


DO while records exist


Read cache records:

Read each record in the Landed Cost cache - F41291RetrieveLandedCostCache with Genlng pointer = 

blank and the seq = 1.  


If the record is the original (TYPE = blank), retrieve the Receiver record from the Receiver 
Cache and read the next record.  Pass GENLNG.


If the record is marked as skip (TYPE = 2) then skip this record and read the next record.  
Pass GENLNG.


Cost Edits for landed cost records:

Get Item/Branch record:

Call GetItemBranchGradePotency (B4000750) to retrieve the Potency control (IBOT1P) and the 

Standard Potency (IBSTDP).


Get Conversion factors:

Call Get Item UOM Conversion Factor (B4000520) passing the item, branch, primary uom (pass 

blanks so the BF will retrieve the F4101), and the purchasing uom,  open quantity (UOPN), Potency 

control and Standard Potency.  Need to retrieve the From to Primary, To to primary, quantity in 

primary and price to primary 


If PRRC = 0 and AOPN <> 0, calculate unit cost.  If PRRC <> 0 and AOPN = 0, calculate extended 
cost (CalcRecUnitCostorExtAmtifZero).  


Verify quantity, unit cost and extended cost balance (VerifyRecQtyUnitCstExtAmtBalance)


G/L Edits:


If the Receipt Doc Type  (DCTR) is blank, assign 'OV' to DCTR.

Check if the currency code/exchange rate/base currency code combination already has an 

associated document # (stored) by calling F41291Read/WriteLandedCostJobNumber(B4301050).

Assign the document # and type to the Receipt Doc and Type.

(currency on: we will have a document for every currency code/exchange rate/base 

currency.

  currency off: one document number.)

If currency is off or if currency is on and GL Document Number is zero

Call F011OpenBatch

F0911RetrieveLastAccountLineNumber

F0911BeginDoc

JobNumber(JOBS)<>F0911JobNumber
DocAction(ACTN)<-"A"

EditInstrFlag(EV01)<-"1"

ErrorFlag(EV01)->X

TypeDoc(EV01)<-"J"

ComputerID(CTID)<-ComputerID

LastLineNumber(JELN)<-LastJELine 

CompanyKey(KCO)<>int_DocCompany

DocumentType(DCT)<>PO_ReceiptDocType

DocNumber(DOC)<>ReceiptDoc

GLDate(DGJ)<-GLDate

LedgerType(LT)<>X

BatchNumber(ICU)<-BatchNumber

BatchType(ICUT)<-BatchType

BatchDate(DICJ)<-BatchDate

BatchSystemDate(DSYJ)<>X

BatchTime(TICU)<>X

TransCurrency(CRCD)<-Supplier currency

CurrencyRate(CRR)<-ExchangeRate

Explanation(EXA)<-SupplierName

Reference1(EXA)<-X

HomeBusinessUnit(HMCU)<-X

InvoiceNumber(VINV)<-X

InvoiceDate(IVD)<-X

ReverseVoid(RE)<-" "

AddressNumber(AN8)<-Supplier

HistoricalDate(HDGJ)<-X

HistoricalRate(HCRR)<-X

CurrencyMode(CRRM)<-CurrencyMode 

BaseCoCurrency(CRDC)<-DomesticCurrencyCode

MultiCurrInterCo(EV01)<>X

AmtToDistribute(ATAD)<-X

FAmtToDistribute(CTAD)<-X

CurrencyFlag(CRYR)<-CurrencyProcessingFlag

OPDefLedgerType(LT)<-X

OPTolerance(MATH06)<-X

HeaderChgFlag(EV02)<-X

End F0911BeginDoc
If currency is on
Retain all document #s and the currency code/exchange rate they applied to a cache. 
Call F41291WriteLandedCostDocuments (B4301050)

else 
load the BFJobNumber with the GL Job Number
endif

Endif
 


Retrieve Distribution AAIs (DEBIT):

Call B4000350 to retrieve the Distribution AAIs for Table # 4385.

AAI Table # (ANUM)

Company (CO) 

Document type (DCTO)

G/L Category (GLC)



Edit G/L:

Call F0911EditLine
JobNumber(JOBS)<>F0911JobNumber

ComputerID(CTID)<-ComputerID

LineAction(ACTN)<-"A"

ProcessingMode(EV01)<-"1"

EditFlag(EV01)<-"1"

ErrorFlag(EV01)->X

RecordWrittenFlag(EV01)<>"0"

TypeDoc(EV01)<-"J"

LineNumber(JELN)<>int_AccountJE

Amount(AA)<-int_GLDAmount

AccountNumber(ANI)<-int_GLAcct

AccountID(AID)->X

BusinessUnit(MCU)->X

Object(OBJ)->X

Subsidiary(SUB)->X

AccountMode(AM)<-"2"

FiscalYear(FY)->X

PeriodNumber(PN)->X

Century(CTRY)->X

Subledger(SBL)<-Subledger

SubledgerType(SBLT)<-SubledgerType

Units(U)<-int_GLUnits

UnitOfMeasure(UM)<-ReceiptUOM

ServiceDate(DSVJ)<-X

LineExtension(EXTL)<-X

AssetID(ASID)<-X

PostedCode(POST)<-X

Explanation(EXR)<-int_GLRemark  

Reference2(R2)<-X

PayItem(SFX)<-X

BillCode(BC)<-X

DoiSub(DOI)<-X

WorkOrder01(WO01)<-X

OutsdLeaseWellID(ALID)<-X

OrderType(DCTO)<-X

LineID(LNID)<-LineNumber

PODocType(PDCT)<-OrderType

POKeyCompany(PKCO)<-OrderKeyCompany

PurchaseOrder(PO)<-OrderNumber

POSuffix(PSFX)<-OrderSuffix

1099Flag(TNN)<-X

CurrencyAmount(ACR)<-int_GLFAmount 

ForeignTaxAmount(CTAM)<-X(*FUTURE*)

ForeignTaxableAmt(CTXA)<-X(*FUTURE*)

TaxAmount(STAM)<-X(*FUTURE*)

AmountTaxable(ATXA)<-X(*FUTURE*)

CurrencyFlag(CRYR)<-CurrencyProcessingFlag

Company(CO)->int_AAICO

OPTolerance(MATH06)<-X

CheckDate(DKJ)<-X

DisplayKeyCompany(KCO)->X

DisplayBaseCoCurr(CRDC)->X

DisplayTransCurr(CRCD)->X

DisplayExchgRate(CRR)->X

DisplayCurrMode(CRRM)->X

LastLineNo(JELN)->LastJELine

OriginalAmount(AA)<-X(**FUTURE**)

OriginalFAmount(ACR)<-X(**FUTURE**)

GLPostCodeAlt001(ALT1)<-X

GLPostCodeAlt002(ALT2)<-X

GLPostCodeAlt003(ALT3)<-X

GLPostCodeAlt004(ALT4)<-X

GLPostCodeAlt005(ALT5)<-X

GLPostCodeAlt006(ALT6)<-X

CommitReleifFlag(ALT7)<-'N'

BillingControl(ALT8)<-X

GLPostCodeAlt009(ALT9)<-X

GLPostCodeAlt000(ALT0)<-X

GLPostCodeAlt00X(ALTX)<-X

CheckNumber(CN)<-X

DateCheckCleared(DKC)<-X

SummerizedCode(SUMM)<-X

PurgeCode(PRGE)<-X

BatchRearEndPstCd(BRE)<-X

JobCategory(JBCD)<-X

JobStep(JBST)<-X

WeeklyYear(WY)<-X

WeeklyPeriod(WN)<-X

FinalPayment(FNLP)<-X

AssetInputMode(ASM)<-X

SequenceNoOper(OPSQ)<-X

OriginalDocNumber(ODOC)<-X

OriginalKeyCo(OKCO)<-X

ClientFreeForm1(CFF1)<-X

ClientFreeForm2(CFF2)<-X

GLClass(GLC)<-int_GLOffset

DeleteNotAllowed(DNLA)<-X

IdType(ALTY)<-X


End F0911EditLine


Retrieve Distribution AAIs (CREDIT):

Call B4000350 to retrieve the Distribution AAIs for Table # 4390.

AAI Table # (ANUM)

Company (CO) 

Document type (DCTO)

G/L Category (GLC)



Edit G/L:

Call F0911EditLine
JobNumber(JOBS)<>F0911JobNumber

ComputerID(CTID)<-ComputerID

LineAction(ACTN)<-"A"

ProcessingMode(EV01)<-"1"

EditFlag(EV01)<-"1"

ErrorFlag(EV01)->X

RecordWrittenFlag(EV01)<>"0"

TypeDoc(EV01)<-"J"

LineNumber(JELN)<>int_AccountJE

Amount(AA)<-int_GLDAmount

AccountNumber(ANI)<-int_GLAcct

AccountID(AID)->X

BusinessUnit(MCU)->X

Object(OBJ)->X

Subsidiary(SUB)->X

AccountMode(AM)<-"2"

FiscalYear(FY)->X

PeriodNumber(PN)->X

Century(CTRY)->X

Subledger(SBL)<-Subledger

SubledgerType(SBLT)<-SubledgerType

Units(U)<-int_GLUnits

UnitOfMeasure(UM)<-ReceiptUOM

ServiceDate(DSVJ)<-X

LineExtension(EXTL)<-X

AssetID(ASID)<-X

PostedCode(POST)<-X

Explanation(EXR)<-int_GLRemark  

Reference2(R2)<-X

PayItem(SFX)<-X

BillCode(BC)<-X

DoiSub(DOI)<-X

WorkOrder01(WO01)<-X

OutsdLeaseWellID(ALID)<-X

OrderType(DCTO)<-X

LineID(LNID)<-LineNumber

PODocType(PDCT)<-OrderType

POKeyCompany(PKCO)<-OrderKeyCompany

PurchaseOrder(PO)<-OrderNumber

POSuffix(PSFX)<-OrderSuffix

1099Flag(TNN)<-X

CurrencyAmount(ACR)<-int_GLFAmount 

ForeignTaxAmount(CTAM)<-X(*FUTURE*)

ForeignTaxableAmt(CTXA)<-X(*FUTURE*)

TaxAmount(STAM)<-X(*FUTURE*)

AmountTaxable(ATXA)<-X(*FUTURE*)

CurrencyFlag(CRYR)<-CurrencyProcessingFlag

Company(CO)->int_AAICO

OPTolerance(MATH06)<-X

CheckDate(DKJ)<-X

DisplayKeyCompany(KCO)->X

DisplayBaseCoCurr(CRDC)'1a'1a

Data Structure

D4300970 - Landed Cost Selection

Parameter NameData ItemData TypeReq/OptI/O/Both
cModeProcessingMODEcharNONENONE

The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.

mnOrderNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

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

szCompanyKeyOrderNoKCOOcharNONENONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

jdDtForGlAndVouchDGLJDEDATENONENONE

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.

mnBatchNumberICUMATH_NUMERICNONENONE

A number that identifies a group of transactions that the system processes and balances as a unit. When you enter a batch, you can either 
assign a batch number or let the system assign it using the Next Numbers program.

szBatchTypeICUTcharNONENONE

A code that specifies the system and type of transactions entered in a batch. The system assigns the value when you enter a transaction. 
Valid values are set up in user defined code table 98/IT. You cannot assign new values. All batch types are hard coded.

szDocOrderTypeDCTcharNONENONE

A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
types, such as, vouchers, invoices, receipts, and timesheets. The reserved document type prefixes for codes are: P Accounts payable 
documents R Accounts receivable documents  T Time and Pay documents I Inventory documents  O Purchase order documents  S Sales order 
documents 

cCurrencyModeCRRMcharNONENONE

An option that specifies whether the system displays amounts in the domestic or foreign currency. On  The system displays amounts in the 
foreign currency of the transaction. Off  The system displays amounts in the domestic currency of the transaction.

cGlSummaryFlagSUMcharNONENONE

A Y indicates the summation or total of a field is to be computed.

szCurrencycodeCRCDcharNONENONE

A code that identifies the currency of a transaction. 

mnJobnumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnDocumentReceiptDOCMATH_NUMERICNONENONE

A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
number or let the system assign it using the Next Numbers program (P0002). Matching document numbers (DOCM) identify related documents 
in the Accounts Receivable and Accounts Payable systems. Examples of original and matching documents are: Accounts Payable     o 
Original document - voucher     o Matching document - payment  Accounts Receivable     o Original document - invoice     o Matching document - 
receipt  Note: In the Accounts Receivable system, the following transactions simultaneously generate original and matching documents: 
deductions, unapplied receipts, chargebacks, and drafts.

mnGLLinenumberJELNMATH_NUMERICNONENONE

A number that designates a line within a journal entry. The system uses this field to sequence the journal entry lines for inquiry purposes.

szDocCompanyKeyKCOcharNONENONE

A number that, with the document number, document type and G/L date, uniquely identifies an original document, such as invoice, voucher, 
or journal entry. If you use the Next Numbers by Company/Fiscal Year feature, the Automatic Next Numbers program (X0010) uses the 
document company to retrieve the correct next number for that company. If two or more original documents have the same document number and 
document type, you can use the document company to locate the desired document.

mnLandedCostJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnReceiptJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharNONENONE

mnLineNumberLNIDMATH_NUMERICNONENONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

mnNoOfLinesNLINMATH_NUMERICOPTNONE

A number representing the number of lines on either a purchase or sales order. or The number of receivers recorded during the receipts 
process.  This field will be used in Voucher Matching.

szOrderSuffixSFXOcharOPTNONE

In the A/R and A/P systems, a code that corresponds to the pay item. In the Sales Order and Procurement systems, this code identifies 
multiple transactions for an original order. For purchase orders, the code is always 000. For sales orders with multiple partial receipts against an 
order, the first receiver used to record receipt has a suffix of 000, the next has a suffix of 001, the next 002, and so on.

szVersionVERScharOPTNONE

A user-defined set of specifications that control how applications and reports run. You use versions to group and save a set of user-defined 
processing option values and data selection and sequencing options. Interactive versions are associated with applications (usually as a 
menu selection). Batch versions are associated with batch jobs or reports. To run a batch process, you must choose a version.

cDataFieldErrorCode1ERR1charOPTNONE

cLandedCostSelectionEV01charOPTNONE

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

Related Functions

None

Related Tables

F4311 Purchase Order Detail File
F41291CalcLandedCostEndDoc

F41291CalcLandedCostEndDoc

Landed Cost Selection

Master Business Function

Object Name: N4300970

Parent DLL: CDIST

Location: Client/Server

Language: NER

Functional Description

Purpose

The purpose of this business function is to write the GL entries, write new receiver records, update 
the original receiver record, write cardex records and update item costs.


Setup Notes and Prerequisites

This business function will be called from the Landed Cost Selection Window (P43291).

The Landed Cost Cache will be used.


Special Logic




Technical Specification


Initialization:


If there are G/L error or cost errors, skip EndDoc.


Write G/L records:

Do while flag is set to blank:

If currency is on, 

call F41921ReadWriteJobNumber (B4301050 cache action = 4)  (must call F0911EndDoc for 
every job number store in the cache.

else
use job number passed in parameter (F0911EndDoc only called once)

endif

Call F0911SummarizeDocument if parameter GLSUM is a '1'

Call F0911GetNextDocument 

Call F0911EditDoc (should never error, always in balance)

Call F0911EndDoc (for every document #)
JobNumber(JOBS)<-F0911JobNumber

ComputerID(CTID)<-ComputerID

ErrorFlag(EV01)->X

TypeOfDocument(EV01)<-"J"

BatchNumber(ICU)<-BatchNumber

BatchType(ICUT)<-BatchType

PrevBatchStatus(EV01)<-X

BatchStatus(EV01)<-BatchStatus

DocInBalance(EV01)<-X

SupressBatchCtnrl(EV01)<-X

ExitedOnAdd(EV01)<-"0"

OverrideMode(EV01)<-"A"

CurrencyFlag(CRYR)<-CurrencyProcessingFlag

NextNumberIndex(MATH06)<-"07"

NextNumberSysCd(SYS)<-"43  "

DocNumber(DOC)<>ReceiptDocument

ProgramID(PID)<-ProgramID


If (Error Occurred) Then

End Processing

Endif

If currency is on

Write GL Document number to cache (B4301050  cache action = 5)
Read next GL Job Number (B4301050  cache action = 4)

else

processing is done.

endif

End Do while read.


Read Landed Cost Cache (start to finish):

Read the Landed Cost Cache (F41291GetLandedCostCache). 

If the record is the original (TYPE = blank), store in work fields the Line Number and NLIN 
If the record type = 2  then skip record and read next record

Store the Order Number, type, key company, line number and NLIN


Update original receiver record and write cardex when order changes or if currency is on:

When the order number changes, update the original receiver record:
Call GetPurchaseReceiptRow for the original record.
Change Landed Cost (PRLAND) to a '1'
Change Associated Line # (PRALIN) with the first landed cost line # (NLIN of first landed 

cost receiver record.

Update receipt line.

If currency is on, write a cardex record and update costs for each landed cost.  If currency is off, 

write cardex and costs when the order number changes.

Get Item Branch record

Get Item Branch Grade Potency - potency flag

Get Purchase Information from F4102 - margin maintenance flag

Get Item UoM Conversion - convert quantity to primary

Get purchase receipt details  - amount received, lot grade and potency

Free memory

Calculate Costs in primary

Unit Cost in Primary = Include Cost amount / Conversion to primary

Amount Received = Amount Received / Primary Quantity

Amt Unit Cost Last Paid = Amount Received + Unit Cost in Primary

Amount Received = Amt Unit Cost Last Paid * Primary Quantity

Call F4105UpdateCosts

Endif


If currency is on

  Calculate domestic amounts
Endif


If the IncludeInUnitcost flag 'Y'

 accumulate the cost and amount
Endif


Call F43121ZGetReceiverCache

Call GetF4101GetItemMasterInformation

Call GetItemCost

Call GetLineTypeConstants

Call F0401GetPurchsingInstructions

If currency is on

Retrieve the GL document number from the cache (B4301050  cache action = 2)

endif


Write Receiver  records:


Landed Cost Records Load with Original Receipt file.
Match Type (PRMATC) -'1'

Order  # (PRDOCO)-PRDOCO

Order Type (PRDCTO)-PRDCTO

Key Company (PRKCOO)-PRKCOO

Branch (PRMCU)PRMCU

Line # (PRLNID)-Determine last line in F43121 with for Document and add 1.  Store value 

for later use.

# of lines (PRNLIN)-Increment as records are added (original receipt record is 1, so 

first landed cost record would be 2, and so forth).

Address # (PRAN8)-PRAN8

Line Suffix (SFXO)-PRSFXO

Payment Terms (PRPTC)-Retrieve payment term from supplier master (F0401). If no 

supplier master, default to PRPTC.

Item #  (PRITM/LITM/AITM)-PRITM/LITM/AITM

Lot (PRLOTN)-PRLOTN

Location (PRLOCN)-PRLOCN

Request Date (PRDRQJ)-PRDRQJ

Receipt Date (PRRCDJ)-PRRCDJ

Promise Date (PRPDDJ)-PRPDDJ

Original Promise Date (PROPDJ)-PROPDJ

Line Type (PRLNTY)-PRNTY

G/L Class Code (PDGLC)-IGGLPT (if blank, use PRGLC, if PRGLC is blank use LFGLC) see 

step xx

Company (PRCO)-PRCO

Account # (PRAID)-PRAID

Account ID (PRANI)-PRANI

Project Cost Center (PROMCU0-PROMCU

Object (PROBJ)-PROBJ

Subsidiary (PRSUB)-PRSUB

Subledger (PRSBL)-PRSBL from original receipt line

Subledger Type (PRSBLT)-PRSBLT from original receipt line

Currency Code (PRCRCD)-PRCRCD

Exchange Rate  (PRCRR)-PRCRR

Document # (PRDOC_)-Next Number retrieved

Document Type (PRDCT)-'OV' unless passed in parameter

Document company (PRKCO)-

Level Cost (PRLVLA)-IGLVLA

Transaction UOM (PRUOM)-

Purchasing UOM (PRUOM3)-

Taxable (PRTX)-'N'  

Vendor Remark (PRVRMK)-Description from UDC for Cost Level (IGLVLA) (already in cache)

Landed Cost Code (PRLAND)-If receiver requested (IGRCYN) ='y' then PRLAND = 2 which 

means this line is a landed cost line to be vouchered.   If IGRCYN = 'n' then,  PRLAND = 3 which means 

this line is a landed cost line not to be vouchered.

Unit Cost (PRPRRC/FRRC)

Extended Cost (PRECST/FEC)-If Unit Include (IGINYN) = 'Y', then update with extended 

cost amount otherwise update with 0

Associated Line (PRALIN)-Line # of original received line.

Units Open (PRUOPN)-

Amount Open (PRAOPN/FAP)-

Units Received (PRUREC)-

Amount Received (PRAREC/FREC)-

Originator (PRTORG)-User ID

Date/Time Stamp-System Date and time

Transaction Date (PRTRDJ)-System Date



Save the first line number (NLIN) to update the associated line number in the original receiver 
record.



ENDREADLOOP

Process last record:

Call GetPurchaseReceiptRow for the original record.

Change Landed Cost (PRLAND) to a '1'
Change Associated Line # (PRALIN) with the first landed cost line # (NLIN of first landed 

cost receiver record.

Update receipt line.


Write Cardex and update costs:

Get Item Branch record

Get Item Branch Grade Potency - potency flag

Get Purchase Information from F4102 - margin maintenance flag

Get Item UoM Conversion - convert quantity to primary

Get purchase receipt details  - amount received, lot grade and potency

Free memory

Calculate Costs in primary

Unit Cost in Primary = Include Cost amount / Conversion to primary

Amount Received = Amount Received / Primary Quantity

Amt Unit Cost Last Paid = Amount Received + Unit Cost in Primary

Amount Received = Amt Unit Cost Last Paid * Primary Quantity

Call F4105UpdateCosts


Clear Landed Cost Caches



Data Structure

D4300970 - Landed Cost Selection

Parameter NameData ItemData TypeReq/OptI/O/Both
cModeProcessingMODEcharNONENONE

The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.

mnOrderNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

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

szCompanyKeyOrderNoKCOOcharNONENONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

jdDtForGlAndVouchDGLJDEDATENONENONE

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.

mnBatchNumberICUMATH_NUMERICNONENONE

A number that identifies a group of transactions that the system processes and balances as a unit. When you enter a batch, you can either 
assign a batch number or let the system assign it using the Next Numbers program.

szBatchTypeICUTcharNONENONE

A code that specifies the system and type of transactions entered in a batch. The system assigns the value when you enter a transaction. 
Valid values are set up in user defined code table 98/IT. You cannot assign new values. All batch types are hard coded.

szDocOrderTypeDCTcharNONENONE

A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
types, such as, vouchers, invoices, receipts, and timesheets. The reserved document type prefixes for codes are: P Accounts payable 
documents R Accounts receivable documents  T Time and Pay documents I Inventory documents  O Purchase order documents  S Sales order 
documents 

cCurrencyModeCRRMcharNONENONE

An option that specifies whether the system displays amounts in the domestic or foreign currency. On  The system displays amounts in the 
foreign currency of the transaction. Off  The system displays amounts in the domestic currency of the transaction.

cGlSummaryFlagSUMcharNONENONE

A Y indicates the summation or total of a field is to be computed.

szCurrencycodeCRCDcharNONENONE

A code that identifies the currency of a transaction. 

mnJobnumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnDocumentReceiptDOCMATH_NUMERICNONENONE

A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
number or let the system assign it using the Next Numbers program (P0002). Matching document numbers (DOCM) identify related documents 
in the Accounts Receivable and Accounts Payable systems. Examples of original and matching documents are: Accounts Payable     o 
Original document - voucher     o Matching document - payment  Accounts Receivable     o Original document - invoice     o Matching document - 
receipt  Note: In the Accounts Receivable system, the following transactions simultaneously generate original and matching documents: 
deductions, unapplied receipts, chargebacks, and drafts.

mnGLLinenumberJELNMATH_NUMERICNONENONE

A number that designates a line within a journal entry. The system uses this field to sequence the journal entry lines for inquiry purposes.

szDocCompanyKeyKCOcharNONENONE

A number that, with the document number, document type and G/L date, uniquely identifies an original document, such as invoice, voucher, 
or journal entry. If you use the Next Numbers by Company/Fiscal Year feature, the Automatic Next Numbers program (X0010) uses the 
document company to retrieve the correct next number for that company. If two or more original documents have the same document number and 
document type, you can use the document company to locate the desired document.

mnLandedCostJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnReceiptJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharNONENONE

mnLineNumberLNIDMATH_NUMERICNONENONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

mnNoOfLinesNLINMATH_NUMERICOPTNONE

A number representing the number of lines on either a purchase or sales order. or The number of receivers recorded during the receipts 
process.  This field will be used in Voucher Matching.

szOrderSuffixSFXOcharOPTNONE

In the A/R and A/P systems, a code that corresponds to the pay item. In the Sales Order and Procurement systems, this code identifies 
multiple transactions for an original order. For purchase orders, the code is always 000. For sales orders with multiple partial receipts against an 
order, the first receiver used to record receipt has a suffix of 000, the next has a suffix of 001, the next 002, and so on.

szVersionVERScharOPTNONE

A user-defined set of specifications that control how applications and reports run. You use versions to group and save a set of user-defined 
processing option values and data selection and sequencing options. Interactive versions are associated with applications (usually as a 
menu selection). Batch versions are associated with batch jobs or reports. To run a batch process, you must choose a version.

cDataFieldErrorCode1ERR1charOPTNONE

cLandedCostSelectionEV01charOPTNONE

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

Related Functions

None

Related Tables

F4311 Purchase Order Detail File
F41291ClearCache

F41291ClearCache

Landed Cost Selection

Master Business Function

Object Name: N4300970

Parent DLL: CDIST

Location: Client/Server

Language: NER

Data Structure

D4300970 - Landed Cost Selection

Parameter NameData ItemData TypeReq/OptI/O/Both
cModeProcessingMODEcharNONENONE

The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.

mnOrderNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

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

szCompanyKeyOrderNoKCOOcharNONENONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

jdDtForGlAndVouchDGLJDEDATENONENONE

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.

mnBatchNumberICUMATH_NUMERICNONENONE

A number that identifies a group of transactions that the system processes and balances as a unit. When you enter a batch, you can either 
assign a batch number or let the system assign it using the Next Numbers program.

szBatchTypeICUTcharNONENONE

A code that specifies the system and type of transactions entered in a batch. The system assigns the value when you enter a transaction. 
Valid values are set up in user defined code table 98/IT. You cannot assign new values. All batch types are hard coded.

szDocOrderTypeDCTcharNONENONE

A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
types, such as, vouchers, invoices, receipts, and timesheets. The reserved document type prefixes for codes are: P Accounts payable 
documents R Accounts receivable documents  T Time and Pay documents I Inventory documents  O Purchase order documents  S Sales order 
documents 

cCurrencyModeCRRMcharNONENONE

An option that specifies whether the system displays amounts in the domestic or foreign currency. On  The system displays amounts in the 
foreign currency of the transaction. Off  The system displays amounts in the domestic currency of the transaction.

cGlSummaryFlagSUMcharNONENONE

A Y indicates the summation or total of a field is to be computed.

szCurrencycodeCRCDcharNONENONE

A code that identifies the currency of a transaction. 

mnJobnumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnDocumentReceiptDOCMATH_NUMERICNONENONE

A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
number or let the system assign it using the Next Numbers program (P0002). Matching document numbers (DOCM) identify related documents 
in the Accounts Receivable and Accounts Payable systems. Examples of original and matching documents are: Accounts Payable     o 
Original document - voucher     o Matching document - payment  Accounts Receivable     o Original document - invoice     o Matching document - 
receipt  Note: In the Accounts Receivable system, the following transactions simultaneously generate original and matching documents: 
deductions, unapplied receipts, chargebacks, and drafts.

mnGLLinenumberJELNMATH_NUMERICNONENONE

A number that designates a line within a journal entry. The system uses this field to sequence the journal entry lines for inquiry purposes.

szDocCompanyKeyKCOcharNONENONE

A number that, with the document number, document type and G/L date, uniquely identifies an original document, such as invoice, voucher, 
or journal entry. If you use the Next Numbers by Company/Fiscal Year feature, the Automatic Next Numbers program (X0010) uses the 
document company to retrieve the correct next number for that company. If two or more original documents have the same document number and 
document type, you can use the document company to locate the desired document.

mnLandedCostJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnReceiptJobNoJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharNONENONE

mnLineNumberLNIDMATH_NUMERICNONENONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

mnNoOfLinesNLINMATH_NUMERICOPTNONE

A number representing the number of lines on either a purchase or sales order. or The number of receivers recorded during the receipts 
process.  This field will be used in Voucher Matching.

szOrderSuffixSFXOcharOPTNONE

In the A/R and A/P systems, a code that corresponds to the pay item. In the Sales Order and Procurement systems, this code identifies 
multiple transactions for an original order. For purchase orders, the code is always 000. For sales orders with multiple partial receipts against an 
order, the first receiver used to record receipt has a suffix of 000, the next has a suffix of 001, the next 002, and so on.

szVersionVERScharOPTNONE

A user-defined set of specifications that control how applications and reports run. You use versions to group and save a set of user-defined 
processing option values and data selection and sequencing options. Interactive versions are associated with applications (usually as a 
menu selection). Batch versions are associated with batch jobs or reports. To run a batch process, you must choose a version.

cDataFieldErrorCode1ERR1charOPTNONE

cLandedCostSelectionEV01charOPTNONE

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

Related Functions

None

Related Tables

F4311 Purchase Order Detail File
 or cost errors, skip EndDoc.

Write G/L records:

Do while flag is set to blank:

If currency is on, 

call F41921ReadWriteJobNumber (B4301050 cache action = 4)  (must call F0911EndDoc for 
every job number store in the cache.

else

use job number passed in parameter (F0911EndDoc only called once)

endif

Call F0911SummarizeDocument if parameter GLSUM is a '1'

Call F0911GetNextDocument 

Call F0911EditDoc (should never error, always in balance)

Call F0911EndDoc (for every document #)
JobNumber(JOBS)<-F0911JobNumber

ComputerID(CTID)<-ComputerID

ErrorFlag(EV01)->X

TypeOfDocument(EV01)<-"J"

BatchNumber(ICU)<-BatchNumber

BatchType(ICUT)<-BatchType

PrevBatchStatus(EV01)<-X

BatchStatus(EV01)<-BatchStatus

DocInBalance(EV01)<-X

SupressBatchCtnrl(EV01)<-X

ExitedOnAdd(EV01)<-"0"

OverrideMode(EV01)<-"A"

CurrencyFlag(CRYR)<-CurrencyProcessingFlag

NextNumberIndex(MATH06)<-"07"

NextNumberSysCd(SYS)<-"43  "

DocNumber(DOC)<>ReceiptDocument

ProgramID(PID)<-ProgramID


If (Error Occurred) Then

End Processing

Endif

If currency is on

Write GL Document number to cache (B4301050  cache action = 5)
Read next GL Job Number (B4301050  cache action = 4)

else

processing is done.

endif

End Do while read.


Read Landed Cost Cache (start to finish):

Read the Landed Cost Cache (F41291GetLandedCostCache). 

If the record is the original (TYPE = blank), store in work fields the Line Number and NLIN 
If the record type = 2  then skip record and read next record

Store the Order Number, type, key company, line number and NLIN <