Understanding the Billing Interface Process Main Processing Logic

This section discusses the Billing Interface program processing steps and their sequence. The headings are listed in the following format: AE_PROGRAM_NAME.SECTION.STEP.

This step performs initialization, including:

  • Retrieving run control parameters.

  • Checking for existing Billing Interface processes.

  • Inserting a record into the Billing interface process control table INTFC_BI_PROC.

  • Retrieving some PeopleSoft Billing installation options.

  • Selecting UPD as the processing status for the interface record.

  • Inserting, or updating if one already exists, the run control record for the Billing VAT Defaulting process (BIPVAT00) with the user's parameter settings.

This step copies Billing interface records from main staging tables to their respective temporary tables for processing:

Copies From

Copies To

INTFC_BI

INTFC_BI_TAOnn

INTFC_BI_AEDS

INTFC_BIA_TAOnn

INTFC_BI2

INTFC_BI2_TAOnn

INTFC_BI_NOTE

INTFC_BIN_TAOnn

INTFC_BI_HDR

INTFC_BIH_TAOnn

INTFC_EXSD

INTFC_BIE_TAO

INTFC_BI_TAX

INTFC_BIT_TAOnn

This step provides defaults for some common definitional fields, such as general ledger (GL) business units, GL level options, base currency code, ChartFields, currency rate sources, VAT defaults (such as VAT reporting country, customer's VAT registration country, VAT treatment group), and bill-by IDs.

This step performs target invoicing edits, including the bill status of a target invoice and no adjustments for target invoicing. This step also performs edit check for bill-by fields.

This step edits the data in the interface tables for billing business rule compliance and data integrity. This step also ensures that transactions are ready to be billed.

This step performs bill creation. This is the main processing step of the Billing Interface program and is discussed in detail later in this section.

This step writes back critical field values from the Billing interface temporary tables to the Billing interface main staging tables and updates the Billing interface main staging tables with error statuses and error messages for interface records.

This step calculates processing statistics for the Billing Interface process, such as the number of lines in error, the number of new bill headers created, and the number of bill lines created; these statistics are then logged into a message log.

This step deletes INTFC_BI_PROC, the Billing interface process control record.

This step calls the MAINPROC section, which is the main processing step of the Billing Interface program.

BIIF0001.MAINPROC.NEWHDRS

This step:

  1. Inserts one row of data into INTFC_BI_HTMPnn for every new bill header that the system needs to generate, as determined by the bill-by options.

    The data supplied to the interface table represents bill line level data that the system must add to a bill. The system uses the bill-by definition to establish whether it can add the line activity to an existing bill. If an appropriate bill does not already exist, the system generates a new bill header.

    The interface process dynamically builds an INSERT/SELECT Structured Query Language (SQL) statement for each distinct bill-by identifier appearing by default in the interface table, and then runs the statement. For each bill-by identifier, the SQL statement inserts a row into INTFC_BI_HTMPnn for each new bill header that the system generates. The SQL that is generated has the following structure, with columns c1, c2, c3... representing the bill-by columns:

    INSERT into PS_INTFC_BI_HTMPnn( .. , .. , .. , .. , ...)
    SELECT .. , .. , .. , .. FROM PS_INTFC_BI  
    WHERE INTFC_ID BETWEEN ... AND ...  
    AND NOT EXISTS
    SELECT INVOICE FROM PS_BI_HDR 
    WHERE PS_BI_HDR.c1 = PS_INTFC_BI.c1 
     AND PS_BI_HDR.c2 = PS_INTFC_BI.c2 
     AND PS_BI_HDR.c3 = PS_INTFC_BI.c3 
    GROUP BY PS_INTFC_BI.c1, PS_INTFC_BI.c2, PS_INTFC_BI.c3, . , 
    

    Note: FUNCLIB_BIINTFC.BILL_BY_ID.FieldFormula PeopleCode contains all logic related to building the dynamic SQL.

    The system treats the following fields as bill-by fields, even though they may not be part of the bill-by definition.

    Note: If on the Installation Options - Billing - General Options page you define the invoice numbering at the bill source level, the system also adds BILL_SOURCE_ID as an implicit bill-by field.

    • BUSINESS_UNIT

    • BILL_TO_CUST_ID

    • BILL_TYPE_ID

    • BILL_SOURCE_ID (if invoice numbering is set to source)

    • BI_CURRENCY_CD

    • HDR_FIELDS_KEY

    • BUSINESS_UNIT_TO

    • *COUNTRY_SHIP_FROM

    • *COUNTRY_SHIP_TO

    • *COUNTRY_VAT_BILLFR

    • *COUNTRY_VAT_BILLTO

    • *VAT_TREATMENT_GRP

    *These fields are added to the implicit bill-by fields for those transactions subject to VAT tax.

  2. Inserts one row of data into the INTFC_BI_HTMPnn temporary table for every new bill header that is needed for a target invoice.

    You can use a target invoice to specify the invoice number to which the lines should be added.

    If the target invoice does not yet exist, the interface inserts a row into the header temporary table INTFC_BI_HTMPnn.

  3. Inserts one row into the header temporary table for every rebill adjustment transaction line (AHDR/RBALL).

    The only bill-by options that are used when creating a rebill adjustment of this nature are bill status options.

BIIF0001.MAINPROC.HDRDFTS

This step updates new bill header information in INTFC_BI_HTMPnn temp table with default data from:

  • InterUnit setup defaults (InterUnit and IntraUnit bills only).

  • Customer defaults.

  • Bill source defaults.

  • Bill type defaults.

  • Business unit defaults.

When the system inserts new bill headers into the header temporary table, it enables data such as payment terms, payment method, and remit-to to appear by default in INTFC_BI_HTMPnn from customer, bill source, bill type, business unit, and system-wide billing installation options.

BIIF0001.MAINPROC.INSCRALL

This step inserts a row into the header temporary INTFC_BI_HTMPnn for every credit bill transaction (AHDR/CRALL). Header defaults are applied before the interface inserts the credit rows, which preserves the values of the credit bill and ensures that the credit bill is an exact reversal of the bill being adjusted. For credit adjustments of fully paid invoices, the payment reference is set to unpaid and the paid at source is set to no.

See Processing Adjustments Through the Billing Interface.

BIIF0001.MAINPROC.HDRDFTS2

This step updates new bill header information in the INTFC_BI_HTMPnn temporary table with system-level default data such as AR options, GL options, and current currency rate type. The invoice numbering default is also applied from either the system, bill source, bill type, or business unit level.

BIIF0001.MAINPROC.BILLSTAT

This step updates new bill headers with the appropriate bill status. The bill status is usually determined according to the Bill By Identifier page by the value that you select in the New Bill Status group box. The bill status can also be determined by direct invoicing, temporary bill flag, billing frequency, and line type.

See Using the Bill-By Identifier with the Billing Interface.

BIIF0001.MAINPROC.ASGN_IVC

This step:

  1. Determines how many new invoice numbers need to be checked out for each invoice number ID.

    The interface reserves the number needed by updating the BI_IVC_NUM table.

  2. Assigns the new invoice numbers to regular bill headers in INTFC_BI_HTMPnn.

BIIF0001.MAINPROC.ADJHDPTR

This step selects adjustments of type CRALL and RBALL in INTFC_BI_HTMPnn. For these bills, this step assigns cross-reference invoice and line numbers.

BIIF0001.MAINPROC.ADJHDUPD

This step selects the headers from INTFC_BI_HTMPnn that have a full bill credit, and updates the ADJUSTED_FLAG and NEXT references.

BIIF0001.MAINPROC.INS_DTMP

This step inserts a row for every distinct discount or surcharge level for each charge line into temporary table INTFC_BI_DTMPnn.

For example, if the system is processing a charge line in the interface table with two related level-one discounts and a level two discount, the system inserts two rows into INTFC_BI_DTMPnn, enabling it to keep track of discount or surcharge level subtotals. When it has calculated the discount or surcharge totals, the system populates BI_LINE_DS_LVL from INTFC_BI_DTMPnn and populates BI_LINE_DS_DTL from INTFC_BIA_TAOnn.

BIIF0001.MAINPROC.INSBILLS

This step inserts bill headers into BI_HDR, selecting from INTFC_BI_HTMPnn. For rebill adjustments of fully paid invoices, the Payment Reference field is deselected and the Paid at Source field is set to unpaid. The Invoiced Delivered field is initialized to no.

BIIF0001.MAINPROC.ASGNPVN

This step will assign the next PVN (Public Voucher Number) to those bill lines that are sourced from the PeopleSoft Contracts module that have a PVN generation level assigned.

BIIF0001.MAINPROC.ASGNIVC5 and BIIF0001.MAINPROC.ASGNVIVC

This step assigns the invoice numbers to each LINE transaction in INTFC_BI_TAOnn. When the system processes the bill headers (and consolidated bill headers), this step evaluates the line charge detail and evaluates the invoice to which the lines belong. At this point in the process, every line processed should have a bill to which it can belong.

BIIF0001.MAINPROC.UPSUMIVC

This step sets the invoice summarization flag to Yes on the bill header for the new invoices that require summarization

BIIF0001.MAINPROC.MAINCONS

This step:

  1. Inserts a row into INTFC_BI_CTMPnn for each new consolidated bill header that it generates.

    The interface process supports consolidated billing. The system automatically consolidates bills through the interface for bill-to customers who have consolidation data defined on the Customer Information > General Information > General Info page.

    This step also determines how many new consolidated invoice numbers need to be checked out for each invoice number ID. The interface reserves the number needed by updating the BI_IVC_NUM table. For example, if 100 new invoice numbers are needed for a particular invoice number ID, this procedure increments the BI_IVC_NUM table by 100 to reserve the amount of new invoice numbers needed.

  2. Updates new consolidated bill headers in INTFC_BI_CTMPnn with customer-level defaults and invoice numbers, and inserts them into the bill header table.

    By the time the system inserts new consolidated bill headers into BI_HDR, at least one consolidated bill header should exist to which the system can attach each new bill header in INTFC_BI_HTMPnn, if appropriate.

See Generating Consolidated Billing Through the Billing Interface.

See Adding General Customer Information.

BIIF0001.MAINPROC.CONS2HDR and BIIF0001.MAINPROC.CONSAHDR

This step associates regular bill headers with appropriate consolidated bill headers.

BIIF0001.MAINPROC.NEWSTAT

This step updates the bill status from RDY to NEW for installment invoices, recurring invoices, or invoices containing freight surcharge or miscellaneous charges and with no ship-to address number.

BIIF0001.MAINPROC.LINESEQ

This step evaluates the line charge detail and:

  • Assigns a line sequence number to the interface lines.

  • Assigns line distribution sequence numbers to the accounting entries for the interface lines.

  • Assigns note sequence numbers to header and line notes.

  • Calculates discounts and surcharges and updates discount or surcharge subtotals.

BIIF0001.MAINPROC.LSTIVCSQ

This step updates the last line sequence number on the bill header.

BIIF0001.MAINPROC.ADJ_IVC

This step evaluates the line charge detail and performs these tasks on adjustment invoices:

  • Determines the invoice to which the lines belong.

    (At this point in the process, every line processed should have a bill to which it can belong).

  • Assigns a line sequence number to the interface line.

  • Assigns line distribution sequence numbers to the accounting entries for the interface line.

  • Assigns note sequence numbers to header and line notes.

  • Calculates discounts and surcharges and updates discount or surcharge subtotals.

BIIF0001.MAINPROC.POPIUAES

This step supplies accounting entries for InterUnit and IntraUnit bills, acquiring values from the central InterUnit and IntraUnit setup tables.

BIIF0001.MAINPROC.AFFLDFLT

This step supplies the affiliate value on accounting distributions.

BIIF0001.MAINPROC.DAPP

This step consolidates all deposit-applied lines (line type of DAPP), that have the same deposit ID and that will go into the same invoice, into one deposit-applied line to be saved in BI_LINE.

BIIF0001.MAINPROC.NEWLINES

This step inserts line data into a temporary line so that default values can be applied.

BIIF0001.MAINPROC.LINEDFTS

This step updates bill line temporary tables to supply line default values and:

  • Applies customer default values to lines in the temporary table BI_ILINE_TAOnn.

  • Applies business unit default values to lines in the temporary table BI_ILINE_TAOnn.

  • Populates the temporary line table with adjustment lines that are bill reversals (CRALL), unchanged rebill lines (RBALL), and line reversals (CRLIN).

  • Populates the temporary line table with adjustment lines, and updates adjustment history references for bill lines.

BIIF0001.MAINPROC.INSLINES

This step inserts the interface table data into the bill data structure.

BIIF0001.MAINPROC.TOTHDRS

This step:

  1. Selects all bills affected by inserting new bill lines, and updates their totals to reflect the new activity added to them.

  2. Updates consolidated invoice pretax invoice amount by summing all attached invoice pretax invoice amounts.

  3. Calculates the TAX_AMT total.

BIIF0001.MAINPROC.TOTHDREX

This step accumulates excise, sales tax, or VAT amounts from bill lines and updates the total excise, total sales tax, or total VAT amounts onto bill header. These VAT amounts apply to India only.

BIIF0001.MAINPROC.UPBIPAID

This step updates the paid at source flag if at least one invoice line exists for the bill with a deposit applied line.

BIIF0001.MAINPROC.UPSUMFLG

This step sets the invoice summarization flag to Yes on the bill header for the already existing invoices that require summarization

BIIF0001.MAINPROC.UPDVATDF

This step sets the bill header VAT defaulting option to L to indicate that new lines are appended to an existing VAT invoice. Setting the bill header VAT defaulting option to L causes VAT defaults to be reapplied.

BIIF0001.MAINPROC.UPPCSTAT

This step enables the PC_DISTRIB_STATUS value to appear by default in the BI_HDR table, based on bill lines of the invoice. The values that are assigned control processing that is related to the integration with PeopleSoft Contracts and Project Costing applications.

BIIF0001.MAINPROC.INV_TYPE

This step:

  1. Updates the invoice type to RAD (regular with adjustments) for any bill headers that had line adjustments added to them.

  2. Updates the invoice type to RAD (regular with adjustments) for any bill headers that originally contained only adjustment lines but have had regular lines added to them.

BIIF0001.MAINPROC.DRILBACK

This step:

  1. Updates the IN_DEMAND_BI table with the invoice number and invoice line sequence number for activity from PeopleSoft Order Management and Inventory.

  2. Updates the CA_BP_XREF table with the invoice number for activity from PeopleSoft Contracts.

  3. Updates the BI_ADJ_GRP_LINE table with the invoice number and invoice line sequence number for activity from the return material authorization features of PeopleSoft Order Management or PeopleSoft Inventory.

BIIF0001.MAINPROC.RESETPI

This step updates process instance with zero for newly inserted headers in the BI_HDR table.

BIIF0001.MAINPROC.MOVE2CMP

This step:

  1. Moves the records from the temporary Billing interface staging tables—INTFC_BI_TAOnn, INTFC_BIA_TAOnn, INTFC_BI2_TAOnn, INTFC_BIN_TAOnn, and INTFC_BIH_TAOnn—to their respective archiving tables: INTFC_BI_CMP, INTFC_BI_AD_CMP, INTFC_BI2_CMP, INTFC_BI_NT_CMP, and INTFC_BI_HDRCMP.

  2. After archiving is complete, deletes those records from the Billing interface tables that were moved to the archiving tables.