From bdcbd4ee4230b74ad545b9e979db5417310817fa Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Tue, 22 Oct 2013 12:47:26 +0200 Subject: [PATCH 1/2] Fix list propal and invoice to display customer ref if option is set --- htdocs/comm/propal/list.php | 3 ++- htdocs/compta/facture/list.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 45e69448f43..834c651c2be 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -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 ''; print $companystatic->getNomUrl(1,'customer'); print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8fe94f6c3fd..83b9fd30945 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -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 ''; From 980452721652fd15dcb6756f6ecfc7b607751d7b Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Wed, 23 Oct 2013 11:25:42 +0200 Subject: [PATCH 2/2] Fix bug in option display account number in list --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b756f0313a5..3510e4af679 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -800,7 +800,7 @@ class Form while ($i < $num) { $obj = $this->db->fetch_object($resql); - + $label=''; if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { if (($obj->client) && (!empty($obj->code_client))) { $label = $obj->code_client. ' - ';