From 113d4d1665dd76ab40d0aed3870af2c4d853eab8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Apr 2017 10:29:13 +0200 Subject: [PATCH] FIX spaces not allowed into vat code --- htdocs/admin/dict.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 046a1cb9b27..3427382ea9f 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -680,7 +680,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null - + if ($id == 10 && isset($_POST["code"])) // Spaces are not allowed into code + { + $_POST["code"]=preg_replace('/\s/','',$_POST["code"]); + } + // Si verif ok et action add, on ajoute la ligne if ($ok && GETPOST('actionadd')) {