index

Package BANINST1.fb_jv_header

Common Business interface for the Journal Voucher Header API (JV_HEADER).
 
The Journal Voucher Header API maintains the header record for the Finance Journal Voucher document.  Additional functionality regarding the Journal Voucher as a whole (completion, copying, revalidating, and redistributing a control total) are processed by the JOURNAL_VOUCHER API (fp_journal_voucher).


Program units
f_api_version   Returns the API version number.
f_exists   Checks if a record exists.
f_isequal   Compares two records for equality.
f_query_all   Selects all records for the entity.
f_query_one   Selects one record using key.
f_query_by_rowid   Selects one record using ROWID.
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
jv_header_rec   Business Entity record type
jv_header_ref   Entity cursor variable type
jv_header_tab   Entity table type

Constants
M_ENTITY_NAME   Business Entity Name
M_BASE_TABLE_NAME   Base table name
M_JV_SEQ_TYPE   Default sequence type for the journal voucher document number
M_JV_DOC_TYPE   Journal Voucher document type


M_ENTITY_NAME

M_ENTITY_NAME        CONSTANT VARCHAR2(9) := 'JV_HEADER';

Business Entity Name


M_BASE_TABLE_NAME

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

Base table name


M_JV_SEQ_TYPE

M_JV_SEQ_TYPE       CONSTANT VARCHAR2(10) := 'J';

Default sequence type for the journal voucher document number


M_JV_DOC_TYPE

M_JV_DOC_TYPE     CONSTANT NUMBER := 20;

Journal Voucher document type


jv_header_rec

TYPE jv_header_rec IS RECORD (
  r_doc_num                 fgbjvch.fgbjvch_doc_num%TYPE,
  r_submission_number       fgbjvch.fgbjvch_submission_number%TYPE,
  r_user_id                 fgbjvch.fgbjvch_user_id%TYPE,
  r_trans_date              fgbjvch.fgbjvch_trans_date%TYPE,
  r_doc_description         fgbjvch.fgbjvch_doc_description%TYPE,
  r_doc_amt                 fgbjvch.fgbjvch_doc_amt%TYPE,
  r_auto_jrnl_id            fgbjvch.fgbjvch_auto_jrnl_id%TYPE,
  r_reversal_ind            fgbjvch.fgbjvch_reversal_ind%TYPE,
  r_obud_code               fgbjvch.fgbjvch_obud_code%TYPE,
  r_obph_code               fgbjvch.fgbjvch_obph_code%TYPE,
  r_budg_dur_code           fgbjvch.fgbjvch_budg_dur_code%TYPE,
  r_process_ind             fgbjvch.fgbjvch_process_ind%TYPE,
  r_edit_defer_ind          fgbjvch.fgbjvch_edit_defer_ind%TYPE,
  r_status_ind              fgbjvch.fgbjvch_status_ind%TYPE,
  r_approval_ind            fgbjvch.fgbjvch_approval_ind%TYPE,
  r_distrib_amt             fgbjvch.fgbjvch_distrib_amt%TYPE,
  r_nsf_on_off_ind          fgbjvch.fgbjvch_nsf_on_off_ind%TYPE,
  r_data_origin             fgbjvch.fgbjvch_data_origin%TYPE,
  r_create_source           fgbjvch.fgbjvch_create_source%TYPE,
  r_internal_record_id      gb_common.internal_record_id_type);

Business Entity record type


jv_header_ref

TYPE jv_header_ref IS REF CURSOR RETURN jv_header_rec;

Entity cursor variable type


jv_header_tab

TYPE jv_header_tab IS TABLE OF jv_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_exists

Function f_exists(p_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                  p_submission_number fgbjvch.fgbjvch_submission_number%TYPE,
                  p_rowid             gb_common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2

Checks if a record exists.

Parameters
p_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2) Key
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18)

Returns
Y if found, otherwise N.


f_isequal

Function f_isequal(rec_one jv_header_rec, rec_two jv_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 jv_header_rec Required
rec_two   The second record to compare. Type jv_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_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                     p_submission_number fgbjvch.fgbjvch_submission_number%TYPE)
  RETURN jv_header_ref

Selects all records for the entity.

Parameters
p_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2)

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


f_query_one

Function f_query_one(p_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                     p_submission_number fgbjvch.fgbjvch_submission_number%TYPE)
  RETURN jv_header_ref

Selects one record using key.

Parameters
p_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2) Key

Returns
A cursor variable that will fetch exactly one record.


f_query_by_rowid

Function f_query_by_rowid(p_rowid gb_common.internal_record_id_type)
  RETURN jv_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_lock

Function f_query_one_lock(p_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                          p_submission_number fgbjvch.fgbjvch_submission_number%TYPE,
                          p_rowid             gb_common.internal_record_id_type DEFAULT NULL)
  RETURN jv_header_ref

Selects one record and locks it.

Parameters
p_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2) 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_doc_num_in_out    IN OUT fgbjvch.fgbjvch_doc_num%TYPE,
                   p_submission_number fgbjvch.fgbjvch_submission_number%TYPE DEFAULT 0,
                   p_user_id           fgbjvch.fgbjvch_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_trans_date        fgbjvch.fgbjvch_trans_date%TYPE,
                   p_doc_description   fgbjvch.fgbjvch_doc_description%TYPE DEFAULT NULL,
                   p_doc_amt           fgbjvch.fgbjvch_doc_amt%TYPE DEFAULT NULL,
                   p_auto_jrnl_id      fgbjvch.fgbjvch_auto_jrnl_id%TYPE DEFAULT NULL,
                   p_reversal_ind      fgbjvch.fgbjvch_reversal_ind%TYPE DEFAULT NULL,
                   p_obud_code         fgbjvch.fgbjvch_obud_code%TYPE DEFAULT NULL,
                   p_obph_code         fgbjvch.fgbjvch_obph_code%TYPE DEFAULT NULL,
                   p_budg_dur_code     fgbjvch.fgbjvch_budg_dur_code%TYPE DEFAULT NULL,
                   p_edit_defer_ind    fgbjvch.fgbjvch_edit_defer_ind%TYPE,
                   p_status_ind        fgbjvch.fgbjvch_status_ind%TYPE DEFAULT 'I',
                   p_approval_ind      fgbjvch.fgbjvch_approval_ind%TYPE DEFAULT NULL,
                   p_distrib_amt       fgbjvch.fgbjvch_distrib_amt%TYPE DEFAULT NULL,
                   p_nsf_on_off_ind    fgbjvch.fgbjvch_nsf_on_off_ind%TYPE DEFAULT NULL,
                   p_data_origin       fgbjvch.fgbjvch_data_origin%TYPE DEFAULT NULL,
                   p_rowid_out         OUT gb_common.internal_record_id_type)

Creates a record.
 
If p_doc_num_in_out is left null or populated with NEXT, the API will create the record with the next available number from the Sequence Number Base table (FOBSEQN) and return that value.
 
The status indicator must be set to I when creating a new record, and the approval indicator should be set to N.
 
Note that auto_jrnl_id is used only in the Context of Recurring Journal processing, and obud_id, obph_code, and budg_dur_code are used only in the Context of Budget Maintenance.  These columns are not separately validated by the API.

Parameters
p_doc_num_in_out   The unique identifier of a Journal Voucher document.  The number may be system generated. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document.  All journals are created with a submission number of 0, including the base entry of a recurring (automatic) JV. Each iteration of a recurring JV increments the submission number by 1. NUMBER(2) Key
p_user_id   The identification code of the user who last updated the journal voucher document. VARCHAR2(30) Required
p_trans_date   The date the journal voucher document will be recorded in the ledgers. DATE Required
p_doc_description   The title or purpose of the journal voucher. VARCHAR2(35)
p_doc_amt   The control total for the document.  This is a total of all sequences, irrespective of the debit/credit indicator. NUMBER(17,2)
p_auto_jrnl_id   The unique value that identifies the journal voucher as automatic or recurring. VARCHAR2(3)
p_reversal_ind   An indicator which displays a value of "R" if the automatic journal voucher was reversed. VARCHAR2(1)
p_obud_code   The Budget ID, if this journal is updating the ledgers as well as budget development.  For example, this column will be populated if a journal is created using the Budget Maintenance Form (FBABDMN). VARCHAR2(6)
p_obph_code   The Budget Phase of the Budget ID, if this journal was created using the Budget Maintenance Form (FBABDMN). VARCHAR2(6)
p_budg_dur_code   The duration code referenced on the Activated Budget Phase, if this journal was created using the Budget Maintenance Form (FBABDMN).  Valid values are "P" (Permanent) or "T" (Temporary). VARCHAR2(1)
p_edit_defer_ind   Indicates that document editing of the journal voucher will be deferred until after completion. VARCHAR2(1) Required
Y   Defer editing of the detail records to the Interface process (FGRTRNI)
N   Edit at time detail records are created

p_status_ind   The current status of the journal voucher.  VARCHAR2(1)
I   Incomplete - to be used when creating a new header record
C   Complete

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_distrib_amt   A revised control total for the document, to be distributed among the existing detail of an incomplete Journal. NUMBER(17,2)
p_nsf_on_off_ind   Indicates if available balance checking will be processed. VARCHAR2(1)
Y   Perform NSF checking at time of data entry.
N   No NSF checking
NULL   No NSF checking

p_data_origin   Source system that last created or 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_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                   p_submission_number fgbjvch.fgbjvch_submission_number%TYPE,
                   p_rowid             gb_common.internal_record_id_type DEFAULT NULL)

Deletes a record.

Parameters
p_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2) Required Key
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18)


p_lock

Procedure p_lock(p_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                 p_submission_number fgbjvch.fgbjvch_submission_number%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_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2) Required Key
p_rowid_inout   Database ROWID of the record to be locked. VARCHAR2(18) Required


p_update

Procedure p_update(p_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                   p_submission_number fgbjvch.fgbjvch_submission_number%TYPE,
                   p_user_id           fgbjvch.fgbjvch_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_trans_date        fgbjvch.fgbjvch_trans_date%TYPE DEFAULT dml_common.f_unspecified_date,
                   p_doc_description   fgbjvch.fgbjvch_doc_description%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_doc_amt           fgbjvch.fgbjvch_doc_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_auto_jrnl_id      fgbjvch.fgbjvch_auto_jrnl_id%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_reversal_ind      fgbjvch.fgbjvch_reversal_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_obud_code         fgbjvch.fgbjvch_obud_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_obph_code         fgbjvch.fgbjvch_obph_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_budg_dur_code     fgbjvch.fgbjvch_budg_dur_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_edit_defer_ind    fgbjvch.fgbjvch_edit_defer_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_status_ind        fgbjvch.fgbjvch_status_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_approval_ind      fgbjvch.fgbjvch_approval_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_distrib_amt       fgbjvch.fgbjvch_distrib_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_nsf_on_off_ind    fgbjvch.fgbjvch_nsf_on_off_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_data_origin       fgbjvch.fgbjvch_data_origin%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid             gb_common.internal_record_id_type DEFAULT NULL)

Updates a record.
 
If changing the value of p_trans_date or p_distrib_amt, it is necessary to invoke fp_journal_voucher.p_validate_detail in order to re-edit the Journal Voucher detail records and change the detail transaction amounts.

Parameters
p_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2) Required Key
p_user_id   The identification code of the user who last updated the journal voucher document. VARCHAR2(30) Required
p_trans_date   The date the journal voucher document will be recorded in the ledgers. DATE Required
p_doc_description   The title or purpose of the journal voucher. VARCHAR2(35)
p_doc_amt   The control total for the document.  This is a total of all sequences, irrespective of the debit/credit indicator. NUMBER(17,2)
p_auto_jrnl_id   The unique value that identifies the journal voucher as automatic or recurring. VARCHAR2(3)
p_reversal_ind   An indicator which displays a value of "R" if the automatic journal voucher was reversed. VARCHAR2(1)
p_obud_code   The Budget ID, if this journal is updating the ledgers as well as budget development.  For example, this column will be populated if a journal is created using the Budget Maintenance Form (FBABDMN). VARCHAR2(6)
p_obph_code   The Budget Phase of the Budget ID, if this journal was created using the Budget Maintenance Form (FBABDMN). VARCHAR2(6)
p_budg_dur_code   The duration code referenced on the Activated Budget Phase, if this journal was created using the Budget Maintenance Form (FBABDMN).  Valid values are "P" (Permanent) or "T" (Temporary). VARCHAR2(1)
p_edit_defer_ind   Indicates that document editing of the journal voucher will be deferred until after completion. VARCHAR2(1) Required
Y   Defer editing of the detail records to the Interface process (FGRTRNI)
N   Edit at time detail records as created

p_status_ind   The current status of the journal voucher.  VARCHAR2(1)
I   Incomplete
C   Complete

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

p_distrib_amt   A revised control total for the document, to be distributed among the existing detail of an incomplete Journal. NUMBER(17,2)
p_nsf_on_off_ind   Indicates if available balance checking will be processed. VARCHAR2(1)
Y   Perform NSF checking at time of data entry.
N   No NSF checking
NULL   No NSF checking

p_data_origin   Source system that last created or 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_doc_num           fgbjvch.fgbjvch_doc_num%TYPE,
                            p_submission_number fgbjvch.fgbjvch_submission_number%TYPE,
                            p_status_ind        fgbjvch.fgbjvch_status_ind%TYPE DEFAULT NULL,
                            p_approval_ind      fgbjvch.fgbjvch_approval_ind%TYPE DEFAULT NULL)

Internal updates.
 
Note that fp_journal_voucher.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_doc_num   The unique identifier of a Journal Voucher document. VARCHAR2(8) Required Key
p_submission_number   The submission number associated with the journal voucher document. NUMBER(2) Required Key
p_status_ind   The current status of the journal voucher.  VARCHAR2(1)
I   Incomplete
C   Complete

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