From 2a8c252444cee34bb4ec288ef2e534f0760ace1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2010 14:13:35 +0000 Subject: [PATCH] Fix: Bad usage of date --- htdocs/compta/bank/ligne.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 42fe36d3a4b..8d470922718 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -97,12 +97,12 @@ if ($_POST["action"] == "update") $db->begin(); $amount = price2num($_POST['amount']); - $dateop = $_POST["dateoyear"].'-'.$_POST["dateomonth"].'-'.$_POST["dateoday"]; - $dateval= $_POST["datevyear"].'-'.$_POST["datevmonth"].'-'.$_POST["datevday"]; + $dateop = dol_mktime(12,0,0,$_POST["dateomonth"],$_POST["dateoday"],$_POST["dateoyear"]); + $dateval= dol_mktime(12,0,0,$_POST["datevmonth"],$_POST["datevday"],$_POST["datevyear"]); $sql = "UPDATE ".MAIN_DB_PREFIX."bank"; - $sql.= " SET label='".addslashes($_POST["label"])."',"; // Todo: cr�er une classe pour s�parer les requ�tes sql + $sql.= " SET label='".addslashes($_POST["label"])."',"; if (isset($_POST['amount'])) $sql.=" amount='$amount',"; - $sql.= " dateo = '".$dateop."', datev = '".$dateval."',"; + $sql.= " dateo = '".$db->idate($dateop)."', datev = '".$db->idate($dateval)."',"; $sql.= " fk_account = ".$_POST['accountid']; $sql.= " WHERE rowid = ".$rowid; @@ -203,7 +203,7 @@ $h++; dol_fiche_head($head, $hselected, $langs->trans('LineRecord'),0,'account'); -$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,"; +$sql = "SELECT b.rowid,b.dateo as do,b.datev as dv, b.amount, b.label, b.rappro,"; $sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account"; $sql.= ",b.emetteur,b.banque"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -274,13 +274,13 @@ if ($result) if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate)) { print ''; - $html->select_date($objp->do,'dateo','','','','update'); + $html->select_date($db->jdate($objp->do),'dateo','','','','update'); print ''; } else { print ''; - print dol_print_date($objp->do); + print dol_print_date($db->jdate($objp->do)); } print ''; @@ -289,7 +289,7 @@ if ($result) if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate)) { print ''; - $html->select_date($objp->dv,'datev','','','','update'); + $html->select_date($db->jdate($objp->dv),'datev','','','','update'); print '   '; print ''; print img_edit_remove() . " "; @@ -301,7 +301,7 @@ if ($result) else { print ''; - print dol_print_date($objp->dv,"day"); + print dol_print_date($db->jdate($objp->dv),"day"); print ''; } print "";