diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index daa017a0130..6ced467dbfa 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -354,7 +354,11 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = (float) dol_eval($result, 1, 1, '1'); - print ''.price($r).''; + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($r, 0, '', 1, 0, 0).''; + } else { + print ''.price($r).''; + } } if (!isset($sommes[$code])) { @@ -381,7 +385,11 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = (float) dol_eval($result, 1, 1, '1'); - print ''.price($r).''; + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($r, 0, '', 1, 0, 0).''; + } else { + print ''.price($r).''; + } if (empty($sommes[$code]['N'])) { $sommes[$code]['N'] = $r; } else { @@ -400,7 +408,12 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = (float) dol_eval($result, 1, 1, '1'); - print ''.price($r).''; + + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($r, 0, '', 1, 0, 0).''; + } else { + print ''.price($r).''; + } if (empty($sommes[$code]['M'][$k])) { $sommes[$code]['M'][$k] = $r; } else { @@ -420,7 +433,11 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = (float) dol_eval($result, 1, 1, '1'); - print ''.price($r).''; + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($r, 0, '', 1, 0, 0).''; + } else { + print ''.price($r).''; + } if (empty($sommes[$code]['M'][$k])) { $sommes[$code]['M'][$k] = $r; } else { @@ -581,18 +598,31 @@ if ($modecompta == 'CREANCES-DETTES') { print $labeltoshow; print ''; - print ''.price($totCat['NP']).''; - print ''.price($totCat['N']).''; + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($totCat['NP'], 0, '', 1, 0, 0).''; + print ''.price($totCat['N'], 0, '', 1, 0, 0).''; + } else { + print ''.price($totCat['NP']).''; + print ''.price($totCat['N']).''; + } // Each month foreach ($totCat['M'] as $k => $v) { if (($k + 1) >= $date_startmonth && $k < $date_endmonth) { - print ''.price($v).''; + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($v, 0, '', 1, 0, 0).''; + } else { + print ''.price($v).''; + } } } foreach ($totCat['M'] as $k => $v) { if (($k + 1) < $date_startmonth) { - print ''.price($v).''; + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($v, 0, '', 1, 0, 0).''; + } else { + print ''.price($v).''; + } } } @@ -622,8 +652,13 @@ if ($modecompta == 'CREANCES-DETTES') { print ''; print dol_escape_htmltag($labeldetail); print ''; - print ''.price($resultNP).''; - print ''.price($resultN).''; + if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { + print ''.price($resultNP, 0, '', 1, 0, 0).''; + print ''.price($resultN, 0, '', 1, 0, 0).''; + } else { + print ''.price($resultNP).''; + print ''.price($resultN).''; + } // Make one call for each month foreach ($months as $k => $v) {