Search Results update_cure_amounts




Overview

OKL_VENDOR_REFUND_PVT is a private (PVT) PL/SQL package body in the Oracle E-Business Suite Applications (APPS) schema, part of the Oracle Lease and Finance Management (OKL / ETRM) module. Its business purpose is to manage the vendor refund lifecycle for lease contracts, particularly the processing of cure amounts that result from contract terminations or repossessions. The package coordinates the movement of cure amounts to a "moved to refunds" state and drives the generation of vendor refund records. It serves as an internal implementation layer, exposed through a public counterpart, and is responsible for the persistence and validation logic behind vendor refund processing. The header comment ("$Header: OKLRRFDB.pls 120.5") indicates the object has been maintained across multiple EBS releases and remains relevant in 12.1.1 and 12.2.2.

Key Procedures and Functions

  • GENERATE_VENDOR_REFUND — The primary business procedure of the package. It orchestrates creation of vendor refund entries, working in conjunction with cure amount updates so that eligible cure amounts are transitioned into the refund flow. While the documented metadata does not expose its parameter list, it is the entry point intended to be called when a refund must be produced for a contract's cure amounts.
  • WRITE_LOG — A diagnostic/logging utility used throughout the package to record debug messages and processing trail information. It supports troubleshooting and is typically invoked with a message level and text, aligning with the FND message logging conventions used across OKL packages.

In addition, the excerpt documents an internal Update_cure_amounts routine. It opens a cursor over OKL_CURE_AMOUNTS selecting cure_amount_id, object_version_number, and rows with STATUS = 'CURESINPROGRESS'. Within the loop, the next_row construct (the term the user searched for) computes the next available index of a PL/SQL collection:

  • next_row := nvl(l_camv_tbl.LAST,0) + 1; — determines the next collection slot.
  • The routine then assigns cure_amount_id, object_version_number, and STATUS := 'MOVED_TO_REFUNDS' into that slot before invoking the Cure Amount update API.
  • A SAVEPOINT (UPDATE_CURE_AMOUNTS) provides transaction control, with FND_MSG_PUB.initialize resetting the message stack.

A get_error_message helper iterates FND_MSG_PUB messages (counted via fnd_msg_pub.count_msg) and populates an error_message_type array for downstream reporting.

Tables Accessed

  • OKL_CURE_AMOUNTS — Queried and updated to select in-progress cure amounts and move their status to 'MOVED_TO_REFUNDS'.
  • OKC_K_HEADERS_B and OKL_K_HEADERS — Contract header sources used to associate refunds with the correct lease contract.
  • OKC_RULE_GROUPS_B — Rule group definitions supporting contract-level processing logic.
  • AR_PAYMENT_SCHEDULES_ALL — Receivables payment schedule data used to reconcile refund amounts against outstanding balances.
  • OKL_TXD_AR_LN_DTLS_B — Transaction line detail for lease/AR linkage.
  • DUAL and PLITBLM — Utility references for scalar selection and index-by-table iteration.

Usage Notes

As a PVT (private) package, OKL_VENDOR_REFUND_PVT is not called directly by end-user forms; it is invoked by its public API wrapper, concurrent programs, or other OKL packages handling refund and cure amount processing. The metadata shows it is referenced by two other packages, confirming its role as a shared internal service. Typical invocation occurs during contract termination, asset return, or refund settlement flows, where cure amounts in 'CURESINPROGRESS' status must be advanced. Developers extending ETRM should treat this package as internal and prefer the public entry points; direct calls risk bypassing validation and message handling conventions. Its reliance on FND_MSG_PUB and SAVEPOINT semantics means callers should manage the message stack and transaction boundaries appropriately, and the next_row collection pattern is standard for building index-by tables of cure amount records before bulk API processing.