From e8b8fad20f5f083c6479d995f8227195f29945e9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Jan 2007 19:45:50 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20il=20y=20avait=20une=20remise=20=E0=20ze?= =?UTF-8?q?ro=20en=20d=E9but=20d'ann=E9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/includes/modules/propale/mod_propale_diamant.php | 7 ++++--- htdocs/includes/modules/propale/mod_propale_emeraude.php | 4 ++-- htdocs/includes/modules/propale/mod_propale_ivoire.php | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/includes/modules/propale/mod_propale_diamant.php b/htdocs/includes/modules/propale/mod_propale_diamant.php index d64f7f4b0f0..6b0640b88d0 100644 --- a/htdocs/includes/modules/propale/mod_propale_diamant.php +++ b/htdocs/includes/modules/propale/mod_propale_diamant.php @@ -95,10 +95,11 @@ class mod_propale_diamant extends ModeleNumRefPropales // D'abord on récupère la valeur max (réponse immédiate car champ indéxé) + $prefix='PR'; $current_year = strftime("%y",time()); $last_year = strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")-1)); - $pryy = 'PR'.$current_year; + $pryy = $prefix.$current_year; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; @@ -115,13 +116,13 @@ class mod_propale_diamant extends ModeleNumRefPropales } else { - $pryy = 'PR'.$last_year; + $pryy = $prefix.$last_year; } } //on vérifie si il y a une année précédente //sinon le delta sera appliqué de nouveau sur la nouvelle année - $lastyy = 'PR'.$last_year; + $lastyy = $prefix.$last_year; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; $sql.= " WHERE ref like '${lastyy}%'"; diff --git a/htdocs/includes/modules/propale/mod_propale_emeraude.php b/htdocs/includes/modules/propale/mod_propale_emeraude.php index 312135cb683..1934f378f97 100644 --- a/htdocs/includes/modules/propale/mod_propale_emeraude.php +++ b/htdocs/includes/modules/propale/mod_propale_emeraude.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2006 Laurent Destailleur - * Copyright (C) 2005-2006 Regis Houssin + * Copyright (C) 2005-2007 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 @@ -111,7 +111,7 @@ class mod_propale_emeraude extends ModeleNumRefPropales if ($row) $pryy = substr($row[0],0,4); } - // Si au moins un champ respectant le modèle a été trouvée + // Si au moins un champ respectant le modèle a été trouvé if (eregi('PR[0-9][0-9]',$pryy)) { // Recherche rapide car restreint par un like sur champ indexé diff --git a/htdocs/includes/modules/propale/mod_propale_ivoire.php b/htdocs/includes/modules/propale/mod_propale_ivoire.php index bd2450e8531..952b3d1869d 100644 --- a/htdocs/includes/modules/propale/mod_propale_ivoire.php +++ b/htdocs/includes/modules/propale/mod_propale_ivoire.php @@ -74,10 +74,11 @@ class mod_propale_ivoire extends ModeleNumRefPropales // D'abord on récupère la valeur max (réponse immédiate car champ indéxé) + $prefix='PR'; $current_year = strftime("%y",time()); $last_year = strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")-1)); - $pryy = 'PR'.$current_year; + $pryy = $prefix.$current_year; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; @@ -93,7 +94,7 @@ class mod_propale_ivoire extends ModeleNumRefPropales } else { - $pryy = 'PR'.$last_year; + $pryy = $prefix.$last_year; } }