diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index fe4a8a5c7cd..0966807facd 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -600,7 +600,7 @@ if ($resql)
{
print '
';
print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'':'') : ''.$langs->trans('NA').'');
- if ($objp->frequency > 0 && $objp->date_last_gen && $objp->date_last_gen < $now) print img_warning($langs->trans("Late"));
+ if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
print ' | ';
if (! $i) $totalarray['nbfield']++;
}