diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index 5d80814099d..2f5ba9cc7b2 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -207,7 +207,10 @@ if ($socid > 0)
$marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ;
$markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ;
-
+ $sign = '';
+ if($objp->type == Facture::TYPE_CREDIT_NOTE){
+ $sign = '-';
+ }
print '
';
print '| ';
@@ -219,11 +222,11 @@ if ($socid > 0)
print dol_print_date($db->jdate($objp->datef),'day')." | ";
print "".price($objp->selling_price, null, null, null, null, $rounding)." | \n";
print "".price(($objp->type == 2 ? -1 : 1) * $objp->buying_price, null, null, null, null, $rounding)." | \n";
- print "".price($objp->marge, null, null, null, null, $rounding)." | \n";
+ print "".$sign.price($objp->marge, null, null, null, null, $rounding)." | \n";
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
- print "".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")." | \n";
+ print "".(($marginRate === '')?'n/a':$sign.price($marginRate, null, null, null, null, $rounding)."%")." | \n";
if (! empty($conf->global->DISPLAY_MARK_RATES))
- print "".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")." | \n";
+ print "".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")." | \n";
print ''.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).' | ';
print "
\n";
$i++;