From ff3707b6501f4325d4b27f885e6247d5bbd69fb0 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Mon, 8 Feb 2021 17:24:40 +0100 Subject: [PATCH 1/2] FIX: warning when adding a line if $remise_percent is an empty string --- htdocs/commande/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 36f9705aabc..773d5283ede 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -672,6 +672,7 @@ if (empty($reshook)) $qty = price2num(GETPOST('qty'.$predef, 'alpha')); $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0); + if ($remise_percent === '') $remise_percent = 0; // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); From 8b3c872f2a7461c0fec258802464520a074cdd6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 17:35:21 +0100 Subject: [PATCH 2/2] Fix warning --- htdocs/commande/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 773d5283ede..794b5779964 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -672,7 +672,9 @@ if (empty($reshook)) $qty = price2num(GETPOST('qty'.$predef, 'alpha')); $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0); - if ($remise_percent === '') $remise_percent = 0; + if (empty($remise_percent)) { + $remise_percent = 0; + } // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);