Calling the New Print Routines

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.