Invoice template
Submitted by Guest on Fri, 15/11/2013 - 08:42
Hi there,
We want to add some kind of "referral voucher" to the bottom of our invoices.
Is it possible to do this? If yes, how do I edit the template and is the length of text limited?
Cheers!
Cheryl
Re: Invoice template
Cheryl - yes it is possible to do. Since the invoice template is a jrxlm file you need the Jasper Reports iReport program. See http://www.openvpms.org/documentation/csh/1.7/reference/reportsForms for background. (Although I have not completed this yet, it has what you need.)
If fact you can edit the jrxml file with a standard editor, but it is far far easier to use iReport.
To figure out what file you need to edit, use Administration|Templates - put 'inv' in the search field and press the find button. You should get two results, Invoice and InvoiceItems. Select Invoice and press the View button then click the Content field to get it to export the report - save this as say invoice.jrxml in a convenient place.
Download iReport from say http://sourceforge.net/projects/ireport/files/iReport/iReport-3.7.6/ (I would grab the windows installer) and install it.
NOTE - even if your OpenVPMS system runs on a unix box you can happily edit the reports on a windows machine and then re-import them to the unix server. [To do this use Administration|Templates and edit the invoice, then click the Upload button to upload your modified report.]
When you open the invoice in iReport you should see something like the following. You will see that at the bottom there is a grey area - this is where the reminders get put - if your version generates reminders at the bottom of the invoice. Above this is the Notes field where the invoice notes go.
Where to put your voucher? If you look at the left side of the screen (see below) you will see 'Last Page Footer'. This is now currently used. I would use this.
Right Click on 'Last Page Footer' which will get you a menu with only one entry - Add Band. Left click this. This will insert the Last Page Footer area as a 203 (in my case) high band (ie 203 1/76 of an inch) and the main screen will look as follows:
Don't worry about the fact that this has appeared above the Summary area - it will be printed at the bottom of the last page.
Now press Ctrl-Shift-8 to display the 'palette' window. On this left click the Static Text entry and then holding the left button down, drag it into the Last Page Footer area. Clcik on it to select it and then use its corner handles to make it as big as you want. You can double click on the field to open it so you can senter text or you can use the Text property in the properties window (ue Ctrl-Shift-7 to display this if it is not showing). You can see at the top, then Left, Top, Width & Height properties - you can use these to accurately set the size and position of the field if you don't like dragging it around.
When you are happy, use File|Save to save the file and then import it as discussed above.
Now choose a customer and print an invoice. If you are happy you are done. If not, back to iReport and make alterations.
Note that when you install 1.7 with its macro evaluation facility, it is possible to implement a 'Message of the Day' facility - see http://www.openvpms.org/forum/message-day. In fact one of the sample messages that I generated for the practice is 'Thanks for shopping at EIAH - Show this receipt to get $100 off on your next purchase - offer valid to 31/1/2014'
Regards, Tim G
Re: Invoice template
You can do this by editing the invoice template in iReport Designer.
The steps are:
1. save a copy of the template from OpenVPMS
To do this, go to Administration|Templates and search for Invoice. When you've located it, click View. In the viewer, select the Content (probably 'invoice a4.jrxml' or 'invoice a5.jrxml).
This should prompt you to save the file.
2. edit in iReport Designer
All templates with a .jrxml extension must be edited in iReport Designer. If you don't have it, you can download it from here: http://community.jaspersoft.com/project/ireport-designer
Open the invoice template and change the Summary band to incorporate your referral voucher text.
Save your changes.
NOTE: you will need to save templates in a version compatible with OpenVPMS. If you are running OpenVPMS 1.6, you need to go to Tools -> Options -> iReport -> General -> Compatibility and select JasperReports3.7.5.
3. upload the template
Go back to Administration|Templates, but this type Edit the invoice template.
Click Upload to upload the changed template.
4. Test
Easiest way to do this is to Print -> Preview a customer invoice.
See also:
Regards,
Tim