Fix: price field is obsolete

This commit is contained in:
Regis Houssin 2012-07-06 09:52:20 +02:00
parent 46d2c1f730
commit dfe7b9ecbb

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -59,21 +59,15 @@ if (! $sortfield) $sortfield="p.datep";
*/
$form = new Form($db);
if ($_GET["id"] || $_GET["ref"])
if ($id > 0 || ! empty($ref))
{
$product = new Product($db);
if ($_GET["ref"])
{
$result = $product->fetch('',$_GET["ref"]);
$_GET["id"]=$product->id;
}
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
$result = $product->fetch($id, $ref);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ( $result > 0)
if ($result > 0)
{
$head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type);
$picto=($product->type==1?'service':'product');
@ -110,7 +104,7 @@ if ($_GET["id"] || $_GET["ref"])
print '</div>';
$sql = "SELECT distinct s.nom, s.rowid as socid, p.rowid as propalid, p.ref, p.total as amount,";
$sql = "SELECT DISTINCT s.nom, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,";
$sql.= "p.datep, p.fk_statut as statut";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@ -134,7 +128,7 @@ if ($_GET["id"] || $_GET["ref"])
print_barre_liste($langs->trans("Proposals"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num,0,'');
$i = 0;
print "<table class=\"noborder\" width=\"100%\">";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.rowid","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
@ -153,16 +147,16 @@ if ($_GET["id"] || $_GET["ref"])
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' ';
print $objp->ref;
print "</a></td>\n";
print '</a></td>'."\n";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
print "<td align=\"center\">";
print '<td align="center">';
print dol_print_date($db->jdate($objp->datep))."</td>";
print "<td align=\"right\">".price($objp->amount)."</td>\n";
print '<td align="right">'.price($objp->amount).'</td>'."\n";
print '<td align="right">'.$propalstatic->LibStatut($objp->statut,5).'</td>';
print "</tr>\n";
print '</tr>'."\n";
$i++;
}
}
@ -181,7 +175,7 @@ else
dol_print_error();
}
$db->close();
llxFooter();
$db->close();
?>