Happy Business Starts Here

Invoice template year display issue

Zuora Support

Invoice template year display issue


I have an issue with the invoice template where the Year is not displayed correctly for December months.
We did a catch-up bill run and discovered that the end month of the year ( December month) is displaying as 20 instead of 19 but all other months are displayed correctly. 2.PNG


As you could see from the screenshot attached, only the December month year is displayed correctly.


The code used to display the service period was {MERGEFIELD InvoiceItem_01.ServiceStartDate \@ MM/YY} {MERGEFIELD InvoiceItem_01.ServiceEndDate \@ MM/YY}


If this is a template issue, I would expect that the other months not to display the year properly. 



It was due to the wrong usage of the date format in the template, in the place of uppercase YY. We have to use the lowercase yy for the year to display correctly. 

To format a date merge field, use the \@ switches. For example, to display a date field as "03/30/2010", the merge field     should be defined as { MERGEFIELD myObject.myField \@ MM/dd/yyyy}.

The below article provides the list of date formats supported in the template