index

Package BANINST1.fb_invoice_tax

Common Business interface for Invoice Tax API (FB_INVOICE_TAX).


Program units
f_api_version   Returns the API version number.
f_exists   Checks to see if a record exists.
f_exists_data   Returns true if a record exists.
f_isequal   Compares two records for equality.
f_query_all   Selects all records for the entity, invoice code, tax rate code, invoice item invoice accounting sequence, rucl code, pay tax to indicator, priority number, rebate indicator, user id or data origin.
f_query_one   Selects one record using unique columns.
f_query_one_rec   Returns one invoice tax record using rowid or unique columns.
f_query_by_rowid   Selects one record using ROWID.
f_query_one_string   Returns all of the invoice tax data concatenated into a string in the invoice tax record using rowid or unique columns.
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 the tax for an invoice item and creates all the farintx rows.
p_create_by_sequence   Creates the farintx records for a particular accounting sequence.
p_create_by_sequence   Creates the farintx records for a particular accounting sequence.
p_delete_by_item   Deletes all the farintx rows for a given commodity item.
p_delete_internal   Deletes all the farintx rows for a given invoice document.
p_delete_by_sequence   Deletes all the farintx rows for a given accounting sequence.
p_update_by_item   This procedure can be used when a user overrides the calculated tax amount.
f_get_tax_rebate   This procedure can be used retrieve total tax rebate amount from commodity tax records.
f_get_tax_rebate   This procedure can be used retrieve total tax rebate amount from a given accounting sequence.
f_calc_base_tax_amt   Calculates the original tax for an invoice item before any override.

Types
invoice_tax_rec   Business Entity record type
invoice_tax_ref   Entity cursor variable type
invoice_tax_tab   Entity table type

Constants
M_ENTITY_NAME   Business Entity Name
M_BASE_TABLE_NAME   Base table name


M_ENTITY_NAME

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

Business Entity Name


M_BASE_TABLE_NAME

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

Base table name


invoice_tax_rec

TYPE invoice_tax_rec IS RECORD (
  r_invh_code               farintx.farintx_invh_code%TYPE,
  r_trat_code               farintx.farintx_trat_code%TYPE,
  r_tax_amt                 farintx.farintx_tax_amt%TYPE,
  r_pay_tax_to              farintx.farintx_pay_tax_to%TYPE,
  r_item                    farintx.farintx_item%TYPE,
  r_seq_num                 farintx.farintx_seq_num%TYPE,
  r_rucl_code               farintx.farintx_rucl_code%TYPE,
  r_priority_num            farintx.farintx_priority_num%TYPE,
  r_taxable_amt             farintx.farintx_taxable_amt%TYPE,
  r_rebate_ind              farintx.farintx_rebate_ind%TYPE,
  r_convert_tax_amt         farintx.farintx_convert_tax_amt%TYPE,
  r_trat_descrip            farintx.farintx_trat_descrip%TYPE,
  r_rebate_amt              farintx.farintx_rebate_amt%TYPE,
  r_convert_rebate_amt      farintx.farintx_convert_rebate_amt%TYPE,
  r_rebate_percent          farintx.farintx_rebate_percent%TYPE,
  r_coas_code_rebate        farintx.farintx_coas_code_rebate%TYPE,
  r_fund_code_rebate        farintx.farintx_fund_code_rebate%TYPE,
  r_acct_code_ar_rebate     farintx.farintx_acct_code_ar_rebate%TYPE,
  r_user_id                 farintx.farintx_user_id%TYPE,
  r_data_origin             farintx.farintx_data_origin%TYPE,
  r_internal_record_id      gb_common.internal_record_id_type);

Business Entity record type


invoice_tax_ref

TYPE invoice_tax_ref IS REF CURSOR RETURN invoice_tax_rec;

Entity cursor variable type


invoice_tax_tab

TYPE invoice_tax_tab IS TABLE OF invoice_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_invh_code farintx.farintx_invh_code%TYPE DEFAULT NULL,
                  p_trat_code farintx.farintx_trat_code%TYPE DEFAULT NULL,
                  p_item      farintx.farintx_item%TYPE DEFAULT NULL,
                  p_seq_num   farintx.farintx_seq_num%TYPE DEFAULT NULL,
                  p_rowid     gb_common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18)

Returns
Y if found, otherwise N.


f_exists_data

Function f_exists_data(p_invh_code      farintx.farintx_invh_code%TYPE DEFAULT NULL,
                       p_trat_code      farintx.farintx_trat_code%TYPE DEFAULT NULL,
                       p_item           farintx.farintx_item%TYPE DEFAULT NULL,
                       p_seq_num        farintx.farintx_seq_num%TYPE DEFAULT NULL,
                       p_rowid          gb_common.internal_record_id_type DEFAULT NULL,
                       p_invtax_rec_out OUT invoice_tax_rec) RETURN BOOLEAN

Returns true if a record exists.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18)
p_invtax_rec_out   The out parameter that returns the invoice tax record.

Returns
TRUE if found, otherwise FALSE.


f_isequal

Function f_isequal(rec_one invoice_tax_rec, rec_two invoice_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 invoice_tax_rec Required
rec_two   The second record to compare. Type invoice_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_invh_code    farintx.farintx_invh_code%TYPE DEFAULT NULL,
                     p_trat_code    farintx.farintx_trat_code%TYPE DEFAULT NULL,
                     p_pay_tax_to   farintx.farintx_pay_tax_to%TYPE DEFAULT NULL,
                     p_item         farintx.farintx_item%TYPE DEFAULT NULL,
                     p_seq_num      farintx.farintx_seq_num%TYPE DEFAULT -999,
                     p_rucl_code    farintx.farintx_rucl_code%TYPE DEFAULT NULL,
                     p_priority_num farintx.farintx_priority_num%TYPE DEFAULT NULL,
                     p_rebate_ind   farintx.farintx_rebate_ind%TYPE DEFAULT NULL,
                     p_user_id      farintx.farintx_user_id%TYPE DEFAULT NULL,
                     p_data_origin  farintx.farintx_data_origin%TYPE DEFAULT NULL)
  RETURN invoice_tax_ref

Selects all records for the entity, invoice code, tax rate code, invoice item invoice accounting sequence, rucl code, pay tax to indicator, priority number, rebate indicator, user id or data origin.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_pay_tax_to   Indicates who the tax should be paid to. Valid values are T for Taxing Authority or V for Vendor. VARCHAR2(1) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4).
p_rucl_code   The code representing the tax liability rule class code. VARCHAR2(4)
p_priority_num   The priority on the Tax Rate Code (as defined in table FTVTRAT). NUMBER(2) Required
p_rebate_ind   Indicates if a rebate will be taken based on the tax rate (as defined in table FTVTRAT). If Y, then rebate will be processed. VARCHAR2(1)
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)

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


f_query_one

Function f_query_one(p_invh_code farintx.farintx_invh_code%TYPE,
                     p_trat_code farintx.farintx_trat_code%TYPE,
                     p_item      farintx.farintx_item%TYPE,
                     p_seq_num   farintx.farintx_seq_num%TYPE)
  RETURN invoice_tax_ref

Selects one record using unique columns.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)

Returns
A cursor variable that will fetch exactly one record.


f_query_one_rec

Function f_query_one_rec(p_invh_code_in farintx.farintx_invh_code%TYPE DEFAULT NULL,
                         p_trat_code_in farintx.farintx_trat_code%TYPE DEFAULT NULL,
                         p_item_in      farintx.farintx_item%TYPE DEFAULT NULL,
                         p_seq_num_in   farintx.farintx_seq_num%TYPE DEFAULT NULL,
                         p_rowid_in     gb_common.internal_record_id_type DEFAULT NULL)
  RETURN invoice_tax_rec

Returns one invoice tax record using rowid or unique columns.

Parameters
p_invh_code_in   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code_in   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_item_in   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num_in   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rowid_in   Database ROWID of the record to be selected.

Returns
The invoice header record.


f_query_by_rowid

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

Function f_query_one_string(p_invh_code       farintx.farintx_invh_code%TYPE DEFAULT NULL,
                            p_trat_code       farintx.farintx_trat_code%TYPE DEFAULT NULL,
                            p_item            farintx.farintx_item%TYPE DEFAULT NULL,
                            p_seq_num         farintx.farintx_seq_num%TYPE DEFAULT NULL,
                            p_rowid           gb_common.internal_record_id_type DEFAULT NULL,
                            p_separation_char VARCHAR2 DEFAULT ',')
  RETURN VARCHAR2

Returns all of the invoice tax data concatenated into a string in the invoice tax record using rowid or unique columns.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rowid   Database ROWID of the record to be selected.
p_separation_char   The character used to separate the column. Default is the comma character.

Returns
VARCHAR2.


f_query_one_lock

Function f_query_one_lock(p_invh_code           farintx.farintx_invh_code%TYPE,
                          p_trat_code           farintx.farintx_trat_code%TYPE,
                          p_tax_amt             farintx.farintx_tax_amt%TYPE,
                          p_pay_tax_to          farintx.farintx_pay_tax_to%TYPE,
                          p_item                farintx.farintx_item%TYPE,
                          p_seq_num             farintx.farintx_seq_num%TYPE,
                          p_rucl_code           farintx.farintx_rucl_code%TYPE,
                          p_priority_num        farintx.farintx_priority_num%TYPE,
                          p_taxable_amt         farintx.farintx_taxable_amt%TYPE,
                          p_rebate_ind          farintx.farintx_rebate_ind%TYPE,
                          p_convert_tax_amt     farintx.farintx_convert_tax_amt%TYPE,
                          p_trat_descrip        farintx.farintx_trat_descrip%TYPE,
                          p_rebate_amt          farintx.farintx_rebate_amt%TYPE,
                          p_convert_rebate_amt  farintx.farintx_convert_rebate_amt%TYPE,
                          p_rebate_percent      farintx.farintx_rebate_percent%TYPE,
                          p_coas_code_rebate    farintx.farintx_coas_code_rebate%TYPE,
                          p_fund_code_rebate    farintx.farintx_fund_code_rebate%TYPE,
                          p_acct_code_ar_rebate farintx.farintx_acct_code_ar_rebate%TYPE,
                          p_user_id             farintx.farintx_user_id%TYPE,
                          p_data_origin         farintx.farintx_data_origin%TYPE,
                          p_rowid               gb_common.internal_record_id_type)
  RETURN invoice_tax_ref

Selects one record and locks it.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_tax_amt   The calculated amount of tax for the tax code. NUMBER(17,2) Required
p_pay_tax_to   Indicates who the tax should be paid to. Valid values are T for Taxing Authority or V for Vendor. VARCHAR2(1) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rucl_code   The code representing the tax liability rule class code. VARCHAR2(4)
p_priority_num   The priority on the Tax Rate Code (as defined in table FTVTRAT). NUMBER(2) Required
p_taxable_amt   The amount of the item that is taxable based on indicators established for the tax rate (as defined in table FTVTRAT). This amount is multiplied by the tax rate to calculate the tax amount. NUMBER(17,2)
p_rebate_ind   Indicates if a rebate will be taken based on the tax rate (as defined in table FTVTRAT). If Y, then rebate will be processed. VARCHAR2(1)
p_convert_tax_amt   The tax amount (as entered in FARINTX_TAX_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_trat_descrip   The description of the tax rate code (as defined in table FTVTRAT). VARCHAR2(35)
p_rebate_amt   The amount of the calculated rebate. NUMBER(17,2)
p_convert_rebate_amt   The rebate amount (as entered in FARINTX_REBATE_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_rebate_percent   The rebate percentage on the tax rate code (as defined in table FTVTRAT) used to calculate the rebate. NUMBER(6,3)
p_coas_code_rebate   The Chart of Accounts code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_fund_code_rebate   The Fund code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_acct_code_ar_rebate   The A/R Account code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)
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_invh_code           farintx.farintx_invh_code%TYPE,
                   p_trat_code           farintx.farintx_trat_code%TYPE,
                   p_tax_amt             farintx.farintx_tax_amt%TYPE,
                   p_pay_tax_to          farintx.farintx_pay_tax_to%TYPE,
                   p_item                farintx.farintx_item%TYPE DEFAULT NULL,
                   p_seq_num             farintx.farintx_seq_num%TYPE DEFAULT NULL,
                   p_rucl_code           farintx.farintx_rucl_code%TYPE DEFAULT NULL,
                   p_priority_num        farintx.farintx_priority_num%TYPE,
                   p_taxable_amt         farintx.farintx_taxable_amt%TYPE DEFAULT NULL,
                   p_rebate_ind          farintx.farintx_rebate_ind%TYPE DEFAULT NULL,
                   p_convert_tax_amt     farintx.farintx_convert_tax_amt%TYPE DEFAULT NULL,
                   p_trat_descrip        farintx.farintx_trat_descrip%TYPE DEFAULT NULL,
                   p_rebate_amt          farintx.farintx_rebate_amt%TYPE DEFAULT NULL,
                   p_convert_rebate_amt  farintx.farintx_convert_rebate_amt%TYPE DEFAULT NULL,
                   p_rebate_percent      farintx.farintx_rebate_percent%TYPE DEFAULT NULL,
                   p_coas_code_rebate    farintx.farintx_coas_code_rebate%TYPE DEFAULT NULL,
                   p_fund_code_rebate    farintx.farintx_fund_code_rebate%TYPE DEFAULT NULL,
                   p_acct_code_ar_rebate farintx.farintx_acct_code_ar_rebate%TYPE DEFAULT NULL,
                   p_user_id             farintx.farintx_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_data_origin         farintx.farintx_data_origin%TYPE DEFAULT NULL,
                   p_rowid_out           OUT gb_common.internal_record_id_type)

Creates a record.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_tax_amt   The calculated amount of tax for the tax code. NUMBER(17,2) Required
p_pay_tax_to   Indicates who the tax should be paid to. Valid values are T for Taxing Authority or V for Vendor. VARCHAR2(1) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rucl_code   The code representing the tax liability rule class code. VARCHAR2(4)
p_priority_num   The priority on the Tax Rate Code (as defined in table FTVTRAT). NUMBER(2) Required
p_taxable_amt   The amount of the item that is taxable based on indicators established for the tax rate (as defined in table FTVTRAT). This amount is multiplied by the tax rate to calculate the tax amount. NUMBER(17,2)
p_rebate_ind   Indicates if a rebate will be taken based on the tax rate (as defined in table FTVTRAT). If Y, then rebate will be processed. VARCHAR2(1)
p_convert_tax_amt   The tax amount (as entered in FARINTX_TAX_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_trat_descrip   The description of the tax rate code (as defined in table FTVTRAT). VARCHAR2(35)
p_rebate_amt   The amount of the calculated rebate. NUMBER(17,2)
p_convert_rebate_amt   The rebate amount (as entered in FARINTX_REBATE_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_rebate_percent   The rebate percentage on the tax rate code (as defined in table FTVTRAT) used to calculate the rebate. NUMBER(6,3)
p_coas_code_rebate   The Chart of Accounts code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_fund_code_rebate   The Fund code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_acct_code_ar_rebate   The A/R Account code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)
p_rowid_out   Database ROWID of the record to be created. VARCHAR2(18) Required


p_delete

Procedure p_delete(p_invh_code           farintx.farintx_invh_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_trat_code           farintx.farintx_trat_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_tax_amt             farintx.farintx_tax_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_pay_tax_to          farintx.farintx_pay_tax_to%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_item                farintx.farintx_item%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_seq_num             farintx.farintx_seq_num%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_rucl_code           farintx.farintx_rucl_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_priority_num        farintx.farintx_priority_num%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_taxable_amt         farintx.farintx_taxable_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_rebate_ind          farintx.farintx_rebate_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_convert_tax_amt     farintx.farintx_convert_tax_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_trat_descrip        farintx.farintx_trat_descrip%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rebate_amt          farintx.farintx_rebate_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_convert_rebate_amt  farintx.farintx_convert_rebate_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_rebate_percent      farintx.farintx_rebate_percent%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_coas_code_rebate    farintx.farintx_coas_code_rebate%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_fund_code_rebate    farintx.farintx_fund_code_rebate%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_acct_code_ar_rebate farintx.farintx_acct_code_ar_rebate%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_user_id             farintx.farintx_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_data_origin         farintx.farintx_data_origin%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid               gb_common.internal_record_id_type)

Deletes a record.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_tax_amt   The calculated amount of tax for the tax code. NUMBER(17,2) Required
p_pay_tax_to   Indicates who the tax should be paid to. Valid values are T for Taxing Authority or V for Vendor. VARCHAR2(1) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rucl_code   The code representing the tax liability rule class code. VARCHAR2(4)
p_priority_num   The priority on the Tax Rate Code (as defined in table FTVTRAT). NUMBER(2) Required
p_taxable_amt   The amount of the item that is taxable based on indicators established for the tax rate (as defined in table FTVTRAT). This amount is multiplied by the tax rate to calculate the tax amount. NUMBER(17,2)
p_rebate_ind   Indicates if a rebate will be taken based on the tax rate (as defined in table FTVTRAT). If Y, then rebate will be processed. VARCHAR2(1)
p_convert_tax_amt   The tax amount (as entered in FARINTX_TAX_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_trat_descrip   The description of the tax rate code (as defined in table FTVTRAT). VARCHAR2(35)
p_rebate_amt   The amount of the calculated rebate. NUMBER(17,2)
p_convert_rebate_amt   The rebate amount (as entered in FARINTX_REBATE_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_rebate_percent   The rebate percentage on the tax rate code (as defined in table FTVTRAT) used to calculate the rebate. NUMBER(6,3)
p_coas_code_rebate   The Chart of Accounts code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_fund_code_rebate   The Fund code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_acct_code_ar_rebate   The A/R Account code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18)


p_lock

Procedure p_lock(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_rowid_inout   Database ROWID of the record to be locked. VARCHAR2(18) Required


p_update

Procedure p_update(p_invh_code           farintx.farintx_invh_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_trat_code           farintx.farintx_trat_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_tax_amt             farintx.farintx_tax_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_pay_tax_to          farintx.farintx_pay_tax_to%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_item                farintx.farintx_item%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_seq_num             farintx.farintx_seq_num%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_rucl_code           farintx.farintx_rucl_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_priority_num        farintx.farintx_priority_num%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_taxable_amt         farintx.farintx_taxable_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_rebate_ind          farintx.farintx_rebate_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_convert_tax_amt     farintx.farintx_convert_tax_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_trat_descrip        farintx.farintx_trat_descrip%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rebate_amt          farintx.farintx_rebate_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_convert_rebate_amt  farintx.farintx_convert_rebate_amt%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_rebate_percent      farintx.farintx_rebate_percent%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_coas_code_rebate    farintx.farintx_coas_code_rebate%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_fund_code_rebate    farintx.farintx_fund_code_rebate%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_acct_code_ar_rebate farintx.farintx_acct_code_ar_rebate%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_user_id             farintx.farintx_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_data_origin         farintx.farintx_data_origin%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid               gb_common.internal_record_id_type)

Updates a record.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_trat_code   The tax rate code (as defined in FTVTRAT) which is identified from the tax group entered for the invoice commodity record. VARCHAR2(4) Required
p_tax_amt   The calculated amount of tax for the tax code. NUMBER(17,2) Required
p_pay_tax_to   Indicates who the tax should be paid to. Valid values are T for Taxing Authority or V for Vendor. VARCHAR2(1) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_seq_num   The system-generated unique number associated with the accounting records item number (as entered in FARINVA_SEQ_NUM). NUMBER(4)
p_rucl_code   The code representing the tax liability rule class code. VARCHAR2(4)
p_priority_num   The priority on the Tax Rate Code (as defined in table FTVTRAT). NUMBER(2) Required
p_taxable_amt   The amount of the item that is taxable based on indicators established for the tax rate (as defined in table FTVTRAT). This amount is multiplied by the tax rate to calculate the tax amount. NUMBER(17,2)
p_rebate_ind   Indicates if a rebate will be taken based on the tax rate (as defined in table FTVTRAT). If Y, then rebate will be processed. VARCHAR2(1)
p_convert_tax_amt   The tax amount (as entered in FARINTX_TAX_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_trat_descrip   The description of the tax rate code (as defined in table FTVTRAT). VARCHAR2(35)
p_rebate_amt   The amount of the calculated rebate. NUMBER(17,2)
p_convert_rebate_amt   The rebate amount (as entered in FARINTX_REBATE_AMT) is calculated against the exchange rate of the currency code to derive this amount, in base currency. NUMBER(17,2)
p_rebate_percent   The rebate percentage on the tax rate code (as defined in table FTVTRAT) used to calculate the rebate. NUMBER(6,3)
p_coas_code_rebate   The Chart of Accounts code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_fund_code_rebate   The Fund code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_acct_code_ar_rebate   The A/R Account code on the tax rate (as defined in table FTVTRAT) that will be used for the processing of the rebate posting. VARCHAR2(6)
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)
p_rowid   Database ROWID of the record to be updated. VARCHAR2(18)


p_calc_and_create

Procedure p_calc_and_create(p_invh_code        farintx.farintx_invh_code%TYPE,
                            p_item             farinvc.farinvc_item%TYPE,
                            p_tgrp_code        ftvtgrp.ftvtgrp_tgrp_code%TYPE,
                            p_curr_code        fabinvh.fabinvh_curr_code%TYPE DEFAULT NULL,
                            p_trans_date       fabinvh.fabinvh_trans_date%TYPE,
                            p_vend_pidm        ftvvend.ftvvend_pidm%TYPE,
                            p_appr_qty         farinvc.farinvc_appr_qty%TYPE,
                            p_appr_unit_price  farinvc.farinvc_appr_unit_price%TYPE,
                            p_disc_amt         farinvc.farinvc_disc_amt%TYPE DEFAULT NULL,
                            p_addl_chrg_amt    farinvc.farinvc_addl_chrg_amt%TYPE DEFAULT NULL,
                            P_override_tax_amt farinvc.farinvc_override_tax_amt%TYPE DEFAULT NULL,
                            p_user_id          farintx.farintx_user_id%TYPE,
                            p_data_origin      farintx.farintx_data_origin%TYPE,
                            p_tax_amt_out      OUT farintx.farintx_tax_amt%TYPE)

Calculates the tax for an invoice item and creates all the farintx rows. This will be called when an invoice item is created.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4)
p_tgrp_code   The tax group code which is entered for the invoice commodity record. VARCHAR2(4) Required
p_curr_code   The foreign currency code as identified in the invoice header. VARCHAR2(4)
p_trans_date   The transaction date of the invoice. DATE Required
p_vend_pidm   The PIDM of the vendor on the invoice. NUMBER(8) Required
p_appr_qty   The approved quantity of the commodity on the invoice. NUMBER(8,2) Required
p_appr_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_chrg_amt   The amount of additional charge for the commodity. NUMBER(17,2) Required
p_override_tax_amt   The tax amount the user wants to use to override the calculated tax for the commodity. NUMBER(17,2) Required
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)
p_tax_amt_out   The calculated amount of tax for the commodity item. NUMBER(17,2) Required


p_create_by_sequence

Procedure p_create_by_sequence(p_invh_code   farintx.farintx_invh_code%TYPE,
                               p_item        farintx.farintx_item%TYPE,
                               p_seq_num     farinva.farinva_seq_num%TYPE DEFAULT NULL,
                               p_user_id     farintx.farintx_user_id%TYPE DEFAULT gb_common.f_sct_user,
                               p_data_origin farintx.farintx_data_origin%TYPE DEFAULT NULL)

Creates the farintx records for a particular accounting sequence.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_item   The unique sequence number directly associated with an invoice accounting record. NUMBER(4) Required
p_seq_num   The accounting sequence number directly associated with an invoice accounting record for commodity level accounting, or associated with the entire invoice in document level accounting. NUMBER(4) Required
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)


p_create_by_sequence

Procedure p_create_by_sequence(p_acctg_rec fb_invoice_acctg.invoice_acctg_rec)

Creates the farintx records for a particular accounting sequence. This will be used internally by the invoice accounting API.

Parameters
p_acctg_rec   A PL/SQL record of type, fb_invoice_acctg.invoice_acctg_rec


p_delete_by_item

Procedure p_delete_by_item(p_invh_code farintx.farintx_invh_code%TYPE,
                           p_item      farintx.farintx_item%TYPE)

Deletes all the farintx rows for a given commodity item.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4) Required


p_delete_internal

Procedure p_delete_internal(p_invh_code farintx.farintx_invh_code%TYPE)

Deletes all the farintx rows for a given invoice document.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required


p_delete_by_sequence

Procedure p_delete_by_sequence(p_invh_code farintx.farintx_invh_code%TYPE,
                               p_item      farintx.farintx_item%TYPE,
                               p_seq_num   farintx.farintx_seq_num%TYPE)

Deletes all the farintx rows for a given accounting sequence.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4) Required
p_seq_num   The accounting sequence number directly associated with an invoice commodity record for commodity level accounting, or associated with the entire invoice in document level accounting. NUMBER(4) Required


p_update_by_item

Procedure p_update_by_item(p_invh_code        farintx.farintx_invh_code%TYPE,
                           p_item             farintx.farintx_item%TYPE,
                           p_tax_amt          farintx.farintx_tax_amt%TYPE,
                           p_override_tax_amt farinvc.farinvc_override_tax_amt%TYPE,
                           p_user_id          farintx.farintx_user_id%TYPE DEFAULT gb_common.f_sct_user,
                           p_data_origin      farintx.farintx_data_origin%TYPE DEFAULT NULL)

This procedure can be used when a user overrides the calculated tax amount. This procedure then takes the difference and distributes it proportionately to the tax rates.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4) Required
p_tax_amt   The calculated tax for the commodity. NUMBER(17,2) Required
p_override_tax_amt   The tax amount the user wants to use to override the calculated tax for the commodity NUMBER(17,2) Required
p_user_id   The unique identification code of the user who created or last updated the invoice tax record. VARCHAR2(30)
p_data_origin   Identifies the origination of this invoice tax record. VARCHAR2(30)


f_get_tax_rebate

Function f_get_tax_rebate(p_invh_code farintx.farintx_invh_code%TYPE,
                          p_item      farintx.farintx_item%TYPE)
  RETURN NUMBER

This procedure can be used retrieve total tax rebate amount from commodity tax records. If commodity level accounting it return the total tax rebate of the item; if document level accounting it returns the total tax rebate of the whole invoice.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4) Required


f_get_tax_rebate

Function f_get_tax_rebate(p_invh_code farintx.farintx_invh_code%TYPE,
                          p_item      farintx.farintx_item%TYPE,
                          p_seq_num   farintx.farintx_seq_num%TYPE)
  RETURN NUMBER

This procedure can be used retrieve total tax rebate amount from a given accounting sequence.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required
p_item   The unique number directly associated with an invoice commodity record. NUMBER(4) Required
p_seq_num   The sequence number for the accounting record. NUMBER (4) Required.


f_calc_base_tax_amt

Function f_calc_base_tax_amt(p_trans_date      fabinvh.fabinvh_trans_date%TYPE,
                             p_tgrp_code       farinvc.farinvc_tgrp_code%TYPE,
                             p_vend_pidm       fabinvh.fabinvh_vend_pidm%TYPE,
                             p_appr_qty        farinvc.farinvc_appr_qty%TYPE,
                             p_appr_unit_price farinvc.farinvc_appr_unit_price%TYPE,
                             p_disc_amt        farinvc.farinvc_disc_amt%TYPE,
                             p_addl_chrg_amt   farinvc.farinvc_addl_chrg_amt%TYPE,
                             p_curr_code       fabinvh.fabinvh_curr_code%TYPE DEFAULT NULL)
  RETURN NUMBER

Calculates the original tax for an invoice item before any override.

Parameters
p_trans_date   The transaction date of the invoice. DATE Required
p_tgrp_code   The tax group code which is entered for the invoice commodity record. VARCHAR2(4) Required
p_vend_pidm   The PIDM of the vendor on the invoice. NUMBER(8) Required
p_appr_qty   The approved quantity of the commodity on the invoice. NUMBER(8,2) Required
p_appr_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_chrg_amt   The amount of additional charge for the commodity. NUMBER(17,2) Required
p_curr_code   The foreign currency code as identified in the invoice header. VARCHAR2(4)