From d89364082acd5371cc5aec68e8d9161bf519849a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Dec 2004 20:14:18 +0000 Subject: [PATCH] Ajout du lien vers la liste des produits d'un fournisseur dans l'onglet fournisseur. --- htdocs/fourn/fiche.php | 50 ++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index b95b097bee3..3b64841eb16 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -92,9 +92,11 @@ if ( $societe->fetch($socid) ) $head[$h][1] = $langs->trans("Supplier"); $h++; } - if ($conf->produit->enabled) { - $head[$h][0] = DOL_URL_ROOT.'/product/liste.php?type=0&fourn_id='.$societe->id; - $head[$h][1] = $langs->trans("Products"); + + if ($conf->compta->enabled) { + $langs->load("compta"); + $head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$socid; + $head[$h][1] = $langs->trans("Accountancy"); $h++; } @@ -136,6 +138,22 @@ if ( $societe->fetch($socid) ) */ print ''; + $var=false; + + /* + * + * Liste des produits + * + */ + if ($conf->produit->enabled || $conf->service->enabled) { + print ''; + $var=!$var; + print ""; + print ''; + print '
Liste des produits et services

'; + } + + /* * * Liste des commandes associées @@ -147,12 +165,13 @@ if ( $societe->fetch($socid) ) $sql .= " ORDER BY p.rowid DESC LIMIT 0,4"; if ( $db->query($sql) ) { - print ''; + $var=!$var; $i = 0 ; $num = $db->num_rows(); if ($num > 0) { - print ''; + print '
'; + print ""; print ""; } while ($i < $num && $i < 5) @@ -178,11 +197,13 @@ if ( $societe->fetch($socid) ) $i++; } $db->free(); - print "
id\">Dernières commandes
"; + if ($num > 0) { + print "
"; + } } else { - print $db->error(); + dolibarr_print_error($db); } @@ -196,14 +217,14 @@ if ( $societe->fetch($socid) ) $sql .= " ORDER BY p.datef DESC LIMIT 0,4"; if ( $db->query($sql) ) { - print ''; $var=!$var; $i = 0 ; $num = $db->num_rows(); if ($num > 0) { + print '
'; print ""; - print ""; + print ""; } while ($i < $num && $i < 5) { @@ -222,11 +243,13 @@ if ( $societe->fetch($socid) ) $i++; } $db->free(); - print "
id\">Liste des factures ($num)
id\">Liste des factures fournisseurs ($num)
"; + if ($num > 0) { + print "
"; + } } else { - print $db->error(); + dolibarr_print_error($db); } /* @@ -234,7 +257,7 @@ if ( $societe->fetch($socid) ) * */ print ''; - print '' . "
\n"; + print '' . "\n"; print ''; /* @@ -265,7 +288,6 @@ if ( $societe->fetch($socid) ) $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $societe->id ORDER by p.datec"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); - $var=1; while ($i < $num) { $obj = $db->fetch_object(); @@ -296,7 +318,7 @@ if ( $societe->fetch($socid) ) } else { - print "Erreur"; + dolibarr_print_error($db); } $db->close();