Modifying 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:

Field or Control Description

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. Remove the comment from 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. Remove the comment from 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