DeleteInvFromF0311

Delete Invoice from F0311

Major Business Rule

Object Name: B0300005

Parent DLL: CFIN

Location: Client/Server

Language: C

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


^

Data Structure

D0300005 - Delete Invoice From F0311

Parameter NameData ItemData TypeReq/OptI/O/Both
mnDocumentNumberDOCMATH_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.

szDocumentTypeDCTcharNONENONE

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 

szDocumentCompanyKCOcharNONENONE

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.

jdGLDateDGJJDEDATENONENONE

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 
assign to the company record. The system compares the date that you enter on the transaction to the fiscal date pattern assigned to the 
company to retrieve the appropriate fiscal period number, as well as to perform date validations.

cOPPoProcessingEV01charNONENONE

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

cErrorFlagEV01charNONENONE

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

cUpdateBatchVC01AcharNONENONE

This is a generic field used for video constants display.

cValidateOrDeleteEV01charNONENONE

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

Related Functions

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

Related Tables

F0311 Accounts Receivable Ledger
F0911 Account Ledger