Merge pull request #23931 from atm-GregM/FIX_15.0_dolibarr_parse_error

FIX parse error and NAN
This commit is contained in:
Laurent Destailleur
2023-02-16 21:05:34 +01:00
committed by GitHub

View File

@@ -333,6 +333,9 @@ if ($modecompta == 'CREANCES-DETTES') {
// Previous Fiscal year (N-1)
foreach ($sommes as $code => $det) {
if (is_null($det['NP'])) {
$det['NP'] = 0;
}
$vars[$code] = $det['NP'];
}
@@ -340,8 +343,11 @@ if ($modecompta == 'CREANCES-DETTES') {
//var_dump($result);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, '1');
//var_dump($r);
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
@@ -360,6 +366,9 @@ if ($modecompta == 'CREANCES-DETTES') {
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, 1);
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
$sommes[$code]['N'] += $r;
@@ -374,6 +383,9 @@ if ($modecompta == 'CREANCES-DETTES') {
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, 1);
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
$sommes[$code]['M'][$k] += $r;
@@ -388,6 +400,9 @@ if ($modecompta == 'CREANCES-DETTES') {
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, 1);
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
$sommes[$code]['M'][$k] += $r;
@@ -416,8 +431,10 @@ if ($modecompta == 'CREANCES-DETTES') {
$arrayofaccountforfilter = array();
foreach ($cpts as $i => $cpt) { // Loop on each account.
$arrayofaccountforfilter[] = $cpt['account_number'];
foreach ($cpts as $i => $cpt) {// Loop on each account.
if (!empty($cpt['account_number'])) {
$arrayofaccountforfilter[] = $cpt['account_number'];
}
}
// N-1