Le lien va sur la fiche client

This commit is contained in:
Laurent Destailleur 2007-04-05 09:26:15 +00:00
parent c79436358e
commit 5b3a421275

View File

@ -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 '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="setremisepercent">';
print '<input type="hidden" name="propalid" value="'.$propal->id.'">';
print '<tr class="liste_total"><td>';
print $langs->trans('CustomerRelativeDiscount');
if ($propal->brouillon) print ' <font style="font-weight: normal">('.($soc->remise_client?$langs->trans("CompanyHasRelativeDiscount",$soc->remise_client):$langs->trans("CompanyHasNoRelativeDiscount")).')</font>';
print '</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td align="right"><font style="font-weight: normal">';
if ($_GET['action'] == 'editrelativediscount')
{
print '<input type="text" name="remise_percent" size="2" value="'.$propal->remise_percent.'">%';
}
else
{
print $propal->remise_percent?$propal->remise_percent.'%':'&nbsp;';
}
print '</font></td>';
print '<td align="right"><font style="font-weight: normal">';
if ($_GET['action'] != 'editrelativediscount') print $propal->remise_percent?'-'.price($propal->remise_percent*$total/100):$langs->trans("DiscountNone");
else print '&nbsp;';
print '</font></td>';
if ($_GET['action'] != 'editrelativediscount')
{
if ($propal->brouillon && $user->rights->propale->creer)
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editrelativediscount&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetRelativeDiscount'),1).'</a></td>';
}
else
{
print '<td>&nbsp;</td>';
}
if ($propal->brouillon && $user->rights->propale->creer && $propal->remise_percent)
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=setremisepercent&amp;rowid='.$objp->rowid.'">';
print img_delete();
print '</a></td>';
}
else
{
print '<td>&nbsp;</td>';
}
print '<td>&nbsp;</td>';
}
else
{
print '<td colspan="3"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td>';
}
print '</tr>';
print '</form>';
*/
// Remise absolue
/* Les remises absolues doivent s'appliquer par ajout de lignes spécialisées
$var=!$var;
print '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="setremiseabsolue">';
print '<input type="hidden" name="propalid" value="'.$propal->id.'">';
print '<tr class="liste_total"><td>';
print $langs->trans('CustomerAbsoluteDiscount');
if ($propal->brouillon) print ' <font style="font-weight: normal">('.($avoir_en_cours?$langs->trans("CompanyHasAbsoluteDiscount",$avoir_en_cours,$langs->trans("Currency".$conf->monnaie)):$langs->trans("CompanyHasNoAbsoluteDiscount")).')</font>';
print '</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td align="right"><font style="font-weight: normal">';
if ($_GET['action'] == 'editabsolutediscount')
{
print '-<input type="text" name="remise_absolue" size="2" value="'.$propal->remise_absolue.'">';
}
else
{
print $propal->remise_absolue?'-'.price($propal->remise_absolue):$langs->trans("DiscountNone");
}
print '</font></td>';
if ($_GET['action'] != 'editabsolutediscount')
{
if ($propal->brouillon && $user->rights->propale->creer)
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editabsolutediscount&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetAbsoluteDiscount'),1).'</a></td>';
}
else
{
print '<td>&nbsp;</td>';
}
if ($propal->brouillon && $user->rights->propale->creer && $propal->remise_absolue)
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=setremiseabsolue&amp;rowid='.$objp->rowid.'">';
print img_delete();
print '</a></td>';
}
else
{
print '<td>&nbsp;</td>';
}
print '<td>&nbsp;</td>';
}
else
{
print '<td colspan="3"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td>';
}
print '</tr>';
print '</form>';
*/
print '</table>';
@ -737,14 +624,16 @@ et non globalement
print '</td></tr></table>';
} 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 "</td>\n";
// Societe
print "<td><a href=\"fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,44)."</a></td>\n";
print "<td>";
$societestatic->nom=$objp->nom;
$societestatic->id=$objp->idp;
$societestatic->client=$objp->client;
print $societestatic->getNomUrl(1,'customer',44);
print "</td>";
// Date
print "<td align=\"right\">";