index

Package BANINST1.fb_po_tax

Common Business interface for the Purchase Order Tax API (fb_po_tax).


Program units
f_api_version   Returns the API version number.
f_exists   Checks to see 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_calc_and_create   Calculates tax for a PO detail row and inserts the tax records.
p_delete_by_item   Delete all the rows in the tax table for a given purchase order and item.

Types
po_tax_rec   Business Entity record type
po_tax_ref   Entity cursor variable type
po_tax_tab   Entity table type

Constants
M_ENTITY_NAME   Business Entity Name


M_ENTITY_NAME

M_ENTITY_NAME    CONSTANT VARCHAR2(6) := 'PO_TAX';

Business Entity Name


po_tax_rec

TYPE po_tax_rec IS RECORD (
  r_pohd_code               fprpotx.fprpotx_pohd_code%TYPE,
  r_item                    fprpotx.fprpotx_item%TYPE,
  r_change_seq_num          fprpotx.fprpotx_change_seq_num%TYPE,
  r_priority_num            fprpotx.fprpotx_priority_num%TYPE,
  r_trat_code               fprpotx.fprpotx_trat_code%TYPE,
  r_tax_amt                 fprpotx.fprpotx_tax_amt%TYPE,
  r_taxable_amt             fprpotx.fprpotx_taxable_amt%TYPE,
  r_pay_tax_to              fprpotx.fprpotx_pay_tax_to%TYPE,
  r_user_id                 fprpotx.fprpotx_user_id%TYPE,
  r_data_origin             fprpotx.fprpotx_data_origin%TYPE,
  r_internal_record_id      Gb_Common.internal_record_id_type);

Business Entity record type


po_tax_ref

TYPE po_tax_ref IS REF CURSOR RETURN po_tax_rec;

Entity cursor variable type


po_tax_tab

TYPE po_tax_tab IS TABLE OF po_tax_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_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                  p_item           fprpotx.fprpotx_item%TYPE,
                  p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                  p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                  p_trat_code      fprpotx.fprpotx_trat_code%TYPE,
                  p_rowid          Gb_Common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) Required 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 po_tax_rec, rec_two po_tax_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 po_tax_rec Required
rec_two   The second record to compare. Type po_tax_rec Required

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


f_query_all

Function f_query_all(p_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                     p_item           fprpotx.fprpotx_item%TYPE,
                     p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                     p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                     p_trat_code      fprpotx.fprpotx_trat_code%TYPE)
  RETURN po_tax_ref

Selects all records for the entity.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) Required Key

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


f_query_one

Function f_query_one(p_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                     p_item           fprpotx.fprpotx_item%TYPE,
                     p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                     p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                     p_trat_code      fprpotx.fprpotx_trat_code%TYPE)
  RETURN po_tax_ref

Selects one record using key.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) Required 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 po_tax_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_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                          p_item           fprpotx.fprpotx_item%TYPE,
                          p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                          p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                          p_trat_code      fprpotx.fprpotx_trat_code%TYPE,
                          p_rowid          Gb_Common.internal_record_id_type DEFAULT NULL)
  RETURN po_tax_ref

Selects one record and locks it.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) 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_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                   p_item           fprpotx.fprpotx_item%TYPE,
                   p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                   p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                   p_trat_code      fprpotx.fprpotx_trat_code%TYPE,
                   p_tax_amt        fprpotx.fprpotx_tax_amt%TYPE,
                   p_taxable_amt    fprpotx.fprpotx_taxable_amt%TYPE,
                   p_pay_tax_to     fprpotx.fprpotx_pay_tax_to%TYPE,
                   p_user_id        fprpotx.fprpotx_user_id%TYPE DEFAULT Gb_Common.f_sct_user,
                   p_data_origin    fprpotx.fprpotx_data_origin%TYPE DEFAULT NULL,
                   p_rowid_out      OUT Gb_Common.internal_record_id_type)

Creates a record.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) Required Key
p_tax_amt   The amount of tax computed or entered for a document. NUMBER(17,2) Required
p_taxable_amt   The amount which is multiplied by the tax rate to give tax amount. NUMBER(17,2) Required
p_pay_tax_to   Indicates who should be paid taxes either the vendor or the taxing authority. VARCHAR2(1) Required
p_user_id   The unique identification code for the user. VARCHAR2(30)
p_data_origin   Source system that generated the data. VARCHAR2(30)
p_rowid_out   Database ROWID of the record to be created. VARCHAR2(18) Required


p_delete

Procedure p_delete(p_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                   p_item           fprpotx.fprpotx_item%TYPE,
                   p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                   p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                   p_trat_code      fprpotx.fprpotx_trat_code%TYPE,
                   p_rowid          Gb_Common.internal_record_id_type DEFAULT NULL)

Deletes a record.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) Required Key
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18)


p_lock

Procedure p_lock(p_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                 p_item           fprpotx.fprpotx_item%TYPE,
                 p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                 p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                 p_trat_code      fprpotx.fprpotx_trat_code%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_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) Required Key
p_rowid_inout   Database ROWID of the record to be locked. VARCHAR2(18) Required


p_update

Procedure p_update(p_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                   p_item           fprpotx.fprpotx_item%TYPE,
                   p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                   p_priority_num   fprpotx.fprpotx_priority_num%TYPE,
                   p_trat_code      fprpotx.fprpotx_trat_code%TYPE,
                   p_tax_amt        fprpotx.fprpotx_tax_amt%TYPE DEFAULT Dml_Common.f_unspecified_number,
                   p_taxable_amt    fprpotx.fprpotx_taxable_amt%TYPE DEFAULT Dml_Common.f_unspecified_number,
                   p_pay_tax_to     fprpotx.fprpotx_pay_tax_to%TYPE DEFAULT Dml_Common.f_unspecified_string,
                   p_user_id        fprpotx.fprpotx_user_id%TYPE DEFAULT Gb_Common.f_sct_user,
                   p_data_origin    fprpotx.fprpotx_data_origin%TYPE DEFAULT Dml_Common.f_unspecified_string,
                   p_rowid          Gb_Common.internal_record_id_type DEFAULT NULL)

Updates a record.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_priority_num   A number to establish the order in which taxes are to be compounded for a taxed commodity. NUMBER(2) Required Key
p_trat_code   The value of the tax rate established on form: FTVTRAT. VARCHAR2(4) Required Key
p_tax_amt   The amount of tax computed or entered for a document. NUMBER(17,2) Required
p_taxable_amt   The amount which is multiplied by the tax rate to give tax amount. NUMBER(17,2) Required
p_pay_tax_to   Indicates who should be paid taxes either the vendor or the taxing authority. VARCHAR2(1) Required
p_user_id   The unique identification code for the user. VARCHAR2(30)
p_data_origin   Source system that generated the data. VARCHAR2(30)
p_rowid   Database ROWID of the record to be updated. VARCHAR2(18)


p_calc_and_create

Procedure p_calc_and_create(p_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                            p_item           fprpotx.fprpotx_item%TYPE,
                            p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE,
                            p_tgrp_code      ftvtgrp.ftvtgrp_tgrp_code%TYPE,
                            p_eff_date       ftvtgrp.ftvtgrp_eff_date%TYPE,
                            p_vendor_pidm    ftvvend.ftvvend_pidm%TYPE,
                            p_quantity       fprpodt.fprpodt_qty%TYPE,
                            p_unit_price     fprpodt.fprpodt_unit_price%TYPE,
                            p_disc_amt       fprpodt.fprpodt_disc_amt%TYPE,
                            p_addl_amt       fprpodt.fprpodt_addl_chrg_amt%TYPE,
                            p_user_id        fprpotx.fprpotx_user_id%TYPE DEFAULT Gb_Common.f_sct_user,
                            p_data_origin    fprpotx.fprpotx_data_origin%TYPE DEFAULT NULL,
                            p_tax_amt_out    OUT fprpotx.fprpotx_tax_amt%TYPE)

Calculates tax for a PO detail row and inserts the tax records.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key
p_tgrp_code   The user specified code which defines the tax group code VARCHAR2(4) Required
p_eff_date   The effective date of the tax group code Date Required
p_vendor_pidm   The PIDM of the vendor on the PO NUMBER(8 Required
p_quantity   The quantity of the commodity on the PO detail row. NUMBER(8,2) Required
p_unit_price   The unit price for the commodity NUMBER(19,4) Required
p_disc_amt   The Discount amount for the commodity NUMBER(17,2) Required
p_addl_amt   The amount of additional charge for the commodity NUMBER(17,2) Required
p_user_id   The unique identification code for the user. VARCHAR2(30)
p_data_origin   Source system that generated the data. VARCHAR2(30)
p_tax_amt_out   The total tax amount for the commodity. NUMBER(17,2)


p_delete_by_item

Procedure p_delete_by_item(p_pohd_code      fprpotx.fprpotx_pohd_code%TYPE,
                           p_item           fprpotx.fprpotx_item%TYPE,
                           p_change_seq_num fprpotx.fprpotx_change_seq_num%TYPE)

Delete all the rows in the tax table for a given purchase order and item.

Parameters
p_pohd_code   The unique identifier of a purchase order document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with the item on the commodity record. NUMBER(4) Required Key
p_change_seq_num   Change sequence number for change purchase orders, which is part of the unique key. NUMBER(3) Key