From d842d05639c7912f7e73d08e071a2884e39f8b19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Mar 2016 12:31:29 +0100 Subject: [PATCH] Fix bug in date compare --- htdocs/compta/facture/fiche-rec.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 469cbf44ca9..76f796f78b6 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -905,8 +905,8 @@ else */ print '
'; - if ($object->statut == Facture::STATUS_DRAFT) - { + //if ($object->statut == Facture::STATUS_DRAFT) // there is no draft status on templates. + //{ if ($user->rights->facture->creer) { if (empty($object->frequency) || $object->date_when <= $today) @@ -922,9 +922,10 @@ else { print ''; } - } + //} - if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer) + //if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer) + if ($user->rights->facture->supprimer) { print ''; } @@ -1014,7 +1015,7 @@ else print ''; if ($user->rights->facture->creer) { - if (empty($objp->frequency) || $objp->date_when <= $today) + if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { print ''; print $langs->trans("CreateBill").'';