Qual: Removed a FIXME

This commit is contained in:
Laurent Destailleur 2011-12-30 14:45:07 +01:00
parent 83acf605c3
commit 00aa90606c
2 changed files with 10 additions and 8 deletions

View File

@ -82,19 +82,21 @@ class Fournisseur extends Societe
} }
/** /**
* FIXME This returns number of prices, not number of products. Is it what we want ? * Returns number of ref prices (not number of products).
*
* @return int Nb of ref prices, or <0 if error
*/ */
function NbProduct() function nbOfProductRefs()
{ {
$sql = "SELECT count(pfp.rowid)"; $sql = "SELECT count(pfp.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql .= " WHERE pfp.fk_soc = ".$this->id; $sql .= " WHERE pfp.fk_soc = ".$this->id;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ( $resql ) if ( $resql )
{ {
$row = $this->db->fetch_row($resql); $obj = $this->db->fetch_object($resql);
return $row[0]; return $obj->nb;
} }
else else
{ {

View File

@ -229,7 +229,7 @@ if ($object->fetch($id))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("ProductsAndServices").'</td><td align="right">'; print '<td>'.$langs->trans("ProductsAndServices").'</td><td align="right">';
print '<a href="'.DOL_URL_ROOT.'/fourn/product/liste.php?fourn_id='.$object->id.'">'.$langs->trans("All").' ('.$object->NbProduct().')'; print '<a href="'.DOL_URL_ROOT.'/fourn/product/liste.php?fourn_id='.$object->id.'">'.$langs->trans("All").' ('.$object->nbOfProductRefs().')';
print '</a></td></tr></table>'; print '</a></td></tr></table>';
} }