Modifying Amounts That Are Printed on Invoices

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

Amounts on invoice formats are printed with 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