Search Results p_prepay_status




Overview

AP_PREPAY_TRAK_REP_TURK_PKG is a country-specific PL/SQL package body in the Oracle E-Business Suite Payables (AP) module, owned by the APPS schema. Its documented purpose is to generate the Prepayment Tracking Report for Turkey. The package exists to satisfy a localized statutory or reporting requirement specific to Turkish operations, where prepayments (advances paid to suppliers before goods or services are received) must be tracked and reconciled separately for tax and regulatory reporting purposes. The source header identifies the file as APPPTRPB.pls, with an initial creation date of 26-JAN-2007 and a last update of 24-OCT-2007.

The package is classified as OTHER in the ETRM repository, indicating it is not part of the standard public Oracle Payables API surface. It is a report-support package whose primary role is to build dynamic SQL fragments and control report execution logic rather than expose reusable business APIs. It references Oracle Payables tables through APPS synonyms and is not referenced by any other package, confirming its role as a leaf-level, report-dedicated unit.

Key Procedures and Functions

  • BEFOREREPORT — A function that returns BOOLEAN and is invoked by Oracle Reports before the report query executes. It performs two principal tasks. First, it converts the report parameters P_INVOICE_FROM and P_INVOICE_TO from character strings into date values using the format mask 'YYYY/MM/DD HH24:MI:SS', and conditionally constructs a SQL predicate (held in the package variable c_lex_invoice_date) that restricts invoice records to the requested date range. When either date parameter is null, the predicate falls back to ' AND 1 = 1' so that no date restriction is applied. Second, it evaluates the P_PREPAY_STATUS parameter and builds a corresponding predicate (c_lex_prepay_status) that either filters on the prepayment status lookup code via ALC.lookup_code or applies no filter. The function thereby assembles the dynamic WHERE clause used by the report's lexical parameters.
  • DATE_CLOSE — A helper routine associated with date handling and report closure processing for the Turkish prepayment tracking report. It supports the date-range logic established in BEFOREREPORT, ensuring consistent date semantics across the report's execution lifecycle.

Tables Accessed

The metadata documents table access through APPS synonyms rather than direct schema-qualified names. Based on the source excerpt, the package interacts with the following:

  • AP_INVOICES_ALL (aliased ai) — Read to filter invoice records by invoice_date and to identify prepayment-related invoice activity within the selected period.
  • AP_LOOKUP_CODES (aliased ALC) — Read to resolve and filter on the prepayment status lookup code supplied through P_PREPAY_STATUS.

These references are embedded as dynamic SQL text fragments rather than direct DML, so the package does not write to any table. Its read pattern is consistent with a reporting-only component that aggregates and presents prepayment data for Turkish statutory review.

Usage Notes

AP_PREPAY_TRAK_REP_TURK_PKG is invoked in the context of the Prepayment Tracking Report for Turkey, typically as the supporting PL/SQL package behind an Oracle Reports (.rdf) concurrent program definition registered in the Payables responsibility. The BEFOREREPORT function fires automatically when the report is submitted, allowing the report's lexical parameters to be populated at runtime from the user-entered invoice date range and prepayment status.

Because the package is classified as OTHER and is not referenced by any other package, it should be treated as a self-contained, report-bound unit. It is not intended for direct invocation from custom PL/SQL, forms, or public APIs. Any modification carries risk to Turkish statutory reporting output and should be validated against the corresponding report definition and concurrent program registration in both Oracle EBS 12.1.1 and 12.2.2 environments, where the APPS schema ownership and synonym structure remain consistent.