Updated Templating and Invoice Formats

I recently updated the template and in particular the invoiceitems.jrxml template

Going forward it produces nice invoices.  However

I question the backward compatibilty.

Basically no line items get displayed at all on invoices prior to changinge to 1.8

I assume it has to do with the target.print parameter...

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Updated Templating and Invoice Formats

I assume that if its null that will boolean as false..

($F{target.template} == null || !$F{target.template.entity.printAggregate}) && ($F{target.print} || $F{target.total}.compareTo(BigDecimal.ZERO) != 0)

 

hence this print expression will always return as false for old invoices.

Solutions>?
 

EDIT:

($F{target.template} == null || !$F{target.template.entity.printAggregate})|| $F{target.total}.compareTo(BigDecimal.ZERO) != 0

the above will work for older invoices...hence maybe the target.print is returning as null for old invoices and the 2nd half of the expression is always false.

 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Updated Templating and Invoice Formats

Can you try the attached?

 

AttachmentSize
Invoice Items.jrxml 14.57 KB

Re: Updated Templating and Invoice Formats

Yep adding the check for null sorts it out.

I also checked the suppressed template items are still supressed with that change

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content