diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index e4f0b1fb53e..947d3f3cc19 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -104,7 +104,7 @@ if ($HTTP_POST_VARS["action"] == 'add') if ($id) { propale_pdf_create($db, $id, $HTTP_POST_VARS["modelpdf"]); - $propalid = $id; + $_GET["propalid"] = $id; } } @@ -236,12 +236,17 @@ if ($_GET["propalid"]) $propal = new Propal($db); $propal->fetch($_GET["propalid"]); - /* - * - */ - print "
Proposition commerciale : $propal->ref | ";
- print "
| Société | '; - if ($objp->client == 1) + if ($societe->client == 1) { - $url ='fiche.php?socid='.$obj->idp; + $url ='fiche.php?socid='.$societe->id; } else { - $url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$obj->idp; + $url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id; } - print ''.$obj->nom.' | '; + print ''.$societe->nom.''; print 'Statut | '.$obj->lst.' | ||||||||||||
| Date | '.strftime("%A %d %B %Y",$obj->dp); + print ' | ||||||||||||||
| Date | '.strftime("%A %d %B %Y",$propal->date); if ($propal->fin_validite) { print " (".strftime("%d %B %Y",$propal->fin_validite).")"; @@ -304,10 +309,10 @@ if ($_GET["propalid"]) print ' | Note : '. nl2br($propal->note)." | |||||||||||||
| Projet | '; print ''; print $projet->title.' | "; } - print "\n"; + print "\n"; $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid, pt.tva_tx, pt.remise_percent, pt.subprice"; $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt, ".MAIN_DB_PREFIX."product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propal->id"; @@ -391,16 +396,12 @@ if ($_GET["propalid"]) print " | ".$objp->qty." | \n"; print ''.$objp->remise_percent.' % | '; print ''.price($objp->subprice).' | '; - if ($obj->statut == 0 && $user->rights->propale->creer) + if ($propal->statut == 0 && $user->rights->propale->creer) { print ''; print img_delete(); print ' | '; } - else - { - print '- | '; - } print ""; $i++; @@ -424,7 +425,7 @@ if ($_GET["propalid"]) print "".$objp->qty." | \n"; print ''.$objp->remise_percent.' % | '; print "".price($objp->subprice)." | "; - if ($obj->statut == 0 && $user->rights->propale->creer) + if ($propal->statut == 0 && $user->rights->propale->creer) { print '';
print img_delete();
@@ -439,7 +440,7 @@ if ($_GET["propalid"])
}
}
- if ($obj->statut == 0 && $user->rights->propale->creer)
+ if ($propal->statut == 0 && $user->rights->propale->creer)
{
$sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p WHERE p.envente=1 ORDER BY p.nbvente DESC LIMIT 20";
// RyXéo on a ORDER BY p.ref et pas de limit
@@ -508,102 +509,71 @@ if ($_GET["propalid"])
/*
* Actions
*/
- if ($obj->statut < 2)
+ print '';
+ if ($propal->statut < 2)
{
- print '
| ||||