diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 8b1bf14f808..720d9bd5d2b 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1693,7 +1693,7 @@ if ($_GET['action'] == 'create')
// Date invoice
print '
| '.$langs->trans('Date').' | ';
- $html->select_date($dateinvoice,'','','','',"add");
+ $html->select_date($dateinvoice,'','','','',"add",1,1);
print ' |
';
// Payment term
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index a4379ced733..3a594a9cf75 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2009 Laurent Destailleur
+ * Copyright (C) 2004-2010 Laurent Destailleur
* Copyright (C) 2004 Christophe Combelles
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2009 Regis Houssin
@@ -423,10 +423,10 @@ if ($_GET['action'] == 'create')
$societe->fetch($_GET['socid']);
}
- $datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
- $datedue=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
-
- $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture);
+ $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
+ $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datetmp);
+ $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
+ $datedue=($datetmp==''?-1:$datetmp);
print '