Understanding Invoice Programming

PeopleSoft provides two methods for programming invoice forms, SQR and BI Publisher Reports. The SQR invoices combine processing and printing into a single, modular program. You can create and modify SQR invoices with any appropriate program editor or development environment. BI Publisher is a java-based reporting technology. The BI Publisher invoices separate data selection and processing from formatting and printing. Data selection and processing are handled by Application Engine programs; formatting and printing are handled by report definitions or templates. Report templates can be modified using common desktop applications, such as Microsoft Word and Adobe Acrobat.

Invoice programs operate on the data in the Billing extract tables. The Billing Invoice Extract Process (BI_IVCEXT) extracts the invoice data and stores it in the Billing extract tables. In addition, control information is provided by the run control record. An invoice program must select only the data it can process. The following criteria is typically used to select the rows from the extract tables that an invoice program or report is capable of processing:

Term

Definition

PROCESS_INSTANCE

A process instance number is assigned to each extract row by BI_IVCEXT when a print job is run. The process instance number that an invoice program should select is available in the run control record.

CONSOL_HDR (consolidated header)

Y (yes) for consolidated invoices.

INVOICE_FORM_ID

The id of the invoice form as defined on the Invoice Formatting Options page.

PAGE_ORIENTATION

P (portrait) or L (landscape) for SQR invoices; X for BI Publisher.

SUM_IVC_PRINT_OPT (summarized invoice print option)

Whether an invoice should be printed in the detail or summarized formats, or both formats.

  • DETL (detail).

  • SUM (summarized).

    Only summarized invoice programs should select invoices with a SUM setting.

  • BOTH.

ACCEPTGIRO_IND

Only acceptgiro invoice programs should select invoices with a Y (yes) setting.

PeopleSoft writes its processes in a modular fashion to facilitate modification. Routines that are common to all invoice printing processes are isolated into modules that are shared by multiple processes. Routines that you are most likely to modify are organized into groups of similar modules. Use an existing program as the template and substitute modules as appropriate.

There are, however, several areas of significance where the programs differ from each other:

  • The extract program BI_IVCEXT performs all processing that is required to print an invoice and places the results in a set of extract tables.

    BI_IVCEXT does not print the invoice. PeopleSoft delivers SQR and BI Publisher reports to print invoices using the data in the extract tables. You can also customize the system to use any compatible report writer program to print invoices from this data.

  • The logic that is used to select bills for processing differs for SQRs and BI Publisher reports.

    For standard SQR invoices, member BIIVCNON.SQC selects the bill activity. For consolidated SQR invoices, member BIIVCCON.SQC selects the bill activity. For BI Publisher, bill activity is selected by SQL objects in Application Designer; SQL.BI_EXTRCT for non-consolidated invoices and SQL.BI_EXT_CONS for consolidated invoices.

  • All common steps that involve a print command are included in BIIVCSQR.SQC and are only used in the SQR invoices.

  • Printer definitions and declarations are specific to page orientation. Appropriate modules are included in each program.

  • Generally, for SQR invoices, portrait and landscape versions of the program support multiple invoice layouts.

    The appropriate set of print routines for these layouts and the supporting column definitions are included by page orientation. For instance, the sample RIGHTSTUB layout is of portrait orientation, so the routines for RIGHTSTUB printing are included in the portrait invoice print processes for standard and consolidated invoice printing (BIIVCPN and BIIVCPC).

  • Grants invoice layouts are all portrait invoices and are produced by BIGIVCPN.

  • Federal invoice layouts are also portrait invoices and are produced by the SQR program BISF108X and the BI Publisher program BI_XPSF103X.

If an invoice form requires information not provided in the extract tables, you can modify the extract Application Engine program, BI_IVCEXT, to extract, calculate or derive that information and place it in the extract tables. The recommended method for this type of modification is to add a section to perform the additional processing. The new procedure should only be called for invoices that require the different information. The Invoice Layout ID field can be used to select those invoices in the Billing data that require special handling. Once the system is programmed to extract the needed data into the Billing extract tables, SQR or BI Publisher form modifications might also be needed.

The following example shows a procedure, BIEVALX.SQC, that calls PROCESS-XXX-LAYOUT when an invoice with a layout id of PS_XX is processed. Include this SQC in the print process BIXXXXXX.SQR. Define the procedure PROCESS-XXX-LAYOUT in the modified SQC that is called by BIXXXXXX.SQR.

!-------------------------------------------------------------------!
! Procedure: PROCESS-LAYOUT-SPECIFIC-INFO   !
! Desc:  Select the extra processing routine according to the !
!   invoice layout.          !
!-------------------------------------------------------------------!
begin-procedure PROCESS-LAYOUT-SPECIFIC-INFO
 add 1 to #level
 move 'PROCESS-LAYOUT-SPECIFIC-INFO' to $Current-Procedure

 evaluate $InvoiceLayout
 when = 'PS_XX'    ! Example Invoice Layout
  do PROCESS-XXX-LAYOUT
  break
 when-other
  break
 end-evaluate