diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 96580b7b19f..433b48e5848 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -184,6 +184,7 @@ if ($_POST['action'] == 'add')
$facture->date = $datefacture;
$facture->note_public = $_POST['note_public'];
$facture->note = $_POST['note'];
+ $facture->ref_client = $_POST['ref_client'];
if ($_POST['fac_rec'] > 0)
{
@@ -750,6 +751,7 @@ if ($_GET['action'] == 'create')
$propal->fetch($_GET['propalid']);
$societe_id = $propal->socidp;
$projetid=$propal->projetidp;
+ $ref_client=$propal->ref_client;
$soc->fetch($societe_id);
$cond_reglement_id = $propal->cond_reglement_id;
@@ -805,6 +807,11 @@ if ($_GET['action'] == 'create')
// Ref
print '
| '.$langs->trans('Ref').' | '.$langs->trans('Draft').' |
';
+
+ // Reference client
+ print '| '.$langs->trans('RefCustomer').' | ';
+ print ' | ';
+ print '
';
// Societe
print '| '.$langs->trans('Company').' | '.$soc->getNomUrl(1).' | ';
@@ -1331,7 +1338,8 @@ if ($_GET['action'] == 'create')
}
else
{
- if ($_GET['facid'] > 0)
+ $id = $_GET['facid'];
+ if ($id > 0)
{
/* *************************************************************************** */
/* */
@@ -1410,8 +1418,31 @@ else
*/
print '';
- // Reference
- print '| '.$langs->trans('Ref').' | '.$fac->ref.' |
';
+ // Reference
+ print '| '.$langs->trans('Ref').' | '.$fac->ref.' |
';
+
+ // Ref client
+ print '| ';
+ print '';
+ print ' | ';
+ if ($user->rights->facture->creer && $_GET['action'] == 'refcdeclient')
+ {
+ print '';
+ }
+ else
+ {
+ print $commande->ref_client;
+ }
+ print ' | ';
+ print '
';
// Société
print '| '.$langs->trans('Company').' | ';