Adding an SQR Invoice (Example)

This topic provides an example of adding a new SQR invoice form. The invoice created is a summarized invoice without the line details.

The new summarized layout will be based on the default layout for portrait invoices. The print routines for the default portrait layout are BIFULP00, BISUBP00, BIABBP00, BIPRTP00, BIPRSP00; similarly named routines also exist for Grants invoices.

Note: The summarized invoice created in this example is not related to the invoice summarization feature triggered by summarization templates.

While you can use most of the existing portrait routines for the summary, two areas require changes:

  1. You must change the Invoice Heading procedures that are found in BIFULP00 for the default portrait layout.

    To prevent line headings from appearing on the summarized invoice, you must add an alternate line heading procedure. First, copy BIFULP00 to a new member, BIFULP30, and then add a new line heading procedure for the new layout that prints separator lines with no column headings.

    !***********************************************************************
    !BIFULP30.SQC: Invoice Heading for SUMMARY ONLY invoice layout. *
    !***********************************************************************
    !         *
    !  Confidentiality Information:    *
    !         *
    ! This module is the confidential and proprietary information of *
    ! PeopleSoft, Inc.; it is not to be copied, reproduced, or transmitted *
    ! in any form, by any means, in whole or in part, nor is it to be used *
    ! for any purpose other than that for which it is expressly provided *
    ! without the written permission of PeopleSoft.   *
    !         *
    ! Copyright (c) 1988-1995 PeopleSoft, Inc. All Rights Reserved  *
    !         *
    !***********************************************************************
    begin-procedure line-headings-SUMMONLY
    alter-printer
     font=4
     point-size=8
     graphic (,1,120) horz-line
     graphic (+1,1,120) horz-line
    alter-printer
     font=3
     point-size=6
    end-procedure
  2. You must also change the pretax subtotal routine to print a pretax subtotal that does not include discounts and surcharges, enabling these amounts to print after the subtotal.

    You can use all other print routines from the default member BIPRTP00. BIPRTP30 is created with a new subtotal routine.

    !***********************************************************************
    !BIPRTP30.SQC: Summary Only print routines for portrait invoice *
    !  layouts.      *
    !***********************************************************************
    !         *
    !  Confidentiality Information:    *
    !         *
    ! This module is the confidential and proprietary information of *
    ! PeopleSoft, Inc.; it is not to be copied, reproduced, or transmitted *
    ! in any form, by any means, in whole or in part, nor is it to be used *
    ! for any purpose other than that for which it is expressly provided *
    ! without the written permission of PeopleSoft.   *
    !         *
    ! Copyright (c) 1988-1995 PeopleSoft, Inc. All Rights Reserved  *
    !         *
    !***********************************************************************
    !----------------------------------------------------------------------!
    ! Procedure: PRINT-PRETAX-SUBTOTAL-SUMMONLY    !
    ! Desc: Print pretax subtotal.     !
    !         !
    !----------------------------------------------------------------------!
    begin-procedure PRINT-PRETAX-SUBTOTAL-SUMMONLY
     add 1 to #level
     move 'PRINT-PRETAX-SUBTOTAL-SUMMONLY' to $Current-Procedure
    
    #ifdef DebugF
     do PRINT-FLOW
    #endif
    
     graphic (+1,{amount_col2},20) horz-line
     alter-printer
     font=4
     point-size=8
     !PRINT 'SUBTOTAL: '  
     PRINT $xv_SUBTOTAL  (+1,{total_label}) bold
    alter-printer
     font=3
     point-size=6
     let #Adjusted_subtotal = &hdr.invoice_amt_pretax - #Total_Discount_Amt
     - #Total_Surcharge_Amt
    do Format_Currency_Amt (#Adjusted_subtotal, $bi_currency_cd, $select_eff
    dt, '9,999,999,999,999.999pf', $out, 'I')
     print $out   (,{amount_col2}) bold
    
    
    subtract 1 from #level
    
    end-procedure

The following example displays the members that are added for the default portrait layout, the MISC layout, and the RIGHTSTUB layout, and the new members that are added for the new SUMMONLY layout (Summary Only).

  1. Add the new routines to the appropriate program, BIIVCPN.SQR.

    Add the routines in a new section marked for the new layout, SUMMONLY. Members are included within BIIVCPN.SQR for various invoice layouts.

    !----------------------------------------------------------------------!
    ! Called SQC Procedures - Common routines for portrait invoice layouts.!
    !----------------------------------------------------------------------!
    #include 'bifulp00.sqc' ! Full Invoice Heading and Line Heading 
    procedures
    #include 'bisubp00.sqc' ! Print procedure for common invoice heading 
    area.
    #include 'biabbp00.sqc' ! Short Invoice Heading for secondary pages.
    #include 'biprtp00.sqc' ! Print procedures for detailed lines and 
    totals.
    #include 'biprsp00.sqc' ! Print procedure for the invoice summary page.
    #include 'bievalp.sqc' ! Routines to select print procedures by Layout.
    
    !----------------------------------------------------------------------!
    ! Called SQC Procedures - specific to the MISC layout.   !
    !----------------------------------------------------------------------!
    #include 'bifulp01.sqc' ! Full Invoice Heading and Line Heading 
    procedures
    #include 'bisubp01.sqc' ! Print procedure for common invoice heading 
    area.
    #include 'biabbp01.sqc' ! Short Invoice Heading for secondary pages.
    #include 'biprtp01.sqc' ! Print procedures for detailed lines and 
    totals.
    #include 'biprsp01.sqc' ! Print procedure for the invoice summary page.
    
    
    !----------------------------------------------------------------------!
    ! Called SQC Procedures - specific to the RIGHTSTUB layout.  !
    !----------------------------------------------------------------------!
    #include 'bifulp02.sqc' ! Full Invoice Heading and Line Heading 
    procedures
    #include 'bisubp02.sqc' ! Print procedure for common invoice heading 
    area.
    #include 'biabbp02.sqc' ! Short Invoice Heading for secondary pages.
    #include 'biprtp02.sqc' ! Print procedures for detailed lines and 
    totals.
    #include 'biprsp02.sqc' ! Print procedure for the invoice summary page.
    !----------------------------------------------------------------------!
    ! Called SQC Procedures - specific to a Summary Only layout.  !
    ! These members include only the routines that differ from the !
    ! default portrait routines.      !
    !----------------------------------------------------------------------!
    #include 'bifulp30.sqc' ! Full Invoice Heading and Line Heading
    procedures.
    #include 'biprtp30.sqc' ! Print procedures for detailed lines and 
    totals.
    
    
    !----------------------------------------------------------------------!
    ! Called SQC Procedures - specific to another layout.   !
    !----------------------------------------------------------------------!
    !#include 'bifulxxx.sqc' ! Full Invoice Heading and Line Heading 
    procedures
    !#include 'bisubxxx.sqc' ! Print procedure for common invoice 
    heading area.
    !#include 'biabbxxx.sqc' ! Short Invoice Heading for secondary pages.
    !#include 'biprtxxx.sqc' ! Print procedures for detailed lines and 
    totals.
    !#include 'biprsxxx.sqc' ! Print procedure for the invoice summary page.
    
    !----------------------------------------------------------------------!
    ! Called SQC Procedures - common to all invoice layouts.  !
    !----------------------------------------------------------------------!
    #include 'bideclrp.sqc' ! Printer Declaration procedure.
    #include 'bidebug.sqc' ! Debug procedures
    #include 'reset.sqc' ! Reset printer procedure
    #include 'curdttim.sqc' ! Get-Current-DateTime procedure
    #include 'datetime.sqc' ! Routines for date and time formatting
    #include 'bidtrdat.sqc' ! Determine-Due-Date procedure (for 
    calculating Due Date)
    #include 'biduedat.sqc' ! Get-Due-Date procedure
    #include 'bidscdat.sqc' ! Optional calculation of Discount Dates, 
    see duedate.sqc.
    #include 'prcsapi.sqc' ! Update Process Request API
    #include 'prcsdef.sqc' ! Update Process Request Variable Declare
    #include 'bibatch.sqc' ! Process Scheduler message handling for Billing
    #include 'bitax.sqc' ! Routines for fetching, storing and 
    calculating taxes
    #include 'readxlat.sqc' ! General routine to translate XLAT codes to 
    text
  2. Modify the Evaluate member, BIEVALP.

    To modify BIEVALP, make the following changes:

    !***********************************************************************
    !BIEVALP.SQC: Print routine selection procedures for portrait invoice*
    !  layouts.      *
    !***********************************************************************!
    
    1. Prevent the execution of detail line processing print routines (line, discount, surcharge, and tax).

      The following sample code illustrates a break without printing the invoice line for SUMMONLY invoice layout.

      !----------------------------------------------------------------------!
      ! Procedure: PRINT-LAYOUT-INVOICE-LINE     !
      ! Desc: Select the print routine according to the invoice layout. !
      !         !
      !----------------------------------------------------------------------!
      begin-procedure PRINT-LAYOUT-INVOICE-LINE
       add 1 to #level
       move 'PRINT-LAYOUT-INVOICE-LINE' to $Current-Procedure
      
      #ifdef DebugF
       do PRINT-FLOW
      #endif
      
       evaluate $InvoiceLayout
       when = 'MISC'    ! Miscellaneous Invoice Layout
        do Print-Invoice-Line-MISC
        break
       when = 'RIGHTSTUB'   ! RightStub Invoice Layout
        do Print-Invoice-Line-RIGHTSTUB
        break
       when = 'SUMMONLY'   ! Summary Only; Does Not Apply
        break
       when-other    ! Default Routine
        do Print-Invoice-Line-DEFAULT
        break
       end-evaluate
      
       subtract 1 from #level
      
      end-procedure
    2. Perform the modified routines for line headings and pretax subtotal when appropriate.

      For line headings, the system performs a configured routine for the SUMMONLY invoice layout.

      !----------------------------------------------------------------------!
      ! Procedure: LAYOUT-LINE-HEADINGS     !
      ! Desc: Write the line headings that are appropriate to this !
      !  layout.       !
      !----------------------------------------------------------------------!
      begin-procedure LAYOUT-LINE-HEADINGS
       add 1 to #level
       move 'LAYOUT-LINE-HEADINGS' to $Current-Procedure
      
      #ifdef DebugF
       do PRINT-FLOW
      #endif
      
       evaluate $InvoiceLayout
       when = 'MISC'    ! Miscellaneous Invoice Layout
       do Line-Headings-MISC
       break
       when = 'RIGHTSTUB'   ! RightStub Invoice Layout
       do Line-Headings-RIGHTSTUB
       break
       when = 'SUMMONLY'   ! Summary Only
       do Line-Headings-SUMMONLY
       break
       when-other    ! Default Routine
       do Line-Headings-DEFAULT
       break
       end-evaluate
      
       subtract 1 from #level
      
      end-procedure
      
    3. Pretax Subtotal: Perform a configured routine for the SUMMONLY invoice layout.

      !----------------------------------------------------------------------!
      ! Procedure: PRINT-PRETAX-SUBTOTAL     !
      ! Desc: Select the print routine according to the invoice layout. !
      !         !
      !----------------------------------------------------------------------!
      begin-procedure PRINT-PRETAX-SUBTOTAL
       add 1 to #level
       move 'PRINT-PRETAX-SUBTOTAL' to $Current-Procedure
      
      #ifdef DebugF
       do PRINT-FLOW
      #endif
      
       evaluate $InvoiceLayout
       when = 'MISC'   ! Miscellaneous Invoice Layout
       do Print-Pretax-Subtotal-MISC
       break
       when = 'RIGHTSTUB'  ! Right Stub Invoice Layout
       do Print-Pretax-Subtotal-RIGHTSTUB
       break
       when = 'SUMMONLY'  ! Summary Only Invoice Layout
       do Print-Pretax-Subtotal-SUMMONLY
       break
       when-other   ! Default Routine
       do Print-Pretax-Subtotal-DEFAULT
       break
       end-evaluate
      
       subtract 1 from #level
      
      end-procedure
    4. Perform default routines in all other conditions.

      The following Grand Total routine demonstrates how to perform the default routine using a when-other clause. In this case, no change is necessary.

      !----------------------------------------------------------------------!
      ! Procedure: PRINT-GRAND-TOTAL      !
      ! Desc: Select the print routine according to the invoice layout. !
      !         !
      !----------------------------------------------------------------------!
      begin-procedure PRINT-GRAND-TOTAL
       add 1 to #level
       move 'PRINT-GRAND-TOTAL' to $Current-Procedure
      
      #ifdef DebugF
       do PRINT-FLOW
      #endif
      
       evaluate $InvoiceLayout
       when = 'MISC'   ! Miscellaneous Invoice Layout
       do Print-Grand-Total-MISC
       break
       when = 'RIGHTSTUB'  ! Right Stub Invoice Layout
       do Print-Grand-Total-RIGHTSTUB
       break
       when-other   ! Default Routine
       do Print-Grand-Total-DEFAULT
       break
       end-evaluate subtract 1 from #level
      
      end-procedure
      
  3. Set up a new invoice layout ID on the Invoice Layout Identifiers page.

    Note: Ensure that the invoice layout ID that you set up on the Invoice Layout Identifiers page match exactly the invoice layout ID that you specify in the Evaluate member.

  4. Set up a new invoice form on the Invoice Formatting Options - General page.

  5. Define how discounts, surcharges, and totals appear on the invoice on the Invoice Formatting Options - Discounts, Surcharges, Taxes page.

    Note: Print routines and formatting options may vary depending on how you want discounts, surcharges, and totals to appear.

  6. Define how header notes, line notes, and VAT treatment messages appear on the invoice on the Invoice Formatting Options - Header Notes page, Invoice Formatting Options - Line Notes page, and Invoice Formatting Options - VAT Treatment Msg page, respectively.

    With the new SQC members in place, the new layout is ready to test.

  7. Assign the invoice form to a bill and create a pro forma to test it.