From a3c74aa9bd15558dd1799bd6e12d24eb1925c94b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 6 Jul 2012 09:52:20 +0200 Subject: [PATCH] Fix: price field is obsolete --- htdocs/product/stats/propal.php | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 980b061b4b2..c58c80a1eaf 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * 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 ''; - $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"],"&id=$product->id",$sortfield,$sortorder,'',$num,0,''); $i = 0; - print ""; + print '
'; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.rowid","","&id=".$_GET["id"],'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&id=".$_GET["id"],'',$sortfield,$sortorder); @@ -153,16 +147,16 @@ if ($_GET["id"] || $_GET["ref"]) $objp = $db->fetch_object($result); $var=!$var; - print ""; + print ''; print '\n"; + print ''."\n"; print ''; - print ""; - print "\n"; + print ''."\n"; print ''; - print "\n"; + print ''."\n"; $i++; } } @@ -181,7 +175,7 @@ else dol_print_error(); } -$db->close(); llxFooter(); +$db->close(); ?>
'.img_object($langs->trans("ShowPropal"),"propal").' '; print $objp->ref; - print "'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'"; + print ''; print dol_print_date($db->jdate($objp->datep))."".price($objp->amount)."'.price($objp->amount).''.$propalstatic->LibStatut($objp->statut,5).'