diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index 5b85887fc20..2c1b5085e89 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -243,8 +243,6 @@ if (!empty($line->remise_percent) && $line->special_code != 3) {
$coldisplay++;
}
-$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
-
// Fields for situation invoices
if ($this->situation_cycle_ref)
{
@@ -263,10 +261,10 @@ if ($usemargins && ! empty($conf->margin->enabled) && empty($user->socid))
pa_ht); ?> |
global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
- pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?> |
+ pa_ht == 0)?'n/a':price(price2num($line->marge_tx, 'MT')).'%'); ?> |
global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
- marque_tx, null, null, null, null, $rounding).'%'; ?> |
+ marque_tx, 'MT')).'%'; ?> |
special_code == 3) { ?>
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index dcb15ea27db..3b53cea29d2 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -188,7 +188,6 @@ if ($id > 0 || !empty($ref))
$cumul_achat = 0;
$cumul_vente = 0;
$cumul_qty = 0;
- $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
if ($num > 0) {
while ($i < $num /*&& $i < $conf->liste_limit*/) {
@@ -207,14 +206,14 @@ if ($id > 0 || !empty($ref))
print "".$objp->code_client." | \n";
print "";
print dol_print_date($db->jdate($objp->datef), 'day')." | ";
- print "".price($objp->selling_price, null, null, null, null, $rounding)." | \n";
- print "".price($objp->buying_price, null, null, null, null, $rounding)." | \n";
- print "".price($objp->qty, null, null, null, null, $rounding)." | \n";
- print "".price($objp->marge, null, null, null, null, $rounding)." | \n";
+ print "".price(price2num($objp->selling_price, 'MT'))." | \n";
+ print "".price(price2num($objp->buying_price, 'MT'))." | \n";
+ print "".price(price2num($objp->qty, 'MT'))." | \n";
+ print "".price(price2num($objp->marge, 'MT'))." | \n";
if (!empty($conf->global->DISPLAY_MARGIN_RATES))
- print "".(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%")." | \n";
+ print "".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")." | \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(price2num($markRate, 'MT'))."%")." | \n";
print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5).' | ';
print "\n";
$i++;
@@ -239,14 +238,14 @@ if ($id > 0 || !empty($ref))
}
print '';
print '| '.$langs->trans('TotalMargin')." | ";
- print ''.price($cumul_vente, null, null, null, null, $rounding)." | \n";
- print ''.price($cumul_achat, null, null, null, null, $rounding)." | \n";
- print ''.price($cumul_qty, null, null, null, null, $rounding)." | \n";
- print ''.price($totalMargin, null, null, null, null, $rounding)." | \n";
+ print ''.price(price2num($cumul_vente, 'MT'))." | \n";
+ print ''.price(price2num($cumul_achat, 'MT'))." | \n";
+ print ''.price(price2num($cumul_qty, 'MT'))." | \n";
+ print ''.price(price2num($totalMargin, 'MT'))." | \n";
if (!empty($conf->global->DISPLAY_MARGIN_RATES))
- print ''.(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%")." | \n";
+ print ''.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))." | \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(price2num($markRate, 'MT'))."%")." | \n";
print ' | ';
print "
\n";
print "";
@@ -264,9 +263,9 @@ if ($id > 0 || !empty($ref))
print '
';
diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index 1edd5349467..0b4ab1b2da2 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -192,8 +192,6 @@ if ($socid > 0)
$cumul_achat = 0;
$cumul_vente = 0;
- $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
-
if ($num > 0)
{
while ($i < $num /*&& $i < $conf->liste_limit*/)
@@ -216,13 +214,13 @@ if ($socid > 0)
print "\n";
print "";
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 "".$sign.price($objp->marge, null, null, null, null, $rounding)." | \n";
+ print "".price(price2num($objp->selling_price, 'MT'))." | \n";
+ print "".price(price2num(($objp->type == 2 ? -1 : 1) * $objp->buying_price, 'MT'))." | \n";
+ print "".$sign.price(price2num($objp->marge, 'MT'))." | \n";
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
- print "".(($marginRate === '')?'n/a':$sign.price($marginRate, null, null, null, null, $rounding)."%")." | \n";
+ print "".(($marginRate === '')?'n/a':$sign.price(price2num($marginRate, 'MT'))."%")." | \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(price2num($markRate, 'MT'))."%")." | \n";
print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5).' | ';
print "\n";
$i++;
@@ -248,13 +246,13 @@ if ($socid > 0)
// Total
print '';
print '| '.$langs->trans('TotalMargin')." | ";
- print "".price($cumul_vente, null, null, null, null, $rounding)." | \n";
- print "".price($cumul_achat, null, null, null, null, $rounding)." | \n";
- print "".price($totalMargin, null, null, null, null, $rounding)." | \n";
+ print "".price(price2num($cumul_vente, 'MT'))." | \n";
+ print "".price(price2num($cumul_achat, 'MT'))." | \n";
+ print "".price(price2num($totalMargin, 'MT'))." | \n";
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
- print "".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")." | \n";
+ print "".(($marginRate === '')?'n/a':price(price2num($marginRate, 'MT'))."%")." | \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(price2num($markRate, 'MT'))."%")." | \n";
print ' | ';
print "
\n";
}
@@ -277,9 +275,9 @@ else
print '
';