From 6e64f7b83e9ef327b10401d9aae4acdb8e7520e4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 27 May 2010 09:41:05 +0000 Subject: [PATCH] Fix: missing date --- htdocs/includes/modules/propale/mod_propale_marbre.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/includes/modules/propale/mod_propale_marbre.php b/htdocs/includes/modules/propale/mod_propale_marbre.php index 04c133be70f..61ed3f6d9fc 100644 --- a/htdocs/includes/modules/propale/mod_propale_marbre.php +++ b/htdocs/includes/modules/propale/mod_propale_marbre.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,7 +102,7 @@ class mod_propale_marbre extends ModeleNumRefPropales $posindice=8; $sql = "SELECT MAX(SUBSTRING(ref,".$posindice.")) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; - $sql.= " WHERE ref like '".$this->prefix."%'"; + $sql.= " WHERE ref LIKE '".$this->prefix."%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -118,8 +118,7 @@ class mod_propale_marbre extends ModeleNumRefPropales return -1; } - $date=$propal->datep; - //$yymm = strftime("%y%m",time()); + $date = (!empty($propal->datep)?$propal->datep:dol_now('tzserver')); $yymm = strftime("%y%m",$date); $num = sprintf("%04s",$max+1);