Functional Description
Purpose
This function will allow for the deletion of unposted invoices or the voiding of posted invoices from 
the Accounts Receivable Ledger (F0311).
Setup Notes and Prerequisites
Invoice specified by the partial key Document Number, Document Type and Key Company must exist in the 
F0311.   
Special Logic
If an invoice has already been posted, this function will void it and create the necessary 'RE' 
record.  If it has not been posted, this function will delete it.  
Technical Specifications
Parameters
ItemDescriptionI/OReq?Notes
DOCmnDocumentNumberIYesDocument Number - part of the primary 
key.
DCTszDocumenTypeIYesDocument Type - part of the primary 
key.
KCOszDocumentCompanyIYes Document Company - part of the primary 
key.
DGJjdGLDateIYesGL date - used to update the historical 
date if the invoice is voided.
EV01cErrorFlagI/OYesError flag - will return a '1' if errors 
occurred during the function processing.
EV01cUpdateBatchIYesUpdate Batch flag.    
 1 = Update the batch header file
EV01cValidateOrDeleteIYes Validate or Delete the invoice flag 
 '  ' = Delete the invoice 
 '1' = Validate the invoice only 
Related Tables
F0311Accounts Receivable Ledger
F0911G/L Ledger
Related Functions
B0300001Validate F0311 Records to be Deleted 
B0300004Create RE Record - Voids
B0900026Void Journal Entry
N7000530B0300005 - Plug & Play 
B0000007Batch - Revise on Transaction Commitment
Processing
Load partial key to F0311
Select first line item associated with partial key
While there is a line item to process
 Fetch info for the current line item
 Validate record to see if it is OK to delete
 If error flag from Validate Record to be Deleted equals 1
 save error = 1
 Else
 If error flag from Validate Record to be Deleted equals 2
 and there has been no error recorded previously
 save error = 2
 End if
 End if
 try to fetch next line item
End While
If save error equals 1 or save error equals 2
 Return
End if
If cValidateOrDelete equals blank
 Build F0911 key
 Call Void Journal Entry
 If Void Journal Entry completed successfully
 Rebuild partial key to F0311
 While there is a line item to process
 Fetch next line item
 If Fetch succeeds
 If posted 
 Call Create RE Record - Voids
 Else
 Delete line item
 End if
 End if
 End While
 If cUpdateBatch equals 1
 If F0311 Posted Code equals "D"
 Set Override Mode = "V" for void
 Else
 Set Override Mode = "D" for delete
 End if
 Call Revise Batch on Transaction Commitment
 End if
 End if
 End if
End if
^
D0300005 - Delete Invoice From F0311
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| mnDocumentNumber | DOC | MATH_NUMERIC | NONE | NONE | 
A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
  | ||||
| szDocumentType | DCT | char | NONE | NONE | 
A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
  | ||||
| szDocumentCompany | KCO | char | NONE | NONE | 
A number that, with the document number, document type and G/L date, uniquely identifies an original document, such as invoice, voucher, 
  | ||||
| jdGLDate | DGJ | JDEDATE | NONE | NONE | 
A date that identifies the financial period to which the transaction will be posted. You define financial periods for a date pattern code that you 
  | ||||
| cOPPoProcessing | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| cErrorFlag | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| cUpdateBatch | VC01A | char | NONE | NONE | 
This is a generic field used for video constants display.  | ||||
| cValidateOrDelete | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| B0000004 Batch - Open On Initialization | ||||
| B0000007 Batch - Revise On Transaction Commitment | ||||
| B0000008 Batch - Revise On Exit | ||||
| B0300001 Validate F0311 Records To Be Deleted | ||||
| B0300004 Create 'RE' Record - Voids | ||||
| B0900026 Void Journal Entry | ||||
| N7000530 B0300005 - Plug & Play - 03B | 
| F0311 Accounts Receivable Ledger | ||||
| F0911 Account Ledger |