Happy Business Starts Here

Highlighted
Zuora Staff

Invoice template year display issue

Problem:

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. 

 

Solution:

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
https://knowledgecenter.zuora.com/CB_Billing/IA_Invoices/Creating_a_Custom_Invoice_Template/B_Define...