diff --git a/htdocs/fourn/product/fourn.php b/htdocs/fourn/product/fourn.php index 92e007d4a4a..16868d9ee4e 100644 --- a/htdocs/fourn/product/fourn.php +++ b/htdocs/fourn/product/fourn.php @@ -90,7 +90,7 @@ if ($_GET["id"]) if ($conf->categorie->enabled) { print ''; - print ''; + print ''; $cat = new Categorie ($db); $way = $cat->print_primary_way($product->id," > ",'fourn/product/liste.php'); if ($way == "") @@ -104,79 +104,65 @@ if ($_GET["id"]) } print ''; } + + print ''.$langs->trans("Label").''.$product->libelle.''; - print ""; - print ''.$langs->trans("InternalRef").''.$product->ref.''; - print ''; - print ''.$langs->trans("Label").''.$product->libelle.''; - print ""; - print ''.$langs->trans("Supplier").''.$product->fourn->nom_url.''; - print ''; - print ''.$langs->trans("SupplierRef").''.$product->fourn_ref.''; - print ''; - print ''.$langs->trans("BuiingPrice").''.price($product->buyprice).''; - print ''; - - - print ''.$langs->trans("Description").''.nl2br($product->description).''; - - if ($product->type == 1) + print ''.$langs->trans("InternalRef").''.$product->ref.''; + + print ''; + $product->show_photo($conf->produit->dir_output); + print ''; + + print ""; + print ''.$langs->trans("Supplier").''.$product->fourn->nom_url.''; + print ''; + print ''.$langs->trans("SupplierRef").''.$product->fourn_ref.''; + print ''; + print ''.$langs->trans("BuiingPrice").''.price($product->buyprice).''; + print ''; + + print ''.$langs->trans("Description").''; + print ''.nl2br($product->description).' '; + + print "
\n"; + + print ''; + print ''; + print ''; + print ''; + print ''; + + /* + * Prix + */ + + $sql = "SELECT p.price, p.quantity,".$db->pdate("tms") ." as date_releve"; + $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as p"; + $sql .=" WHERE p.fk_soc = ".$product->fourn->id; + $sql .= " AND p.fk_product = ".$product->id; + $sql .= " ORDER BY p.quantity ASC"; + $resql= $db->query($sql) ; + if ($resql) + { + $num_fournisseur = $db->num_rows($resql); + $i = 0; + $var=True; + while ($i < $num_fournisseur) { - print '"; + print ''; + print ''; + print ''; - if ($product->duration_value > 1) - { - $dur=array("d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); - } - else - { - $dur=array("d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); - } - print $langs->trans($dur[$product->duration_unit])." "; - - print ''; + $i++; } - print "
'; + print $langs->trans("Date").''.$langs->trans("Price").''.$langs->trans("Quantity").'
'.$langs->trans("Duration").''.$product->duration_value.' '; + $objp = $db->fetch_object($resql); + $var=!$var; + print "
'.dolibarr_print_date($objp->date_releve).''.price($objp->price).''.$objp->quantity.'

\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - - /* - * Prix - */ - - $sql = "SELECT p.price, p.quantity,".$db->pdate("tms") ." as date_releve"; - $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as p"; - $sql .=" WHERE p.fk_soc = ".$product->fourn->id; - $sql .= " AND p.fk_product = ".$product->id; - $sql .= " ORDER BY p.quantity ASC"; - $resql= $db->query($sql) ; - if ($resql) - { - $num_fournisseur = $db->num_rows($resql); - $i = 0; - $var=True; - while ($i < $num_fournisseur) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print ""; - print ''; - print ''; - print ''; - - $i++; - } - $db->free($resql); - } - print '
'; - print $langs->trans("Date").''.$langs->trans("Price").''.$langs->trans("Quantity").'
'.dolibarr_print_date($objp->date_releve).''.price($objp->price).''.$objp->quantity.'
'; - - - + $db->free($resql); + } + print ''; + /* * * Fiche en mode edition