Wednesday, 4 November 2015

Oracle Payment Processing Request (PPR) in AP – R12

PAYMENT PROCESSING REQUEST FUNCTIONALITY-
In 11i we used Payment batches to pay for multiple invoices same time. In R12, PPR is the replacement of Payment batches. R12 PPR process enables payment Administrator to select multiple invoices for payment by selection criteria and he can pause the invoice selection and payment build process. During the invoice selection review, payment manager can review the invoice selected; if the invoices were validated or approved and hence did not get included in the payment process request. He can add or remove the invoices in the Payment process and also can check the cash requirements for the full payment. Payment manager can also dismiss the individual documents or payments if necessary, and restart the payment build process.
Steps in Pay run Process-
Managing a Pay run involves 3 main processes
  • Selection of the invoices for payment
  • Grouping the invoices into payments
  • Building the payment instruction files to either print checks or send instructions to bank.
There are four steps in the processing of PPR:-
  • Document selection – Handled by Payables(AP)
  • Build Payments – Handled by Payments(IBY)
  • Format Payments – Handled by Payments(IBY)
  • Confirm Payments – Handled by Payables(AP)
Submitting a Single Payment Process Request
Mandatory fields – Payment Process Request name, pay through date, Payment date, and Exchange rate type.
Under Processing tab, options are available to stop the process after document selection/payment and also how to create the payment instructions:
  1. Maximize Credits.
  2. Stop Process for review after scheduled payment selection.
  3. Calculate payment withholding and interest during scheduled payment selection.
  4. Stop process for review after creation of proposed payments.
Click on submit to submit the Payment process request.
Document Selection – Payables
This process calls AP_AUTOSELECT_PKG.
When a payment process request is submitted, a record is inserted in AP_INV_SELECTION_CRITERIA_ALL with a checkrun_name i.e payment process request name. Invoices are then selected based on the due date, discount date, paygroup, and other criteria provided by the user while submitting the PPR.
The AP_SELECTED_INVOICES_ALL table is populated with the selected invoices and AP_UNSELECTED_INVOICES_ALL table by the unselected invoices.
Note: After selecting the documents, the invoices are locked to prevent other check runs from selecting the same invoices.
If the PPR has been setup to ‘Stop Process for Review after Scheduled Payment Selection’, the process stops for user review.
Then the status of the PPR is set to Invoices Pending Review.
If the ‘Stop Process for Review after Scheduled Payment Selection’ was not enabled, at the end of invoice selection, build program is submitted automatically.
If no invoices met the selection criteria and no payment schedules selected for payment, the PPR is cancelled automatically and the status of the PPR is set to “Cancelled – No Invoices Selected”. Then void all invoices
For others, the actions available are
a) Terminate the PPR
b) Modify / proceed to submit the PPR and start the build process.
Build Payments – Payments
Call IBY_DISBURSE_SUBMIT_PUB_PKG
Build payment creates records in IBY_PAY_SERVICE_REQUESTS with call_app_pay_service_req_code = checkrun_name.
A payment process request is a group of documents payable that a source product submits to Oracle Payments for payment service processing. This table contains the parameters like Calling application identifier, Internal bank account, Allow zero payments flag, etc. selected in the Payment Process Request.
PAYMENT_SERVICE_REQUEST_ID NUMBER System generated primary key
CALLING_APP_ID NUMBER Source product Identifier
CALL_APP_PAY_SERVICE_REQ_CODE VARCHAR2 Source product’s payment process request Identifier. Since the source product’s Identifiers may be alphanumeric, even numeric document Identifiers are stored as VARCHAR2.
PAYMENT_SERVICE_REQUEST_STATUS VARCHAR2 Payment process request status. Values from the lookup IBY_REQUEST_STATUSES include PAYMENTS_CREATED.
PROCESS_TYPE VARCHAR2 Specifies the process by which documents payable are built into payments and payments into payment instructions. Values from the lookup IBY_PROCESS_TYPES include STANDARD, IMMEDIATE, and MANUAL.
ALLOW_ZERO_PAYMENTS_FLAG VARCHAR2 Y or N flag that indicates whether zero payments are allowed for this payment request. If set to N, any zero value payments created for this payment request is failed.
INTERNAL_BANK_ACCOUNT_ID NUMBER Internal bank account identifier
MAXIMUM_PAYMENT_AMOUNT NUMBER Maximum payment amount used to override default maximum payment amount
MINIMUM_PAYMENT_AMOUNT NUMBER Minimum payment amount used to override default minimum payment amount
Note: The displayed status of the PPR is generated by ibyvutlb.pls
Following are the possible values of PAYMENT_SERVICE_REQUEST_STATUS column-
  • DOCUMENTS_VALIDATED
  • INFORMATION_REQUIRED
  • INSERTED
  • PAYMENTS_CREATED
  • PENDING_REVIEW
  • TERMINATED
  • VALIDATION_FAILED
  • COMPLETED
 In 11i AP_SELECTED_INVOICE_CHECKS_ALL table is populated by the Build Payment process.
The Build Program also populates IBY_DOCS_PAYABLE_ALL table
IBY_DOCS_PAYABLE_ALLThis table contains the documents payable which are updated by system while processing “Build Payments” program. A document payable is a supplier invoice or similar document that needs to be paid.  In addition, this table contains whatever document information is necessary for payment processing.
This table contains transaction details, document details, payer, payee, etc.”
Name Datatype Comments
PAY_PROC_TRXN_TYPE_CODE VARCHAR2 Type of payment processing transaction or document
CALLING_APP_ID NUMBER Calling product Identifier
CALLING_APP_DOC_REF_NUMBER VARCHAR2 Reference number entered by user of the source product. Need not be unique
DOCUMENT_PAYABLE_ID NUMBER Oracle Payments’ unique internal document payable Identifier
PAYMENT_FUNCTION VARCHAR2 Function or purpose of the payment. Values from the lookup IBY_PAYMENT_FUNCTIONS include SUPPLIER_PAYMENT, CUSTOMER_REFUNDS, and others.
PAYMENT_DATE DATE Payment date
DOCUMENT_DATE DATE Date of document
DOCUMENT_TYPE VARCHAR2 Type of document payable. Values from the IBY_DOCUMENT_TYPES lookup include INVOICE.
DOCUMENT_STATUS VARCHAR2 Document status. Values from the lookup IBY_DOCS_PAYABLE_STATUSES include PAYMENT CREATED.
DOCUMENT_CURRENCY_CODE VARCHAR2 Document currency code
DOCUMENT_AMOUNT NUMBER Total amount in document currency
PAYMENT_CURRENCY_CODE VARCHAR2 Payment currency code
PAYMENT_AMOUNT NUMBER Amount to be paid in payment currency
PAYMENT_SERVICE_REQUEST_ID NUMBER Identifier of the payment process request in which this document was submitted
PAYMENT_METHOD_CODE VARCHAR2 Payment method Identifier
EXCLUSIVE_PAYMENT_FLAG VARCHAR2 Y or N flag indicating whether this document payable should not be grouped with any other documents payable.
CALLING_APP_DOC_UNIQUE_REF1 VARCHAR2 Source product’s first unique document payable Identifier
CALLING_APP_DOC_UNIQUE_REF2 VARCHAR2 Source product’s second unique document payable Identifier (Invoice_id)
CALLING_APP_DOC_UNIQUE_REF3 VARCHAR2 Source product’s third unique document payable Identifier(Payment_number)
CALLING_APP_DOC_UNIQUE_REF4 VARCHAR2 Source product’s fourth unique document payable Identifier
CALLING_APP_DOC_UNIQUE_REF5 VARCHAR2 Source product’s fifth unique document payable Identifier
A.  Internal Bank Account/Payment Process Profile Assignment:
Call IBY_ASSIGN_PUB
If the payment process request has the internal bank account and payment profile assigned to it, the same is assigned to all the documents in the PPR.If a default internal bank account and PPP were not provided when submitting the PPR, Oracle Payments attempts to default the values. If it cannot find a default value for all the documents, the PPR is set to INFORMATION REQUIRED status. The display status of the PPR is “Information Required – Pending Action
User should complete the missing information and Run Payment Process to continue.
B.    Document Validation
Call IBY_VALIDATIONSETS_PUB

During this step, Oracle Payments validates all the documents using Payment Method based validations and then payment format based validations.b.1 – If all the documents pass validation, all the documents are set to a status of VALIDATED and the request status is set to ‘Documents Validated’.b.2 – If there are any validation failures, Oracle Payments uses the system option used while submitting the PPR to determine the next action.The DOCUMENT_REJECTION_LEVEL_CODE of the PPR can have the following values which determine how the document processing will continue when there is a validation failureb.2.1 – REQUEST
The status of the payment process request is updated to ‘Failed Document Validation’. Oracle Payments calls the calling application and AP releases the rejected documents so they can be paid through another Payment process request.
b.2.2 – DOCUMENT
Oracle Payments rejects all documents that failed validation. Oracle Payments then calls the calling application and AP releases the rejected documents so they can be paid through another Payment process request. The rest of the documents are set to VALIDATED status and the ppr is set to ‘Documents Validated’ status.
b.2.3 – PAYEE
Oracle Payments rejects all documents for the supplier that had one or more documents that failed validation. Oracle Payments calls the calling application and AP releases the rejected documents so they can be paid through another Payment process request. The rest of the documents are set to VALIDATED status and the ppr is set to ‘Documents Validated’ status.
c.     Create Payments
Call IBY_PAYGROUP_PUBThe validated documents are then grouped into proposed payments based on the grouping rules, both users defined and hard coded.
Example: If exclusive_payment_flag = Y on a document, it is paid on a separate payment.
It then numbers the payments (internal identifier not the check numbering) and validates the created payments.Records are inserted into IBY_PAYMENTS_ALL that holds the payment information for the selected documents.The build program then updates the IBY_DOCS_PAYABLE_ALL table with the payment_id and formatting_payment_id values that corresponding to the payment that pays the document.

IBY_PAYMENTS_ALL
This table contains all the payments created by system while processing “Build Payments”. A Payment can be single check or an electronic fund transfer between first party payer and third party payee. A row in this table corresponds to one or more documents payable. Payments are built by grouping documents payable according to Oracle Payments’ grouping rules.
This table also stores information of payments at grouping level. The groups can be Single, Mixed and grouped as defined in Payment Process Profile for the purpose of SEPA.
The payment details are displayed on the Payments tab of the Funds Disbursement Process Home page.
Name Datatype Comments
PAYMENT_ID NUMBER Unique internal Identifier for this record. Generated using a database sequence.
PAYMENT_METHOD_CODE VARCHAR2 Payment method used for making the payments.
PAYMENT_SERVICE_REQUEST_ID NUMBER Payment service request Id and it is the foreign key to the table iby_pay_service_requests.
PROCESS_TYPE VARCHAR2 Specifies the process by which the payment is built into a payment instruction. Values, from the lookup IBY_PROCESS_TYPES, include STANDARD, IMMEDIATE, and MANUAL.
PAYMENT_STATUS VARCHAR2 The status of the Payment. Values are derived from the lookup IBY_PAYMENT_STATUSES. The possible values are CREATED, FORMATTED, TRANSMITTED, VOID_BY_OVERFLOW, REJECTED, FORMATTED, VOID, etc.
PAYMENTS_COMPLETE_FLAG VARCHAR2 Y or N flag that indicates if the payment is complete
PAYMENT_FUNCTION VARCHAR2 Function or purpose of the payment. Values from the lookup IBY_PAYMENT_FUNCTIONS include SUPPLIER_PAYMENT, CUSTOMER_REFUNDS, and others.
PAYMENT_AMOUNT NUMBER Amount of the payment
PAYMENT_CURRENCY_CODE VARCHAR2 Currency of the payment
BILL_PAYABLE_FLAG VARCHAR2 Y or N flag indicating whether a payment is a bill payable, that is, a future dated payment
EXCLUSIVE_PAYMENT_FLAG VARCHAR2 Y or N flag indicating whether this payment is made up of a single document payable that was meant to be paid alone
SEPARATE_REMIT_ADVICE_REQ_FLAG VARCHAR2 Y or N flag indicating whether a separate remittance advice needs to be generated for a payment.
INTERNAL_BANK_ACCOUNT_ID NUMBER Internal bank account id used for making the payment.
ORG_ID NUMBER Unique internal identifier of the Operating Unit. Validated against HR_OPERATING_UNITS.ORGANIZATION_ID.
ORG_TYPE VARCHAR2 Organization type. Values, from the lookup IBY_ORGANIZATION_TYPES Include Operating Unit, Business Group, and Legal Entity
LEGAL_ENTITY_ID NUMBER Legal entity identifier
The PAYMENT_REJECTION_LEVEL_CODE can have the following values which determine how the payment processing will continue when there is a validation failure
Request – Entire PPR is rejected. Oracle Payments raises a business event that calls AP to release the documents. The status of the payment process request and proposed payments is updated to ‘REJECTED’.
Payment – Payments that failed validation are rejected and AP releases the documents that belong to the payment that failed validation. The other payments are accepted. The accepted payments get a status of ‘CREATED’.
None – Payments that failed Validation are set to ‘Failed Validation’ and allows for user intervention. Status of the PPR is set to ‘PENDING REVIEW’
If in the PPR setup, ‘Stop Process for Review After Creation of Proposed Payments’ is enabled, the PPR status is set to ‘Pending Proposed Payment Review’. This status prevents further processing until user takes action. If this option to stop for review is not enabled, the status of the PPR is set to ‘Payments Created’. In this status, payment instruction can be created for the PPR.

Format Payments – Payments

Call IBY_PAYINTSR_PUB, IBY_CHECKNUMBER_PUB

When a PPR is submitted, there are two options
The CREATE_PMT_INSTRUCTIONS_FLAG can be a Y or N
Y – Payment Instruction will be automatically created after payments are created.
N – Application waits for standard request submission for Payment Instruction.
The table IBY_PAYMENT_INSTRUCTIONS_ALL stores the payment instruction information.
If the PPR is setup to automatically submit instruction, the payment_service_request_id will be populated in iby_payment_instructions_all because the instruction will be specific to the PPR In this case, the instruction can be linked to the PPR using PAYMENT_SERVICE_REQUEST_ID
If the PPR processing is setup for the user to submit the instruction as a standard request, then when the instruction is submitted, then the instruction is linked to the PPR through the payments selected by the instruction.
The link in this case will be through iby_payments_all.payment_instruction_id
Key Columns of IBY_PAYMENT_INSTRUCTIONS_ALL table
Payment_instruction_id
Payment_profile_id
Payment_instruction_status
Payments_complete_code
Payment_count
Print_instruction_immed_flag
Transmit_instr_immed_flag
Internal_bank_account_id
Payment_document_id
Payment_date
Payment_reason_code
Payment_currency_code
Format:
The following processing occurs during the format step.
a) Number the payments – Check Numbering
b) Create XML Extract message
c) Pass the extract to XML publisher
d) Oracle XML Publisher (BI publisher) applies the format template
e) BI publisher formats and stores the output
f) Oracle Payments then updates the status of the Payment Instruction and the Payments. If successful, the status of Payments and Instruction is ‘Formatted’.
Print Checks:
a) Users can load stationery into the printer and print checks at this stage.
b) Determine if the checks printed ok. If not reprint
Confirm Payments – Payables
Call AP_PMT_CALLOUT_PKG

Record Print Status of the checks to confirm the payments. Oracle Payments calls ap_pmt_callout_pkg.payment_completed to confirm the payments.
This does the following:
a) Assigns sequence/values – Document sequencing.
b) Creates data in AP_CHECKS_ALL with appropriate data from IBY tables.
Checkrun_name = ppr name and checkrun_id = checkrun_id from IBY table.
c) Data inserted into AP_INVOICE_PAYMENTS_ALL for the corresponding checks.
d) AP_PAYMENT_SCHEDULES_ALL for the invoices are updated to indicate the payment details and status.
e) The documents paid in this PPR are released by setting the checkrun_id on the payment schedules to null.
f) AP_INVOICES_ALL is updated to show payment status
g) Data is deleted from the AP_SELECTED_INVOICES_ALL
h) Data is deleted from AP_UNSELECTED_INVOICES_ALL