From 8efaf03ec9526bf3eb84ab1dd6d742e7752fef12 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:49:03 +0200 Subject: [PATCH 1/4] FIX - php 8 totalarray --- htdocs/commande/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 455420ce90a..4114f5f4129 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,6 +1887,8 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; + $totalarray['val']['c.total_tva'] = 0; + $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); From 1d08d2c8ab3a32f557a40fd540d6e9762143d18e Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:50:06 +0200 Subject: [PATCH 2/4] erreur --- htdocs/commande/list.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4114f5f4129..455420ce90a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,8 +1887,6 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; - $totalarray['val']['c.total_tva'] = 0; - $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); From df2f3b046928de3db14eecbf5d4754146fe59a6e Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:50:23 +0200 Subject: [PATCH 3/4] FIX - php 8 totalarray --- htdocs/commande/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 455420ce90a..4114f5f4129 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,6 +1887,8 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; + $totalarray['val']['c.total_tva'] = 0; + $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); From 1c0dd84d6f11de6d9195f9d389e54244bfdda46f Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:57:58 +0200 Subject: [PATCH 4/4] OK --- htdocs/commande/list.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4114f5f4129..53e95ff649f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,8 +1887,6 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; - $totalarray['val']['c.total_tva'] = 0; - $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); @@ -2194,7 +2192,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'c.total_tva'; } - $totalarray['val']['c.total_tva'] += $obj->total_tva; + if (isset($totalarray['val']['c.total_tva'])) { + $totalarray['val']['c.total_tva'] += $obj->total_tva; + } else { + $totalarray['val']['c.total_tva'] = $obj->total_tva; + } } // Amount TTC / gross @@ -2206,7 +2208,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'c.total_ttc'; } - $totalarray['val']['c.total_ttc'] += $obj->total_ttc; + if (isset($totalarray['val']['c.total_ttc'])) { + $totalarray['val']['c.total_ttc'] += $obj->total_ttc; + } else { + $totalarray['val']['c.total_ttc'] = $obj->total_ttc; + } } // Currency