Fix list propal and invoice to display customer ref if option is set

This commit is contained in:
Florian Henry 2013-10-22 12:47:26 +02:00
parent 1412f33c4e
commit bdcbd4ee42
2 changed files with 5 additions and 2 deletions

View File

@ -141,7 +141,7 @@ if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit;
$sql = 'SELECT s.rowid, s.nom, s.town, s.client, ';
$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client';
$sql.= 'p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login';
@ -368,6 +368,7 @@ if ($result)
$companystatic->id=$objp->rowid;
$companystatic->nom=$objp->nom;
$companystatic->client=$objp->client;
$companystatic->code_client=$objp->code_client;
print '<td>';
print $companystatic->getNomUrl(1,'customer');
print '</td>';

View File

@ -143,7 +143,7 @@ else $sql = 'SELECT DISTINCT';
$sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,';
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
$sql.= ' f.paye as paye, f.fk_statut,';
$sql.= ' s.nom, s.rowid as socid';
$sql.= ' s.nom, s.rowid as socid, s.code_client, s.client ';
if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'facture as f';
@ -390,6 +390,8 @@ if ($resql)
$thirdparty=new Societe($db);
$thirdparty->id=$objp->socid;
$thirdparty->nom=$objp->nom;
$thirdparty->client=$objp->client;
$thirdparty->code_client=$objp->code_client;
print $thirdparty->getNomUrl(1,'customer');
print '</td>';