Well if the total amount is negative than it’s an credit memo, otherwise it’s an Invoice….no? Well of course, but wouldn’t it be nice to have it clearly state whether it’s a credit or invoice on top of the document?
In VISUAL, invoices and credits are printed using the same QRP template files. With conditional formatting, you can clearly state whether the document is an INVOICE or CREDIT MEMO. Conditional formatting allows you to dynamically change the appearance of the document based on the result of a formula. In this case, the formula will look at the GRAND TOTAL. And if it’s negative it will print CREDIT MEMO otherwise it will print INVOICE.
- Using Report Builder, open the invoice QRP (ie: VMINVFM1.QRP)
- Add a new field and place it at the top of the form
- Right click on the field and select PROPERTIES from the popup menu
- Click on the Edit Field Formula button
- Enter the following formula in the space provided:StrIFF( StrScan( CUR_GRANDTOTAL,'(‘ ) , ‘INVOICE’, ‘CREDIT MEMO’, ‘CREDIT MEMO’ )
Negative values are displayed with brackets. So this formula searches the CUR_GRANDTOTAL field for an open bracket ‘(‘. If it finds one it will print “CREDIT MEMO” otherwise it will print “INVOICE”.
- Click OK
- Change the field’s font style and font size (if desired)
- Save the QRP
So the next time you’re printing invoices and you happen to come across a shipment return – you should see something similar to the following: