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 ''; + // Reference + print ''; + + // Ref client + print ''; + print ''; // Société print '';
'.$langs->trans('Ref').''.$fac->ref.'
'.$langs->trans('Ref').''.$fac->ref.'
'; + print ''; + if ($_GET['action'] != 'refcdeclient' && $fac->brouillon) print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print ''.img_edit($langs->trans('Edit')).'
'; + print '
'; + if ($user->rights->facture->creer && $_GET['action'] == 'refcdeclient') + { + print '
'; + print ''; + print ''; + print ' '; + print '
'; + } + else + { + print $commande->ref_client; + } + print '
'.$langs->trans('Company').'