From a732a832443e317ab6a48fa0614e340a0d7b9f6e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 5 Jul 2007 12:58:24 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20probl=E8me=20de=20num=E9rotation=20lorsq?= =?UTF-8?q?ue=20le=20compteur=20ne=20se=20remet=20pas=20=E0=20zero=20en=20?= =?UTF-8?q?d=E9but=20d'ann=E9e=20fiscale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/facture/pluton/pluton.modules.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/modules/facture/pluton/pluton.modules.php b/htdocs/includes/modules/facture/pluton/pluton.modules.php index 38a8a906e2a..0273f02272c 100644 --- a/htdocs/includes/modules/facture/pluton/pluton.modules.php +++ b/htdocs/includes/modules/facture/pluton/pluton.modules.php @@ -197,14 +197,21 @@ function info() $searchyy=''; $sql = "SELECT MAX(facnumber)"; $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - if ($conf->global->FACTURE_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE facnumber like '".$this->searchLast."%'"; + if ($conf->global->FACTURE_NUM_RESTART_BEGIN_YEAR) + { + $sql.= " WHERE facnumber like '".$this->searchLast."%'"; + } + else if ($facture->type == 2) + { + $sql.= " WHERE type = 2"; + } $resql=$db->query($sql); if ($resql) { $row = $db->fetch_row($resql); if ($row) $searchyy = substr($row[0],0,-$posindice); } - + if ($conf->global->FACTURE_NUM_DELTA || $conf->global->AVOIR_NUM_DELTA) { //on vérifie si il y a une année précédente