diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 30fbb643b04..b08c0182ebe 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -121,6 +121,8 @@ if ( $action == 'delete' ) llxHeader(); $html = new Form($db); +$societestatic=new Societe($db); +$propalstatic=new Propal($db); /* * @@ -433,121 +435,6 @@ if ($_GET["propalid"] > 0) dolibarr_print_error($db); } - /* - * Lignes de remise - */ - - // Réductions relatives (Remises-Ristournes-Rabbais) -/* Une réduction doit s'appliquer obligatoirement sur des lignes de factures -et non globalement - $var=!$var; - print '
'; - print ''; - print ''; - print ''; - print $langs->trans('CustomerRelativeDiscount'); - if ($propal->brouillon) print ' ('.($soc->remise_client?$langs->trans("CompanyHasRelativeDiscount",$soc->remise_client):$langs->trans("CompanyHasNoRelativeDiscount")).')'; - print ''; - print ' '; - print ' '; - print ' '; - print ''; - if ($_GET['action'] == 'editrelativediscount') - { - print '%'; - } - else - { - print $propal->remise_percent?$propal->remise_percent.'%':' '; - } - print ''; - print ''; - if ($_GET['action'] != 'editrelativediscount') print $propal->remise_percent?'-'.price($propal->remise_percent*$total/100):$langs->trans("DiscountNone"); - else print ' '; - print ''; - if ($_GET['action'] != 'editrelativediscount') - { - if ($propal->brouillon && $user->rights->propale->creer) - { - print 'id.'">'.img_edit($langs->trans('SetRelativeDiscount'),1).''; - } - else - { - print ' '; - } - if ($propal->brouillon && $user->rights->propale->creer && $propal->remise_percent) - { - print 'rowid.'">'; - print img_delete(); - print ''; - } - else - { - print ' '; - } - print ' '; - } - else - { - print ''; - } - print ''; - print '
'; -*/ - - // Remise absolue -/* Les remises absolues doivent s'appliquer par ajout de lignes spécialisées - $var=!$var; - print '
'; - print ''; - print ''; - print ''; - print $langs->trans('CustomerAbsoluteDiscount'); - if ($propal->brouillon) print ' ('.($avoir_en_cours?$langs->trans("CompanyHasAbsoluteDiscount",$avoir_en_cours,$langs->trans("Currency".$conf->monnaie)):$langs->trans("CompanyHasNoAbsoluteDiscount")).')'; - print ''; - print ' '; - print ' '; - print ' '; - print ' '; - print ''; - if ($_GET['action'] == 'editabsolutediscount') - { - print '-'; - } - else - { - print $propal->remise_absolue?'-'.price($propal->remise_absolue):$langs->trans("DiscountNone"); - } - print ''; - if ($_GET['action'] != 'editabsolutediscount') - { - if ($propal->brouillon && $user->rights->propale->creer) - { - print 'id.'">'.img_edit($langs->trans('SetAbsoluteDiscount'),1).''; - } - else - { - print ' '; - } - if ($propal->brouillon && $user->rights->propale->creer && $propal->remise_absolue) - { - print 'rowid.'">'; - print img_delete(); - print ''; - } - else - { - print ' '; - } - print ' '; - } - else - { - print ''; - } - print ''; - print '
'; -*/ print ''; @@ -737,14 +624,16 @@ et non globalement print ''; -} else { - +} +else +{ /** * * Mode Liste des propales * */ + if (! $sortfield) $sortfield="p.datep"; if (! $sortorder) $sortorder="DESC"; if ($page == -1) $page = 0 ; @@ -755,7 +644,8 @@ et non globalement $pagenext = $page + 1; - $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, "; + $sql = "SELECT s.nom, s.idp, s.client,"; + $sql.= " p.rowid as propalid, p.price, p.ref, p.fk_statut,"; $sql.= $db->pdate("p.datep")." as dp, "; $sql.= $db->pdate("p.fin_validite")." as dfin"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -774,7 +664,6 @@ et non globalement { $num = $db->num_rows(); - $propalstatic=new Propal($db); print_barre_liste($langs->trans("Proposals"), $page, "propal.php","&socid=$socid",$sortfield,$sortorder,'',$num); @@ -804,7 +693,12 @@ et non globalement print "\n"; // Societe - print "idp\">".dolibarr_trunc($objp->nom,44)."\n"; + print ""; + $societestatic->nom=$objp->nom; + $societestatic->id=$objp->idp; + $societestatic->client=$objp->client; + print $societestatic->getNomUrl(1,'customer',44); + print ""; // Date print "";