Understanding SQR Invoices

This chapter provides an overview of the SQR invoices and discusses how to:

Click to jump to parent topicUnderstanding SQR Invoice Structure

The delivered SQR invoice programs can produce invoices using several different layouts in the same run. The process selects a group of qualifying bills, then processes each invoice according to its particular formatting requirements. As the process proceeds from one invoice to another, the layout may change, causing the process to apply different print routines to achieve the desired output.

Within the primary common routine BIIVCSQR, all references to printing activities use generalized procedure names. An additional member that is included in each printing program redirects the processing to the procedure that is appropriate to this layout.

For example, consider the printing of the invoice line. Within the common processing module BIIVCSQR, the program performs a procedure that is called WRITE-INVOICE-LINE. This routine performs another procedure that is called PRINT-LAYOUT-INVOICE-LINE. The PRINT-LAYOUT-INVOICE-LINE procedure is the generalized procedure reference in the previous paragraph.

Generalized procedures are located in a special member, the only purpose of which is to direct the program from the generalized function that is requested to the specific routine for this layout. The special members that are used for this purpose are BIEVALP for portrait invoices and BIEVALL for landscape invoices.

In the BIEVALP member, the PRINT-LAYOUT-INVOICE-LINE member contains an Evaluate statement that directs the program to execute one of several routines based on the layout that is designated for the current invoice ($InvoiceLayout). If no matching condition is found, the program executes a default routine. This is useful if the layouts are similar but have varying conditions, such as the contents and arrangement of the line details.

The routines that are referenced in the Evaluate logic are contained in a collection of print routine members. The sample programs include a set of these members for each of the layouts that is supported.

The members for the miscellaneous and federal invoice formats from BIIVCPN, BIIVCLN and BISF108X are:

BIFUL* members

Contain the procedures for printing full-size invoice headings and line headings.

BISUB* members

Contain the procedures for printing the common portion of the invoice heading that is used by invoice and summary pages.

BIABB* members

Contains the procedure for printing an abbreviated invoice heading on secondary pages.

BIPRT* members

Contain the procedures for printing detailed lines and totals.

BIPRS* members

Contain the procedures for printing the invoice summary page.

The members for the Grants invoice formats from BIGIVCPN are:

BIGFL* members

Contain the procedures for printing full-size invoice headings and line headings.

BIGSB* members

Contain the procedures for printing the common portion of the invoice heading that the invoice and summary pages use.

BIGABB* members

Contains the procedure for printing an abbreviated invoice heading on secondary pages.

BIGPRT* members

Contain the procedures for printing detailed lines and totals.

BIGPRS* members

Contain the procedures for printing the invoice summary page.

Note. If you also use the PeopleSoft eBill Payment application, review the code in BI_SS_WRK.INVOICE_PB.FieldFormula after adding new invoice forms or invoice layouts to determine if it needs modification to support the changes. The code in BI_SS_WRK.INVOICE_PB.FieldFormula supports functionality in PeopleSoft eBill Payment that enables your customers to request invoice copies to be sent to them by email.

Click to jump to parent topicAdding SQR Invoice Forms

To add an SQR invoice form to the program

  1. Select an existing layout that is similar to the desired layout and copy the relevant print routine members to new names.

  2. Revise the print routines and add them to the appropriate program.

  3. Update the Evaluate member (BIEVALP or BIEVALL) to recognize the layout and direct the program to the configured routines.

  4. Add a new layout ID on the Invoice Layout Identifiers page.

    The layout name that you use must exactly match the name that is used in the Evaluate logic that you modified in step three.

  5. Set up a new invoice form and select the new invoice layout ID on the Invoice Formatting Options - General page.

  6. Assign the new invoice form to invoices for processing with the new layout.

  7. Test the revised print module to verify the expected results.

Note. Adding several invoice layouts to a single SQR may cause you to exceed certain SQR parameters, such as PROGLINEPARS. You may be able to alleviate this problem by deactivating layouts that you do not use, enabling you to add the new layout and remain within parameter boundaries.

See Also

Establishing Invoice Formatting, Sorting, and Printing Options

Click to jump to parent topicAdding an SQR Invoice Example

This section 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.

Click to jump to top of pageClick to jump to parent topicChanging the Print Routines

While you can use most of the existing portrait routines for the summary, there are two areas that 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

See Also

Establishing Invoice Formatting, Sorting, and Printing Options

Click to jump to top of pageClick to jump to parent topicCalling the New Print Routines

The following example displays the members that are added for the default portrait layout, the MISC layout, 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 excerpt 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.

Click to jump to parent topicModifying Amounts Printed on Invoices

This section provides an example of how to change currency formatting.

Amounts on invoice formats are printed using 13 significant digits to the left of the decimal point and three significant digits to the right of the decimal point. This style supports multicurrency and three decimal precision while allowing sufficient space on invoice examples. Rightstub format, however, is printed with 11 significant digits to the left of the decimal and three significant digits to the right.

To modify the length of the amount fields, change the #in_mask parameter when calling the function Format_Currency_Amt. For example, in BIPRTP00.SQC (which prints the line amount for portrait default) the following procedure changes as indicated:

!----------------------------------------------------------------------! ! Procedure: PRINT-INVOICE-LINE-DEFAULT ! ! Desc: Print invoice line. ! ! ! !----------------------------------------------------------------------! begin-procedure PRINT-INVOICE-LINE-DEFAULT add 1 to #level move 'PRINT-INVOICE-LINE-DEFAULT' to $Current-Procedure #ifdef DebugF do PRINT-FLOW #endif move &line.invoice_line to $InvoiceLine 99999 move 1 to #lines_to_print do check-for-page-break if $NotesFound = 'Y' print $InvoiceLine (+2,{line}) bold move 'N' to $NotesFound else print $InvoiceLine (+1,{line}) bold end-if if &line.adj_line_type <> 'REG' print ' * ' (,{adj_indicator}) bold end-if print &line.identifier (,{identifier},13) bold print $line.descr (,{description},28) bold move &line.qty to $LineQty 999,999,999.99pf print $LineQty (,{qty}) bold print &line.unit_of_measure (,{unit_of_measure}) bold move &line.unit_amt to $UnitAmt 999,999,999.99pf print $UnitAmt (,{unit_amt}) bold !MLF Installment Billing if $InstallmentBill = 'N' if &form_options.apply_ds_to_line = 'Y' let #Invoice_line_amount = &line.net_extended_amt else let #Invoice_line_amount = &line.gross_extended_amt end-if else if $FirstInstallment = 'Y' if &form_options.apply_ds_to_line = 'Y' let #Invoice_line_amount = &template.net_extended_amt else let #Invoice_line_amount = &template.gross_extended_amt end-if else if $InstallmentWithDetail = 'Y' if &form_options.apply_ds_to_line = 'Y' let #Invoice_line_amount = &template.net_extended_amt else let #Invoice_line_amount = &template.gross_extended_amt end-if end-if end-if end-if ! move #Invoice_line_amount to $InvoiceLineAmount 999,999,999,999.99pf ! print $InvoiceLineAmount (,{amount_col2}) bold do Format_Currency_Amt (#Invoice_line_amount, $bi_currency_cd, $select_effdt, ! '9,999,999,999,999.999', $out, 'I') < As delivered. '999,999,999,999,999.999', $out, 'I') < Change to fit the amount size. print $out (,{amount_col2}) bold let $FirstAuth = 'Y' subtract 1 from #level end-procedure

Click to jump to parent topicModifying Invoice Layouts for VAT

This section discusses how to change the treatment of VAT-related information on an invoice form. You can modify the following VAT information on the invoice layouts:

Click to jump to top of pageClick to jump to parent topicModifying VAT Messages

PeopleSoft Billing delivers 12 generic VAT treatment messages that describe the VAT treatment of invoices. Not all of these messages pertain to all countries.

You can modify these messages as needed in the following SQR modules: BIPRTL00.SQC, BIPRTL01.SQC, BIPRTP00.SQC, BIPRTP01.SQC, and BIPRTP02.SQC.

To change the VAT Treatment Message, find the appropriate string name for the message that you want to configure, and change the string in the strings table. The Program ID is BIIVCSTR. The string names for each of the generic messages are as follows:

Domestic Goods Sale

VAT_DGS

Deemed Service Export

VAT_DSE

Domestic Service Sale

VAT_DSS

EU Goods Distance Sale

VAT_EGDS

EU Goods Sale

VAT_EGS

EU Sale (Simplification)

VAT_ ESS

Out of Scope EU Service Sale

VAT_OESS

Outside of Scope

VAT_OOS

Out of Scope Service Export

VAT_OSE

Zero-Rated EU Service Sale

VAT_ZESS

Zero-Rated Goods Export

VAT_ZGE

Zero-Rated Service Export

VAT_ZSE

Click to jump to top of pageClick to jump to parent topicModifying Total Tax by VAT Code

If you want to print the VAT basis amount by VAT code, rather than the net extended amount, change the following print routines in the PRINT-VAT-TOTAL-BY-VAT-CODE procedure:

BIPRTL00

For Landscape Default Example.

BIPRTL01

For Landscape Order Management Example.

BIPRTP00

For Portrait Default Example.

BIPRTP01

For Portrait Misc Example.

BIPRTP02

For Portrait RightStub Example.

Two examples of the modified VAT code follow, one in landscape default example format, the other in portrait right stub example format. The modified code for the other layout examples is similar except for the procedure name, which reflects the individual invoice layout type.

Procedure PRINT-VAT-TOTAL-BY-VAT-CODE for the Landscape Default Example

To total VAT by the net basis amount on the landscape default layout example:

  1. Change the PRINT-VAT-TOTAL-BY-VAT-CODE procedure by commenting the following lines where they appear:

    print $xv_NET_AMOUNT2 (+1,{net_amount_label})

    and

    do Format_Currency_Amt (&summed_net_extended_amt, $bi_currency_cd, $select_effdt,

  2. Uncomment the following lines where they appear:

    ! print $xv_NET_BASIS_AMT (+1,{net_amount_label})

    and

    ! do Format_Currency_Amt (&summed_vat_basis_amt, $bi_currency_cd, $select_effdt,

The following procedure provides an example of the code that is needed to total VAT by the net basis amount on the landscape default layout example:

!----------------------------------------------------------------------! ! Procedure: PRINT-VAT-TOTAL-BY-VAT-CODE-DEFAULT ! ! Desc: Print VAT total by VAT code. ! ! ! !----------------------------------------------------------------------! begin-procedure PRINT-VAT-TOTAL-BY-VAT-CODE-DEFAULT add 1 to #level move 'PRINT-VAT-TOTAL-BY-VAT-CODE-DEFAULT' to $Current-Procedure #ifdef DebugF do PRINT-FLOW #endif if $FirstNet = 'Y' ! print $xv_NET_AMOUNT2 (+1,{net_amount_label}) !VAT: To print the Net VAT Basis Amt rather than the Net Extended Amt, !comment the line above ! and un-comment the line below. Do the reverse to print Net Extended Amt. print $xv_NET_BASIS_AMT (+1,{net_amount_label}) ! do Format_Currency_Amt (&summed_net_extended_amt, $bi_currency_cd, $select_effdt, !VAT: To print the Net VAT Basis Amt rather than the Net Extended Amt, !comment the line above ! and un-comment the line below. Do the reverse to print Net Extended Amt. do Format_Currency_Amt (&summed_vat_basis_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (,{net_amount}) move &sum_vat.tax_cd_vat_pct to #TaxCdPct do Get-Tax-Code-Name print $TaxCdDescr (,{tax_code_name_tot}) print #TaxCdPct (,{tax_pct_tot}) edit 99.999 print '%' (,{tax_pct_sign_tot}) move &summed_vat_amt to #summed_vat_amt ! print #summed_vat_amt (,{amount_col2}) edit 999,999,999,999.99pf do Format_Currency_Amt (#summed_vat_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (,{amount_col2}) let $FirstNet = 'N' else ! do Format_Currency_Amt (&summed_net_extended_amt, $bi_currency_cd, $select_effdt, !VAT: To print the Net VAT Basis Amt rather than the Net Extended Amt, !comment the line above ! and un-comment the line below. Do the reverse to print Net Extended Amt. do Format_Currency_Amt (&summed_vat_basis_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (+1,{net_amount}) move &sum_vat.tax_cd_vat_pct to #TaxCdPct do Get-Tax-Code-Name print $TaxCdDescr (,{tax_code_name_tot}) print #TaxCdPct (,{tax_pct_tot}) edit 99.999 print '%' (,{tax_pct_sign_tot}) move &summed_vat_amt to #summed_vat_amt ! print #summed_vat_amt (,{amount_col2}) edit 999,999,999,999.99pf do Format_Currency_Amt (#summed_vat_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (,{amount_col2}) end-if subtract 1 from #level end-procedure

Procedure PRINT-VAT-TOTAL-BY-VAT-CODE for the Portrait RightStub Example

To total VAT by the net basis amount on the Portrait RightStub layout example:

  1. Change the PRINT-VAT-TOTAL-HEADING-RIGHTSTUB and PRINT-VAT-TOTAL-BY-VAT-CODE-RIGHTSTUB procedures by commenting the following lines where they appear:

    print $xv_NET_AMOUNT2 (+1,{rs_net_amount_label})

    and

    do Format_Currency_Amt (&summed_net_extended_amt, $bi_currency_cd, $select_effdt,

  2. Uncomment the following lines where they appear:

    ! print $xv_NET_BASIS_AMT (+1,{rs_net_amount_label})

    and

    ! do Format_Currency_Amt (&summed_vat_basis_amt, $bi_currency_cd, $select_effdt,

The following procedure provides an example of the code that is needed to total VAT by the net basis amount on the Portrait RightStub layout:

!----------------------------------------------------------------------! ! Procedure: PRINT-VAT-TOTAL-HEADING-RIGHTSTUB ! ! Desc: Print Heading for VAT Totals. ! ! ! !----------------------------------------------------------------------! begin-procedure PRINT-VAT-TOTAL-HEADING-RIGHTSTUB add 1 to #level move 'PRINT-VAT-TOTAL-HEADING-RIGHTSTUB' to $Current-Procedure #ifdef DebugF do PRINT-FLOW #endif move 1 to #lines_to_print do CHECK-FOR-PAGE-BREAK ! let $TaxLabel = 'VAT: ' let $TaxLabel = $xv_VAT2 print $TaxLabel (+1,{rs_net_amount_label}) print $TaxLabel (,{rs_tot_lbl_right}) if $FirstNet = 'Y' print $xv_NET_AMOUNT2 (+1,{rs_net_amount_label}) !VAT: To print the Net Basis Amt label rather than the Net Amount, !comment the line above ! and un-comment the line below. Do the reverse to print Net Amount label. ! print $xv_NET_BASIS_AMT (+1,{rs_net_amount_label}) end-if subtract 1 from #level end-procedure !----------------------------------------------------------------------! ! Procedure: PRINT-VAT-TOTAL-BY-VAT-CODE-RIGHTSTUB ! ! Desc: Print VAT total by VAT code. ! ! ! !----------------------------------------------------------------------! begin-procedure PRINT-VAT-TOTAL-BY-VAT-CODE-RIGHTSTUB add 1 to #level move 'PRINT-VAT-TOTAL-BY-VAT-CODE-RIGHTSTUB' to $Current-Procedure #ifdef DebugF do PRINT-FLOW #endif if $FirstNet = 'Y' do Format_Currency_Amt (&summed_net_extended_amt, $bi_currency_cd, $select_effdt, !VAT: To print the Net VAT Basis Amt rather than the Net Extended Amt, !comment the line above ! and un-comment the line below. Do the reverse to print Net Extended Amt. ! do Format_Currency_Amt (&summed_vat_basis_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (,{rs_net_amount}) edit 999,999,999,999.99pf move &sum_vat.tax_cd_vat_pct to #TaxCdPct print $TaxCd (,{rs_tot_tax_cd}) print #TaxCdPct (,{rs_tot_tax_pct}) edit 99.999 print '%' (,{rs_tot_tax_pct_sign}) move &summed_vat_amt to #summed_vat_amt ! print #summed_vat_amt (,{rs_tot_amt_left}) edit 999,999,999,999.99pf do Format_Currency_Amt (#summed_vat_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (,{rs_tot_amt_left}) edit 999,999,999,999.99pf let $FirstNet = 'N' else do Format_Currency_Amt (&summed_net_extended_amt, $bi_currency_cd, $select_effdt, !VAT: To print the Net VAT Basis Amt rather than the Net Extended Amt, !comment the line above ! and un-comment the line below. Do the reverse to print Net Extended Amt. ! do Format_Currency_Amt (&summed_vat_basis_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (+1,{rs_net_amount}) edit 999,999,999,999.99pf move &sum_vat.tax_cd_vat_pct to #TaxCdPct print $TaxCd (,{rs_tot_tax_cd}) print #TaxCdPct (,{rs_tot_tax_pct}) edit 99.999 print '%' (,{rs_tot_tax_pct_sign}) move &summed_vat_amt to #summed_vat_amt ! print #summed_vat_amt (,{rs_tot_amt_left}) edit 999,999,999,999.99pf do Format_Currency_Amt (#summed_vat_amt, $bi_currency_cd, $select_effdt, '999,999,999,999,999.999', $out, 'I') print $out (,{rs_tot_amt_left}) edit 999,999,999,999.99pf end-if print $TaxCd (,{rs_tax_cd_right}) print #TaxCdPct (,{rs_tax_pct_right}) edit 99.999 print '%' (,{rs_tax_pct_sign_right}) ! print #summed_vat_amt (,{rs_tot_amt_right}) edit 999,999,999,999.99pf print $out (,{rs_tot_amt_right}) edit 999,999,999,999.99pf subtract 1 from #level end-procedure

Click to jump to top of pageClick to jump to parent topicModifying VAT Line Information

The landscape and portrait invoice layouts print the VAT description rather than the VAT code. Due to space limitations, the portrait RightStub prints only the VAT code. If you want to print the VAT code instead of or in addition to the VAT description, print the variable $TaxCd by using the appropriate column definition for your reporting needs.