index

Package BANINST1.fb_invoice_item_rules

Support subprograms for the INVOICE ITEM API (fb_invoice_item).


Program units
f_check_tolerance   Generate error message if approved amount exceed tolerance limit defined in fobprof for this user
f_get_accept_amt   Returns the result of received amount minus the rejected quantity of the Standing Purchase Order commodity when it is received in the receiving process via FPARCVD form.
f_get_accept_qty   Returns the result of received quantity minus the rejected quantity of the Purchase Order commodity
f_get_bo_amt   Returns the blanket order quantity for the Purchase Order commodity.
f_get_disc_amt   Returns the calculated discount amount.
f_get_encd_amt   Returns the approval unit price default value for an invoice referencing a General Encumbrance.
f_get_last_rcvr_ind   Returns the partial/final received indicator from the receiving table for the specific commodity referenced by the Purchase Order.
f_get_ordered_qty   Returns the quantity that has been ordered in the referencing Purchase Order for the item.
f_get_ordered_amt   Returns the amount (quantity * unit price) that has been ordered in the referencing Purchase Order for the item.
f_get_prev_addl_chrg_amt   Returns the remanining additional charges amount for the invoice item referencing a Purchase Order.
f_get_prev_paid_amt   Returns the previously paid amount on prior invoices referenced by the Purchase Order.
f_get_prev_paid_qty   Returns quantity that has been previously paid on prior invoices referenced by the Purchase Order.
p_validate   Validates and gets default values of a record to be inserted into the table.
p_validate_mandatory   Validates mandatory values of a record.
p_valid_delete   Validates all the data in the record for delete.
p_valid_update   Validates all the data in the record for update.
p_register_entity   Register the attribute value pairs to the message cache for delete operations.
p_register_entity   Register the attribute/value pairs to the message cache for create and update operations.

Constants
COMPLETE_OPERATION   This constant denotes the complete operation during the process level processing of a document (as opposed to the row level insert and update operation types) in Banner Finance.


COMPLETE_OPERATION

COMPLETE_OPERATION CONSTANT NUMBER := 9;

This constant denotes the complete operation during the process level processing of a document (as opposed to the row level insert and update operation types) in Banner Finance. It will be used to decide when to generate the error from fb_invoice_item_rules.p_check_tolerance.


f_check_tolerance

Function f_check_tolerance(p_user_id  fobprof.fobprof_user_id%TYPE,
                           p_item_rec fb_invoice_item.invoice_item_rec)
  RETURN VARCHAR2

Generate error message if approved amount exceed tolerance limit defined in fobprof for this user

Parameters
p_user_id   The unique identification code of the user who is creating or updating the invoice document. VARCHAR2(30) Required
p_item_rec   Invoice item row to be validated. Required


f_get_accept_amt

Function f_get_accept_amt(p_pohd_code farinvc.farinvc_pohd_code%TYPE,
                          p_po_item   farinvc.farinvc_po_item%TYPE)
  RETURN VARCHAR2

Returns the result of received amount minus the rejected quantity of the Standing Purchase Order commodity when it is received in the receiving process via FPARCVD form.  NUMBER(8,2)

Parameters
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key

Returns
The accepted amount.


f_get_accept_qty

Function f_get_accept_qty(p_pohd_code farinvc.farinvc_pohd_code%TYPE,
                          p_po_item   farinvc.farinvc_po_item%TYPE)
  RETURN VARCHAR2

Returns the result of received quantity minus the rejected quantity of the Purchase Order commodity

Parameters
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key

Returns
The accepted quantity.


f_get_bo_amt

Function f_get_bo_amt(p_invh_code farinvc.farinvc_invh_code%TYPE,
                      p_pohd_code farinvc.farinvc_pohd_code%TYPE,
                      p_po_item   farinvc.farinvc_po_item%TYPE DEFAULT NULL)
  RETURN VARCHAR2

Returns the blanket order quantity for the Purchase Order commodity.

Parameters
p_invh_code   The unique identifier  of the current Invoice document.  VARCHAR2(8) Required Key
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4)

Returns
The blanket order quantity.


f_get_disc_amt

Function f_get_disc_amt(p_disc_code    ftvdisc.ftvdisc_code%TYPE,
                        p_qty          farinvc.farinvc_appr_qty%TYPE,
                        p_amt          farinvc.farinvc_appr_unit_price%TYPE,
                        p_invoice_date fabinvh.fabinvh_invoice_date%type)
  RETURN VARCHAR2

Returns the calculated discount amount.

Parameters
p_disc_code   The discount code referenced in the Invoice VARCHAR2(8) Required Key
p_qty   The quantity that is approved for payment on this invoice item.  NUMBER(4) Required Key
p_amt   The unit price that is approved for payment on this invoice item. NUMBER(19,4)
p_invoice_date   A user-defined or system-generated Invoice date.  Basis of calculated discount percentage if discount code is used. DATE

Returns
The discount amount.


f_get_encd_amt

Function f_get_encd_amt(p_encd_num fgbencd.fgbencd_num%TYPE)
  RETURN VARCHAR2

Returns the approval unit price default value for an invoice referencing a General Encumbrance.

Parameters
p_encd_num   The General Encumbrance document number which is referenced on the Invoice VARCHAR2(8) Required Key

Returns
The approval unit price deafault amount.


f_get_last_rcvr_ind

Function f_get_last_rcvr_ind(p_pohd_code farinvc.farinvc_pohd_code%TYPE,
                             p_po_item   farinvc.farinvc_po_item%TYPE)
  RETURN VARCHAR2

Returns the partial/final received indicator from the receiving table for the specific commodity referenced by the Purchase Order.

Parameters
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key

Returns
The last receiver indicator.


f_get_ordered_qty

Function f_get_ordered_qty(p_pohd_code farinvc.farinvc_pohd_code%TYPE,
                           p_po_item   farinvc.farinvc_po_item%TYPE)
  RETURN VARCHAR2

Returns the quantity that has been ordered in the referencing Purchase Order for the item.

Parameters
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key

Returns
The Purchase order quantity.


f_get_ordered_amt

Function f_get_ordered_amt(p_pohd_code farinvc.farinvc_pohd_code%TYPE,
                           p_po_item   farinvc.farinvc_po_item%TYPE)
  RETURN VARCHAR2

Returns the amount (quantity * unit price) that has been ordered in the referencing Purchase Order for the item.

Parameters
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key

Returns
The Purchase order quantity.


f_get_prev_addl_chrg_amt

Function f_get_prev_addl_chrg_amt(p_invh_code     farinvc.farinvc_invh_code%TYPE,
                                  p_pohd_code     farinvc.farinvc_pohd_code%TYPE,
                                  p_po_item       farinvc.farinvc_po_item%TYPE,
                                  p_appr_required varchar2) RETURN VARCHAR2

Returns the remanining additional charges amount for the invoice item referencing a Purchase Order.

Parameters
p_invh_code   The unique identifier  of the current Invoice document.  VARCHAR2(8) Required Key
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key
p_appr_required   Indicator to include or exclude approval ind VARCHAR2(1)

Returns
The additional charges amount.


f_get_prev_paid_amt

Function f_get_prev_paid_amt(p_invh_code     farinvc.farinvc_invh_code%TYPE,
                             p_pohd_code     farinvc.farinvc_pohd_code%TYPE,
                             p_po_item       farinvc.farinvc_po_item%TYPE,
                             p_appr_required varchar2) RETURN VARCHAR2

Returns the previously paid amount on prior invoices referenced by the Purchase Order.

Parameters
p_invh_code   The unique identifier of the current Invoice document. VARCHAR2(8) Required Key
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key
p_appr_required   Indicator to include or exclude approval ind VARCHAR2(1)

Returns
The previously paid amount.


f_get_prev_paid_qty

Function f_get_prev_paid_qty(p_invh_code     farinvc.farinvc_invh_code%TYPE,
                             p_pohd_code     farinvc.farinvc_pohd_code%TYPE,
                             p_po_item       farinvc.farinvc_po_item%TYPE,
                             p_appr_required varchar2) RETURN VARCHAR2

Returns quantity that has been previously paid on prior invoices referenced by the Purchase Order.

Parameters
p_invh_code   The unique identifier of the current Invoice document. VARCHAR2(8) Required Key
p_pohd_code   The Purchase Order document number which is referenced on the Invoice VARCHAR2(8) Required Key
p_po_item   The unique sequence number directly associated with a Purchase Order item commodity record. NUMBER(4) Required Key
p_appr_required   Indicator to include or exclude approval ind VARCHAR2(1)

Returns
The previously paid quantity.


p_validate

Procedure p_validate(p_item_rec_inout IN OUT fb_invoice_item.invoice_item_rec,
                     p_existing_rec   fb_invoice_item.invoice_item_rec,
                     p_operation_type NUMBER DEFAULT gb_event.CREATE_OPERATION,
                     p_error_msg_out  OUT gb_common_strings.err_type)

Validates and gets default values of a record to be inserted into the table.
Also validates all the data in the record for updates that occur before the document is completed and approved.

Parameters
p_item_rec_inout   Invoice item row to be validated.
p_existing_rec   Invoice item row existing.
p_operation_type   Type of operation, create or update, to be validated. NUMBER
p_error_msg_out   The error message generated by the validation procedure. Required


p_validate_mandatory

Procedure p_validate_mandatory(p_item_rec        fb_invoice_item.invoice_item_rec,
                               p_error_msg_inout IN OUT gb_common_strings.err_type)

Validates mandatory values of a record.

Parameters
p_item_rec   Invoice item row to be validated.
p_error_msg_inout   The error message generated by the validation procedure. Required


p_valid_delete

Procedure p_valid_delete(p_invh_code         farinvc.farinvc_invh_code%TYPE,
                         p_item              farinvc.farinvc_item%TYPE,
                         p_user_id           farinvc.farinvc_user_id%type default gb_common.f_sct_user,
                         p_rowid_inout       IN OUT gb_common.internal_record_id_type,
                         p_error_message_out OUT gb_common_strings.err_type)

Validates all the data in the record for delete.
 This will also delete the associated commodity and accounting tax records.

Parameters
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required Key
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4) Required Key
p_user_id   The unique identification code of the user who has the authority to delete the Invoice document. VARCHAR2(30) Required
p_rowid_inout   Database ROWID of the record to be selected. VARCHAR2(18)
p_error_message_out   The error message generated by the validation procedure.


p_valid_update

Procedure p_valid_update(p_item_rec_inout IN OUT fb_invoice_item.invoice_item_rec,
                         p_existing_rec   fb_invoice_item.invoice_item_rec,
                         p_error_msg_out  OUT gb_common_strings.err_type)

Validates all the data in the record for update.

Parameters
p_item_rec_inout   Invoice item row to be validated.
p_existing_rec   Invoice item row existing.
p_error_msg_out   The error message generated by the validation procedure. Required


p_register_entity

Procedure p_register_entity(p_operation_type     NUMBER,
                            p_internal_record_id gb_common.internal_record_id_type)

Register the attribute value pairs to the message cache for delete operations.
This signature uses the ROWID only, for the delete operations.

Parameters
p_operation_type   Type of DML operation: create,update,delete. NUMBER Required
p_internal_record_id   Database ROWID VARCHAR2(18) required


p_register_entity

Procedure p_register_entity(p_operation_type        NUMBER,
                            p_invh_code             farinvc.farinvc_invh_code%TYPE,
                            p_pohd_code             farinvc.farinvc_pohd_code%TYPE,
                            p_item                  farinvc.farinvc_item%TYPE,
                            p_po_item               farinvc.farinvc_po_item%TYPE,
                            p_open_paid_ind         farinvc.farinvc_open_paid_ind%TYPE,
                            p_user_id               farinvc.farinvc_user_id%TYPE DEFAULT gb_common.f_sct_user,
                            p_comm_code             farinvc.farinvc_comm_code%TYPE,
                            p_comm_desc             farinvc.farinvc_comm_desc%TYPE,
                            p_uoms_code             farinvc.farinvc_uoms_code%TYPE,
                            p_adjt_code             farinvc.farinvc_adjt_code%TYPE,
                            p_adjt_date             farinvc.farinvc_adjt_date%TYPE,
                            p_part_pmt_ind          farinvc.farinvc_part_pmt_ind%TYPE,
                            p_prev_paid_qty         farinvc.farinvc_prev_paid_qty%TYPE,
                            p_recvd_qty             farinvc.farinvc_recvd_qty%TYPE,
                            p_invd_unit_price       farinvc.farinvc_invd_unit_price%TYPE,
                            p_invd_qty              farinvc.farinvc_invd_qty%TYPE,
                            p_accept_qty            farinvc.farinvc_accept_qty%TYPE,
                            p_accept_unit_price     farinvc.farinvc_accept_unit_price%TYPE,
                            p_disc_amt              farinvc.farinvc_disc_amt%TYPE,
                            p_tax_amt               farinvc.farinvc_tax_amt%TYPE,
                            p_appr_qty              farinvc.farinvc_appr_qty%TYPE,
                            p_appr_unit_price       farinvc.farinvc_appr_unit_price%TYPE,
                            p_tol_override_ind      farinvc.farinvc_tol_override_ind%TYPE,
                            p_hold_ind              farinvc.farinvc_hold_ind%TYPE,
                            p_susp_ind              farinvc.farinvc_susp_ind%TYPE,
                            p_ttag_num              farinvc.farinvc_ttag_num%TYPE,
                            p_addl_chrg_amt         farinvc.farinvc_addl_chrg_amt%TYPE,
                            p_convert_unit_price    farinvc.farinvc_convert_unit_price%TYPE,
                            p_convert_disc_amt      farinvc.farinvc_convert_disc_amt%TYPE,
                            p_convert_tax_amt       farinvc.farinvc_convert_tax_amt%TYPE,
                            p_convert_addl_chrg_amt farinvc.farinvc_convert_addl_chrg_amt%TYPE,
                            p_tgrp_code             farinvc.farinvc_tgrp_code%TYPE,
                            p_tag_cap_code          farinvc.farinvc_tag_cap_code%TYPE,
                            p_vend_inv_code         farinvc.farinvc_vend_inv_code%TYPE,
                            p_vend_inv_date         farinvc.farinvc_vend_inv_date%TYPE,
                            p_vend_inv_item         farinvc.farinvc_vend_inv_item%TYPE,
                            p_prev_amt              farinvc.farinvc_prev_amt%TYPE,
                            p_desc_chge_ind         farinvc.farinvc_desc_chge_ind%TYPE,
                            p_last_rcvr_ind         farinvc.farinvc_last_rcvr_ind%TYPE,
                            p_override_tax_amt      farinvc.farinvc_override_tax_amt%TYPE,
                            p_data_origin           farinvc.farinvc_data_origin%TYPE,
                            p_create_user           farinvc.farinvc_create_user%TYPE DEFAULT gb_common.f_sct_user,
                            p_create_date           farinvc.farinvc_create_date%TYPE,
                            p_internal_record_id    gb_common.internal_record_id_type)

Register the attribute/value pairs to the message cache for create and update operations.
 
This signature registers all parameters.

Parameters
p_operation_type   Type of DML operation: create,update,delete. NUMBER Required
p_invh_code   The unique identifier of an Invoice document. VARCHAR2(8) Required Key
p_pohd_code   The Purchase Order or General Encumbrance document number which is referenced on the Invoice, if any.  Only populated for Regular or General Encumbrance Invoice types. VARCHAR2(8)
p_item   The unique sequence number directly associated with an invoice commodity record. NUMBER(4) Required Key
p_po_item   The item number of the Purchase Order that is referenced by this invoice item. NUMBER(4)
p_open_paid_ind   Indicates whether a PO item number is open (O) or paid (P). VARCHAR2(1) Required
p_user_id   The unique identification code of the user who last updated the Invoice document. VARCHAR2(30) Required
p_comm_code   The user-defined commodity code associated with this invoice item. VARCHAR2(10)
p_comm_desc   The user-defined commodity description for this invoice item. VARCHAR2(50)
p_uoms_code   The unit-of-measure code (as defined in table FTVUOMS) applicable to the invoice item. VARCHAR2(4)
p_adjt_code   This column is not currently used by the Banner Finance application. VARCHAR2(2)
p_adjt_date   This column is not currently used by the Banner Finance application. DATE
p_part_pmt_ind   Indicates if related PO item will be final liquidated and closed.  If F, then item will be closed. VARCHAR2(1)
p_prev_paid_qty   Cumulative total of previously invoiced quantities for related PO item. NUMBER(8,2)
p_recvd_qty   Cumulative total of previously received quantities for related PO item.  This field is used only by the EDI process. NUMBER(8,2)
p_invd_unit_price   The unit price of this invoice item referenced from the invoice sent by the vendor. NUMBER(19,4)
p_invd_qty   The quantity of this invoice item referenced from the invoice sent by the vendor. NUMBER(8,2)
p_accept_qty   This calculated number is the received quantity minus the rejected quantity. This number is displayed if the Regular Purchase Order commodity was received in the receiving process via FPARCVD form. If no receiving has been entered then the user may manually populate the field.  For invoice documents against Standing Order Purchase Order the default value is 1. NUMBER(8,2)
p_accept_unit_price   This value will default from the Purchase Order unit price for Regular Purchase Orders.  For Standing Purchase Orders the value will default to 0 but may be overridden by the user. NUMBER(19,4)
p_disc_amt   The amount representing the discount.  This value may default from the discount code.  If a discount code is not entered or defaulted from the vendor, the discount amount may be manually entered. NUMBER(17,2)
p_tax_amt   The system-calculated tax amount that is derived from the entered or defaulted tax group. NUMBER(17,2)
p_appr_qty   The quantity that is approved for payment on this invoice item. NUMBER(8,2)
p_appr_unit_price   The unit price that is approved for payment on this invoice item. NUMBER(19,4)
p_tol_override_ind   Indicates that the total approved amount of the invoice item can exceed the tolerance percent or amount set for the user on the form FOMPROF. If Y, then tolerance checking is overridden. User must have permission to invoke override on the form FOMPROF. VARCHAR2(1)
p_hold_ind   Indicates that the Invoice item has been placed on hold to prevent payment to a vendor.  Indicator is set via the FAAINVE or FAAPAYC forms.  If Y, the document will be withheld from the payment process. VARCHAR2(1) Required
p_susp_ind   Indicates to the user that a document is being held in suspense due to missing or erroneous data content. VARCHAR2(1) Required
p_ttag_num   This column is not currently used by the Banner Finance application. VARCHAR2(9)
p_addl_chrg_amt   The amount of additional charges for this invoice item. NUMBER(17,2)
p_convert_unit_price   The unit price of the item is calculated against the exchange rate of the currency code to derive this amount in base currency. NUMBER(19,4)
p_convert_disc_amt   The discount amount of the item is calculated against the exchange rate of the currency code to derive this amount in base currency. NUMBER(17,2)
p_convert_tax_amt   The tax amount of the item is calculated against the exchange rate of the currency code to derive this amount in base currency. NUMBER(17,2)
p_convert_addl_chrg_amt   The additional amount of the item is calculated against the exchange rate of the currency code to derive this amount in base currency. NUMBER(17,2)
p_tgrp_code   The tax group code (as defined in table FTVTGRP) referenced in the invoice item and used in the calculation of taxes. VARCHAR2(4)
p_tag_cap_code   System derived code which indicates if invoice item should be tagged and/or capitalized. Valid values are T if the item is to be tagged, C if the item is to be capitalized, and N if the item should not be tagged or capitalized. VARCHAR2(1)
p_vend_inv_code   The Invoice number as supplied by the vendor for this invoice item. VARCHAR2(15)
p_vend_inv_date   The date of the invoice sent by the vendor. DATE
p_vend_inv_item   The item number of the invoice item within a specific vendor invoice. NUMBER(4)
p_prev_amt   Cumulative total of previously invoiced quantities within specific vendor invoice. NUMBER(17,2)
p_desc_chge_ind   Indicates when the default commodity description for the commodity code has been overwritten for the invoice item.  If Y, then default commodity description has been overwritten. VARCHAR2(1)
p_last_rcvr_ind   Indicates the status of the last receiver for a PO item when the invoice was processed. If F, then the commodity has been Final Received.  This value is populated based on the status of the last receiving document for the referenced PO. VARCHAR2(1)
p_override_tax_amt   The amount by which tax is overridden for each commodity. NUMBER(17,2)
p_data_origin   Source system that last created or updated the data. VARCHAR2(30)
p_create_user   The Banner User ID which created this invoice item record. VARCHAR2(30)
p_create_date   The date on which this invoice item was first created. DATE
p_internal_record_id   Database ROWID VARCHAR2(18) required