Fix style of text after ref on invoices

This commit is contained in:
Laurent Destailleur 2016-07-05 16:27:14 +02:00
parent 23cac5b157
commit b4c8822281
2 changed files with 10 additions and 7 deletions

View File

@ -2930,16 +2930,16 @@ else if ($id > 0 || ! empty($ref))
// Ref // Ref
print '<tr><td width="20%">' . $langs->trans('Ref') . '</td>'; print '<tr><td width="20%">' . $langs->trans('Ref') . '</td>';
print '<td colspan="5">'; print '<td colspan="5">';
$morehtmlref = ''; $morehtmlright = '';
$discount = new DiscountAbsolute($db); $discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id); $result = $discount->fetch(0, $object->id);
if ($result > 0) { if ($result > 0) {
$morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')'; $morehtmlright = '&nbsp; (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')';
} }
if ($result < 0) { if ($result < 0) {
dol_print_error('', $discount->error); dol_print_error('', $discount->error);
} }
print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref); print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', '', '', 0, '', '', $morehtmlright);
print '</td></tr>'; print '</td></tr>';
// Ref customer // Ref customer

View File

@ -5582,10 +5582,11 @@ class Form
* @param string $moreparam More param to add in nav link url. * @param string $moreparam More param to add in nav link url.
* @param int $nodbprefix Do not include DB prefix to forge table name * @param int $nodbprefix Do not include DB prefix to forge table name
* @param string $morehtmlleft More html code to show before ref * @param string $morehtmlleft More html code to show before ref
* @param string $morehtmlright More html code to show before navigation arrows * @param string $morehtmlstatus More html code to show under navigation arrows (status place)
* @param string $morehtmlright More html code to show after ref
* @return string Portion HTML avec ref + boutons nav * @return string Portion HTML avec ref + boutons nav
*/ */
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlright='') function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
{ {
global $langs,$conf; global $langs,$conf;
@ -5604,7 +5605,7 @@ class Form
//print "xx".$previous_ref."x".$next_ref; //print "xx".$previous_ref."x".$next_ref;
$ret.='<div style="vertical-align: middle">'; $ret.='<div style="vertical-align: middle">';
$ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>'; if ($morehtmlleft) $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">'; $ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
@ -5624,6 +5625,8 @@ class Form
} }
$ret.='</div>'; $ret.='</div>';
if ($morehtmlright) $ret.='<div class="inline-block floatleft">'.$morehtmlright.'</div>';
if ($previous_ref || $next_ref || $morehtml) if ($previous_ref || $next_ref || $morehtml)
{ {
$ret.='<div class="pagination"><ul>'; $ret.='<div class="pagination"><ul>';
@ -5641,7 +5644,7 @@ class Form
{ {
$ret.='</ul></div>'; $ret.='</ul></div>';
} }
if ($morehtmlright) $ret.='<div class="statusref">'.$morehtmlright.'</div>'; if ($morehtmlstatus) $ret.='<div class="statusref">'.$morehtmlstatus.'</div>';
$ret.='</div>'; $ret.='</div>';
return $ret; return $ret;