index

Package tb_misc_header

The Common Business interface for the Miscellaneous Receipt Header API (MISC_HEADER).
A miscellaneous transaction is identified as money being received that is not posted to the receivable account of a specific person or non-person account.
 
All parameters are case sensitive; they are validated as provided.
Note that the f_query_all function is omitted from this API, as there is no logical grouping for multiple records in this table.


Program units
f_api_version   Returns the API version number.
f_exists   Checks to see if a record exists.
f_isequal   Compare 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.
f_receipt_in_balance   Verifies that the detail for a receipt is in balance.
p_create   Creates a record.
p_lock   Locks a record.
p_update   Updates a record.

Types
misc_header_rec   Entity record type
misc_header_ref   Entity cursor variable type
misc_header_tab   Entity table type

Constants
M_ENTITY_NAME   Business Entity name


M_ENTITY_NAME

M_ENTITY_NAME    CONSTANT VARCHAR2(11) := 'MISC_HEADER';

Business Entity name


misc_header_rec

TYPE misc_header_rec IS RECORD (
   r_receipt_number          tbbmisc.tbbmisc_receipt_number%TYPE,
   r_user                    tbbmisc.tbbmisc_user%TYPE,
   r_name                    tbbmisc.tbbmisc_name%TYPE,
   r_house_number            tbbmisc.tbbmisc_house_number%TYPE,
   r_street_line1            tbbmisc.tbbmisc_street_line1%TYPE,
   r_street_line2            tbbmisc.tbbmisc_street_line2%TYPE,
   r_street_line3            tbbmisc.tbbmisc_street_line3%TYPE,
   r_street_line4            tbbmisc.tbbmisc_street_line4%TYPE,
   r_city                    tbbmisc.tbbmisc_city%TYPE,
   r_stat_code               tbbmisc.tbbmisc_stat_code%TYPE,
   r_zip                     tbbmisc.tbbmisc_zip%TYPE,
   r_natn_code               tbbmisc.tbbmisc_natn_code%TYPE,
   r_data_origin             tbbmisc.tbbmisc_data_origin%TYPE,
   r_create_source           tbbmisc.tbbmisc_create_source%TYPE,
   r_document_number         tbbmisc.tbbmisc_document_number%TYPE,
   r_internal_record_id      gb_common.internal_record_id_type);

Entity record type


misc_header_ref

TYPE misc_header_ref IS REF CURSOR RETURN misc_header_rec;

Entity cursor variable type


misc_header_tab

TYPE misc_header_tab IS TABLE OF misc_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_receipt_number tbbmisc.tbbmisc_receipt_number%TYPE,
                  p_rowid          VARCHAR2 DEFAULT NULL) RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key
p_rowid   Database rowid of record to select. VARCHAR2(18)

Returns
Y if found, otherwise N.


f_isequal

Function f_isequal(rec_one misc_header_rec, rec_two misc_header_rec)
  RETURN VARCHAR2

Compare 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 misc_header_rec Required
rec_two   The second record to compare. Type misc_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_receipt_number tbbmisc.tbbmisc_receipt_number%TYPE)
  RETURN misc_header_ref

Selects all records for the entity.

Parameters
p_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key

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


f_query_by_rowid

Function f_query_by_rowid(p_rowid VARCHAR2) RETURN misc_header_ref

Selects one record using rowid.

Parameters
p_rowid   Database rowid of record to select. VARCHAR2(18) Required

Returns
A cursor variable that will fetch exactly one record.


f_query_one

Function f_query_one(p_receipt_number tbbmisc.tbbmisc_receipt_number%TYPE)
  RETURN misc_header_ref

Selects one record using key.

Parameters
p_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key

Returns
A cursor variable that will fetch exactly one record.


f_query_one_lock

Function f_query_one_lock(p_receipt_number tbbmisc.tbbmisc_receipt_number%TYPE,
                          p_rowid          VARCHAR2 DEFAULT NULL)
  RETURN misc_header_ref

Selects one record and locks it.

Parameters
p_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key
p_rowid   Database rowid of record to select. VARCHAR2(18)

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


f_receipt_in_balance

Function f_receipt_in_balance(p_receipt_number tbbmisc.tbbmisc_receipt_number%TYPE)
  RETURN VARCHAR2

Verifies that the detail for a receipt is in balance.

Parameters
p_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key

Returns
Y if detail exists and total Debits = Credits, or N.


p_create

Procedure p_create(p_receipt_number  tbbmisc.tbbmisc_receipt_number%TYPE,
                   p_user            tbbmisc.tbbmisc_user%TYPE,
                   p_name            tbbmisc.tbbmisc_name%TYPE DEFAULT NULL,
                   p_house_number    tbbmisc.tbbmisc_house_number%TYPE DEFAULT NULL,
                   p_street_line1    tbbmisc.tbbmisc_street_line1%TYPE DEFAULT NULL,
                   p_street_line2    tbbmisc.tbbmisc_street_line2%TYPE DEFAULT NULL,
                   p_street_line3    tbbmisc.tbbmisc_street_line3%TYPE DEFAULT NULL,
                   p_street_line4    tbbmisc.tbbmisc_street_line4%TYPE DEFAULT NULL,
                   p_city            tbbmisc.tbbmisc_city%TYPE DEFAULT NULL,
                   p_stat_code       tbbmisc.tbbmisc_stat_code%TYPE DEFAULT NULL,
                   p_zip             tbbmisc.tbbmisc_zip%TYPE DEFAULT NULL,
                   p_natn_code       tbbmisc.tbbmisc_natn_code%TYPE DEFAULT NULL,
                   p_data_origin     tbbmisc.tbbmisc_data_origin%TYPE DEFAULT NULL,
                   p_document_number tbbmisc.tbbmisc_document_number%TYPE DEFAULT NULL,
                   p_rowid_out       OUT VARCHAR2)

Creates a record.
The Miscellaneous Receipt header is used to record information regarding the source of money presented for deposit not associated with any receivable account.  Information is free-form, with exception of the State or Province Code (valid in STVSTAT) and the Nation Code (valid in STVNATN).
 
Receipt Number and User (cashier) are required.
 
Name and at least one of the Street fields are required if Address Required for Miscellaneous Transactions is selected in the Accounts Receivable Billing Control Table (TBBCTRL).
 
A Document Number may only be used in association with one Miscellaneous Receipt Number; the same Document should be recorded on the header and all detail records.  This is validated only in the Miscellaneous Receipt Detail API (TB_MISC_DETAIL).

Parameters
p_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key
p_user   User ID of the cashier who created the miscellaneous transaction. VARCHAR2(30) Required
p_name   Free-form name of the person or office presenting revenue for processing as a miscellaneous transaction. VARCHAR2(30)
p_house_number   House Number of the street address for the receipt of the miscellaneous transaction. VARCHAR2(10)
p_street_line1   First line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_street_line2   Second line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_street_line3   Third line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_street_line4   Fourth line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_city   City of the address for the receipt of the miscellaneous transaction. VARCHAR2(50)
p_stat_code   State or Province of the address for the receipt of the miscellaneous transaction, valid in STVSTAT. VARCHAR2(3)
p_zip   Zip or Postal Code of the address for the receipt of the miscellaneous transaction. VARCHAR2(30)
p_natn_code   Nation/country of the address for the receipt of the miscellaneous transaction, valid in STVNATN. VARCHAR2(5)
p_data_origin   Source system that last created or updated the data. VARCHAR2(30)
p_document_number   Document number that references a source document for the miscellaneous transaction. VARCHAR2(8)
p_rowid_out   Database rowid of the record created. VARCHAR2(18) Required


p_lock

Procedure p_lock(p_receipt_number tbbmisc.tbbmisc_receipt_number%TYPE,
                 p_rowid_inout    IN OUT VARCHAR2)

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_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key
p_rowid_inout   Database rowid of record to lock. VARCHAR2(18) Required


p_update

Procedure p_update(p_receipt_number tbbmisc.tbbmisc_receipt_number%TYPE,
                   p_name           tbbmisc.tbbmisc_name%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_house_number   tbbmisc.tbbmisc_house_number%TYPE default dml_common.f_unspecified_string,
                   p_street_line1   tbbmisc.tbbmisc_street_line1%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_street_line2   tbbmisc.tbbmisc_street_line2%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_street_line3   tbbmisc.tbbmisc_street_line3%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_street_line4   tbbmisc.tbbmisc_street_line4%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_city           tbbmisc.tbbmisc_city%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_stat_code      tbbmisc.tbbmisc_stat_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_zip            tbbmisc.tbbmisc_zip%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_natn_code      tbbmisc.tbbmisc_natn_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_data_origin    tbbmisc.tbbmisc_data_origin%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid          VARCHAR2 DEFAULT NULL)

Updates a record.
Receipt Number or ROWID is required.
 
Name and at least one of the Street fields are required if Address Required for Miscellaneous Transactions is selected in the Accounts Receivable Billing Control Table (TBBCTRL).

Parameters
p_receipt_number   Receipt number assigned to the miscellaneous transaction. NUMBER(8) Required Key
p_name   Free-form name of the person or office presenting revenue for processing as a miscellaneous transaction. VARCHAR2(30)
p_house_number   House Number of the street address for the receipt of the miscellaneous transaction. VARCHAR2(10)
p_street_line1   First line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_street_line2   Second line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_street_line3   Third line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_street_line4   Fourth line of the street address for the receipt of the miscellaneous transaction. VARCHAR2(75)
p_city   City of the address for the receipt of the miscellaneous transaction. VARCHAR2(50)
p_stat_code   State or Province of the address for the receipt of the miscellaneous transaction, valid in STVSTAT. VARCHAR2(3)
p_zip   Zip or Postal Code of the address for the receipt of the miscellaneous transaction. VARCHAR2(30)
p_natn_code   Nation/country of the address for the receipt of the miscellaneous transaction, valid in STVNATN. VARCHAR2(5)
p_data_origin   Source system that last created or updated the data. VARCHAR2(30)
p_rowid   Database rowid of the record to update. VARCHAR2(18)