From 3914f0eb01149be361494d66809cb60f5ab569db Mon Sep 17 00:00:00 2001 From: erics Date: Wed, 22 Dec 2004 20:13:42 +0000 Subject: [PATCH] on affiche les commandes associees que si le module commandes est actif --- htdocs/comm/fiche.php | 68 ++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 7d9dcc04589..6c50bd3f95e 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -1,6 +1,7 @@ * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne * * 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 @@ -308,40 +309,41 @@ if ($_socid > 0) /* * Commandes - * + * Que si le module est actif ! */ - print ''; - $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.total_ht, p.ref, ".$db->pdate("p.date_commande")." as dp"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as p WHERE p.fk_soc = s.idp "; - $sql .= " AND s.idp = $objsoc->id ORDER BY p.date_commande DESC"; - - if ( $db->query($sql) ) - { - $num = $db->num_rows(); - if ($num >0 ) - { - print ""; - print ''; - } - $i = 0; $now = time(); $lim = 3600 * 24 * 15 ; - while ($i < $num && $i < 2) - { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - print '\n"; - print ''; - print ''; - $i++; - } - $db->free(); - } - + if($conf->commande->enabled) { + print '
Liste des commandes ('.$num.')
'.$objp->ref."\n"; - if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) - { - print " > 15 jours"; - } - print "".strftime("%d %B %Y",$objp->dp)."'.price($objp->total_ht).''.$objp->statut.'
'; + $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.total_ht, p.ref, ".$db->pdate("p.date_commande")." as dp"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as p WHERE p.fk_soc = s.idp "; + $sql .= " AND s.idp = $objsoc->id ORDER BY p.date_commande DESC"; + + if ( $db->query($sql) ) + { + $num = $db->num_rows(); + if ($num >0 ) + { + print ""; + print ''; + } + $i = 0; $now = time(); $lim = 3600 * 24 * 15 ; + while ($i < $num && $i < 2) + { + $objp = $db->fetch_object(); + $var=!$var; + print ""; + print '\n"; + print ''; + print ''; + $i++; + } + $db->free(); + } + } /* * * Liste des projets associés
Liste des commandes ('.$num.')
'.$objp->ref."\n"; + if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) + { + print " > 15 jours"; + } + print "".strftime("%d %B %Y",$objp->dp)."'.price($objp->total_ht).''.$objp->statut.'