index

Package BANINST1.fb_encumbrance_header

Common Business interface for the General Encumbrance Header API (ENCUMBRANCE_HEADER).
 
The General Encumbrance Header API maintains the header record for the Finance General Encumbrance document.  Additional functionality regarding the General Encumbrance as a whole (completing, canceling a change in progress, revalidating, and distributing a control total) are processed by the ENCUMBRANCE API (fp_encumbrance).


Program units
f_api_version   Returns the API version number.
f_doc_change_exists   Checks if document change number already exists.
f_exists   Checks if a record exists.
f_get_source_ind   Gets the source of an encumbrance record.
f_isequal   Compares two records for equality.
f_query_all   Selects all records for the entity.
f_query_by_rowid   Selects one record using ROWID.
f_query_one   Selects one record using key.
f_query_one_lock   Selects one record and locks it.
p_create   Creates a record.
p_delete   Deletes a record.
p_lock   Locks a record.
p_update   Updates a record.
p_update_internal   Internal updates.

Types
encumbrance_header_rec   Business Entity record type
encumbrance_header_ref   Entity cursor variable type
encumbrance_header_tab   Entity table type

Constants
M_ENTITY_NAME   Business Entity Name
M_BASE_TABLE_NAME   Base table name
M_ENC_SEQ_TYPE   Default sequence type for the General Encumbrance document number
M_ENC_DOC_TYPE   General Encumbrance document type


M_ENTITY_NAME

M_ENTITY_NAME        CONSTANT VARCHAR2(18) := 'ENCUMBRANCE_HEADER';

Business Entity Name


M_BASE_TABLE_NAME

M_BASE_TABLE_NAME    CONSTANT VARCHAR2(7) := 'FGBENCH';

Base table name


M_ENC_SEQ_TYPE

M_ENC_SEQ_TYPE       CONSTANT VARCHAR2(10) := 'E';

Default sequence type for the General Encumbrance document number


M_ENC_DOC_TYPE

M_ENC_DOC_TYPE     CONSTANT NUMBER := 25;

General Encumbrance document type


encumbrance_header_rec

TYPE encumbrance_header_rec IS RECORD (
  r_num                     fgbench.fgbench_num%TYPE,
  r_doc_change_num          fgbench.fgbench_doc_change_num%TYPE,
  r_user_id                 fgbench.fgbench_user_id%TYPE,
  r_desc                    fgbench.fgbench_desc%TYPE,
  r_change_desc             fgbench.fgbench_change_desc%TYPE,
  r_trans_date              fgbench.fgbench_trans_date%TYPE,
  r_doc_ref_num             fgbench.fgbench_doc_ref_num%TYPE,
  r_doc_amt                 fgbench.fgbench_doc_amt%TYPE,
  r_type                    fgbench.fgbench_type%TYPE,
  r_status_ind              fgbench.fgbench_status_ind%TYPE,
  r_status                  fgbench.fgbench_status%TYPE,
  r_processing_ind          fgbench.fgbench_processing_ind%TYPE,
  r_edit_deferral           fgbench.fgbench_edit_deferral%TYPE,
  r_estab_date              fgbench.fgbench_estab_date%TYPE,
  r_vendor_pidm             fgbench.fgbench_vendor_pidm%TYPE,
  r_source_ind              fgbench.fgbench_source_ind%TYPE,
  r_appr_ind                fgbench.fgbench_appr_ind%TYPE,
  r_nsf_on_off_ind          fgbench.fgbench_nsf_on_off_ind%TYPE,
  r_create_date             fgbench.fgbench_create_date%TYPE,
  r_create_user             fgbench.fgbench_create_user%TYPE,
  r_data_origin             fgbench.fgbench_data_origin%TYPE,
  r_create_source           fgbench.fgbench_create_source%TYPE,
  r_internal_record_id      gb_common.internal_record_id_type);

Business Entity record type


encumbrance_header_ref

TYPE encumbrance_header_ref IS REF CURSOR RETURN encumbrance_header_rec;

Entity cursor variable type


encumbrance_header_tab

TYPE encumbrance_header_tab IS TABLE OF encumbrance_header_rec INDEX BY BINARY_INTEGER;

Entity table type


f_api_version

Function f_api_version RETURN PLS_INTEGER

Returns the API version number.

Returns
Version of the API signature. Changes only when the signature changes.


f_doc_change_exists

Function f_doc_change_exists(p_doc_change_num fgbench.fgbench_doc_change_num%TYPE,
                             p_num            fgbench.fgbench_num%TYPE DEFAULT NULL)
  RETURN VARCHAR2

Checks if document change number already exists.
Looks first to transaction history.  If not found and if p_num parameter is populated, then looks to other General Encumbrances.

Parameters
p_doc_change_num   The user-defined document change number. VARCHAR2(8) Required Key
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8)

Returns
H   Change Number has posted to transaction history
N   Change Number not found
Y   Change Number in use on another general encumbrance



f_exists

Function f_exists(p_num   fgbench.fgbench_num%TYPE,
                  p_rowid gb_common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2

Checks if a record exists.

Parameters
p_num   The unique identifier of an Encumbrance document.  The number may be system generated. VARCHAR2(8) Required Key
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18)

Returns
Y if found, otherwise N.


f_get_source_ind

Function f_get_source_ind(p_num fgbench.fgbench_num%TYPE) RETURN VARCHAR2

Gets the source of an encumbrance record.
Returns the value of the document type source, which will be NULL for a General Encumbrance.  Returns N if the record does not exist.

Parameters
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8) Required Key

Returns
Value of Source Indicator.
N   Record not found
NULL   General Encumbrance
R   Requisition
P   Purchase Order
T   Travel Module



f_isequal

Function f_isequal(rec_one encumbrance_header_rec,
                   rec_two encumbrance_header_rec) RETURN VARCHAR2

Compares two records for equality.
Tests each field of rec_one against the corresponding field of rec_two. Two null values are considered equal.

Parameters
rec_one   The first record to compare. Type encumbrance_header_rec Required
rec_two   The second record to compare. Type encumbrance_header_rec Required

Returns
Y if all values in records are equal, otherwise N. Nulls match Nulls.


f_query_all

Function f_query_all(p_num fgbench.fgbench_num%TYPE)
  RETURN encumbrance_header_ref

Selects all records for the entity.

Parameters
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8) Required Key

Returns
A cursor variable that will fetch a set of records.


f_query_by_rowid

Function f_query_by_rowid(p_rowid gb_common.internal_record_id_type)
  RETURN encumbrance_header_ref

Selects one record using ROWID.

Parameters
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18) Required

Returns
A cursor variable that will fetch exactly one record.


f_query_one

Function f_query_one(p_num fgbench.fgbench_num%TYPE)
  RETURN encumbrance_header_ref

Selects one record using key.

Parameters
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8) Required Key

Returns
A cursor variable that will fetch exactly one record.


f_query_one_lock

Function f_query_one_lock(p_num   fgbench.fgbench_num%TYPE,
                          p_rowid gb_common.internal_record_id_type DEFAULT NULL)
  RETURN encumbrance_header_ref

Selects one record and locks it.

Parameters
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8) Required Key
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18)

Returns
A cursor variable for one record, locking the record.


p_create

Procedure p_create(p_num_in_out     IN OUT fgbench.fgbench_num%TYPE,
                   p_doc_change_num fgbench.fgbench_doc_change_num%TYPE DEFAULT NULL,
                   p_user_id        fgbench.fgbench_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_desc           fgbench.fgbench_desc%TYPE DEFAULT NULL,
                   p_change_desc    fgbench.fgbench_change_desc%TYPE DEFAULT NULL,
                   p_trans_date     fgbench.fgbench_trans_date%TYPE,
                   p_doc_ref_num    fgbench.fgbench_doc_ref_num%TYPE DEFAULT NULL,
                   p_doc_amt        fgbench.fgbench_doc_amt%TYPE DEFAULT NULL,
                   p_type           fgbench.fgbench_type%TYPE DEFAULT 'E',
                   p_status_ind     fgbench.fgbench_status_ind%TYPE DEFAULT 'O',
                   p_status         fgbench.fgbench_status%TYPE DEFAULT 'I',
                   p_edit_deferral  fgbench.fgbench_edit_deferral%TYPE DEFAULT NULL,
                   p_estab_date     fgbench.fgbench_estab_date%TYPE,
                   p_vendor_pidm    fgbench.fgbench_vendor_pidm%TYPE DEFAULT NULL,
                   p_source_ind     fgbench.fgbench_source_ind%TYPE DEFAULT NULL,
                   p_appr_ind       fgbench.fgbench_appr_ind%TYPE DEFAULT NULL,
                   p_nsf_on_off_ind fgbench.fgbench_nsf_on_off_ind%TYPE DEFAULT NULL,
                   p_data_origin    fgbench.fgbench_data_origin%TYPE DEFAULT NULL,
                   p_rowid_out      OUT gb_common.internal_record_id_type)

Creates a record.
 
If p_num_in_out is NULL or populated as 'NEXT', the API will create the document number with the next available sequence number from FOBSEQN, the sequence number base table, and will return that value.
 
Status indicator must be 'O', approval indicator must be 'N', and status must be 'I' during creation of a record.
 
Encumbrances of type (R)equisition or (P)urchase order are created by the Posting process from their source documents, not by this API. Encumbrances of type T can only be created under a context of 'TRAVEL'.
 
The create date, create user, and create source are not part of the p_create signature.  They are populated from the transaction date, user id, and data origin values.

Parameters
p_num_in_out   The unique identifier of an Encumbrance document.  The number may be system generated. VARCHAR2(8) Required Key
p_doc_change_num   The user-defined number identifies changes made to the original encumbrance.  This number is used as the document code to post the encumbrance change to the ledgers. VARCHAR2(8)
p_user_id   The unique identification code of the user who created or last updated the encumbrance document. VARCHAR2(30) Required
p_desc   The title or purpose of the Encumbrance. VARCHAR2(35)
p_change_desc   The title or a brief description of any change made to an existing encumbrance. VARCHAR2(35)
p_trans_date   The date the Encumbrance document will be recorded in the ledgers. DATE Required
p_doc_ref_num   The user-defined value providing additional identification for the encumbrance. VARCHAR2(8)
p_doc_amt   The total value of the encumbrance being recorded. NUMBER(17,2)
p_type   Indicates the type of encumbrance or the source of the encumbrance. VARCHAR2(1) Required
E   General Encumbrance (default)
M   Memo
L   Labor
R   Requisition
P   Purchase Order
T   Travel Module

p_status_ind   The status of the encumbrance. VARCHAR2(1) Required
C   Closed
O   Open - to be used when creating a new header record

p_status   The status of the encumbrance document. VARCHAR2(1)
C   Complete
I   Incomplete - to be used when creating a new header record
NULL   Document is awaiting completion.

p_edit_deferral   Indicates that document editing of the Encumbrance will be deferred until after completion. VARCHAR2(1)
Y   Defer editing of the detail records to the Interface process (FGRTRNI)
N   Edit at time detail records are created

p_estab_date   The date the encumbrance was originally established. DATE Required
p_vendor_pidm   The personal identification master record (PIDM) associated with the vendor referenced on the Encumbrance. NUMBER(8)
p_source_ind   Indicates the actual document type source for the encumbrance. VARCHAR2(1)
NULL   General Encumbrance (default)
R   Requisition
P   Purchase Order
T   Travel Module

p_approval_ind   Indicates if the document has been approved. VARCHAR2(1)
Y   Approved
N   Not approved - to be used when creating a new header record
NULL   Not approved

p_nsf_on_off_ind   Indicates when non-sufficient funds checking will be performed. VARCHAR2(1)
Y   Perform NSF checking at time of data entry.
N   No NSF checking

p_data_origin   Source system that created or last updated the data. VARCHAR2(30)
p_rowid_out   Database ROWID of the record to be created. VARCHAR2(18) Required


p_delete

Procedure p_delete(p_num   fgbench.fgbench_num%TYPE,
                   p_rowid gb_common.internal_record_id_type DEFAULT NULL)

Deletes a record.
 
Cannot delete a completed or posted encumbrance.
 
Cannot delete if the encumbrance header has a detail record or text associated with it.

Parameters
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8) Required Key
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18)


p_lock

Procedure p_lock(p_num         fgbench.fgbench_num%TYPE,
                 p_rowid_inout IN OUT gb_common.internal_record_id_type)

Locks a record.
If ROWID is not passed in, the record is located using the key values and the ROWID of the locked row is passed in p_rowid_inout.

Parameters
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8) Required Key
p_rowid_inout   Database ROWID of the record to be locked. VARCHAR2(18) Required


p_update

Procedure p_update(p_num            fgbench.fgbench_num%TYPE,
                   p_doc_change_num fgbench.fgbench_doc_change_num%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_user_id        fgbench.fgbench_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_desc           fgbench.fgbench_desc%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_change_desc    fgbench.fgbench_change_desc%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_trans_date     fgbench.fgbench_trans_date%TYPE DEFAULT dml_common.f_unspecified_date,
                   p_doc_ref_num    fgbench.fgbench_doc_ref_num%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_doc_amt        fgbench.fgbench_doc_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_type           fgbench.fgbench_type%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_status_ind     fgbench.fgbench_status_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_status         fgbench.fgbench_status%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_edit_deferral  fgbench.fgbench_edit_deferral%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_estab_date     fgbench.fgbench_estab_date%TYPE DEFAULT dml_common.f_unspecified_date,
                   p_vendor_pidm    fgbench.fgbench_vendor_pidm%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_source_ind     fgbench.fgbench_source_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_appr_ind       fgbench.fgbench_appr_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_nsf_on_off_ind fgbench.fgbench_nsf_on_off_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_data_origin    fgbench.fgbench_data_origin%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid          gb_common.internal_record_id_type DEFAULT NULL)

Updates a record.
 
An encumbrance can be updated only if it has a Status of (I)ncomplete, or to make an adjustment once it has been completed and posted to the ledgers. In the latter case, an encumbrance adjustment is initiated by changing the status to (I)ncomplete and providing a document change number and description in one update request.
 
Only encumbrances of type E, M, or L may be updated.
 
Note that fp_encumbrance.p_complete should be used to request validation and completion of a document, and that approvals are processed via user interfaces and not directly in the API.
 
If changing the value of p_trans_date or p_doc_amt, it is necessary to invoke fp_encumbrance.p_validate_detail in order to re-edit the General Encumbrance detail records and change the detail transaction amounts.

Parameters
p_num   The unique identifier of an Encumbrance document. VARCHAR2(8) Required Key
p_doc_change_num   The user-defined number identifies changes made to the original encumbrance.  This number is used as the document code to post the encumbrance change to the ledgers. VARCHAR2(8)
p_user_id   The unique identification code of the user who created or last updated the encumbrance document. VARCHAR2(30) Required
p_desc   The title or purpose of the Encumbrance. VARCHAR2(35)
p_change_desc   The title or a brief description of any change made to an existing encumbrance. VARCHAR2(35)
p_trans_date   The date the Encumbrance document will be recorded in the ledgers. DATE Required
p_doc_ref_num   The user-defined value providing additional identification for the encumbrance. VARCHAR2(8)
p_doc_amt   The total value of the encumbrance being recorded. NUMBER(17,2)
p_type   Indicates the type of encumbrance or the source of the encumbrance. VARCHAR2(1) Required
E   General Encumbrance
M   Memo
L   Labor
R   Requisition
P   Purchase Order
T   Travel Module

p_status_ind   The status of the encumbrance. VARCHAR2(1) Required
C   Closed
O   Open

p_status   The status of the encumbrance document. VARCHAR2(1)
C   Complete
I   Incomplete
NULL   Document is awaiting completion.

p_edit_deferral   Indicates that document editing of the Encumbrance will be deferred until after completion. VARCHAR2(1)
Y   Defer editing of the detail records to the Interface process (FGRTRNI)
N   Edit at time detail records are created

p_estab_date   The date the encumbrance was originally established. DATE Required
p_vendor_pidm   The personal identification master record (PIDM) associated with the vendor referenced on the Encumbrance. NUMBER(8)
p_source_ind   Indicates the actual document type source for the encumbrance. VARCHAR2(1)
NULL   General Encumbrance (default)
R   Requisition
P   Purchase Order
T   Travel Module

p_approval_ind   Indicates if the document has been approved. VARCHAR2(1)
Y   Approved
N   Not approved
NULL   Not approved

p_nsf_on_off_ind   Indicates when non-sufficient funds checking will be performed. VARCHAR2(1)
Y   Perform NSF checking at time of data entry.
N   No NSF checking

p_data_origin   Source system that created or last updated the data. VARCHAR2(30)
p_rowid   Database ROWID of the record to be updated. VARCHAR2(18)


p_update_internal

Procedure p_update_internal(p_num            fgbench.fgbench_num%TYPE,
                            p_doc_change_num fgbench.fgbench_doc_change_num%TYPE DEFAULT dml_common.f_unspecified_string,
                            p_change_desc    fgbench.fgbench_change_desc%TYPE DEFAULT dml_common.f_unspecified_string,
                            p_status_ind     fgbench.fgbench_status_ind%TYPE DEFAULT NULL,
                            p_status         fgbench.fgbench_status%TYPE DEFAULT NULL,
                            p_appr_ind       fgbench.fgbench_appr_ind%TYPE DEFAULT NULL)

Internal updates.
 
Note that fp_encumbrance.p_complete should be used to request validation and completion of a document, and that approvals are processed via user interfaces and not directly in the API.

Parameters
p_num   The unique identifier of a General Encumbrance document. VARCHAR2(8) Required Key
p_doc_change_num   The user-defined number identifies and provides an audit trail of any changes made to the original document. VARCHAR2(8)
p_change_desc   The title or a brief description of any change made to an existing encumbrance. VARCHAR2(35)
p_status_ind   The status of the encumbrance. VARCHAR2(1)
O   Open
C   Closed

p_status   The current status of the General Encumbrance document.  VARCHAR2(1)
I   Incomplete
C   Complete

p_appr_ind   Indicates if the document has been approved. VARCHAR2(1)
Y   Approved
N   Not approved