From a7b21db21049b56bcda7226a6be72d5c27efb13f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jul 2016 17:22:02 +0200 Subject: [PATCH] Fix code is not mandatory on vat table --- htdocs/admin/dict.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 353389c98a8..825a3aae22c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -596,7 +596,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'formula' && empty($_POST['formula'])) continue; if ((! isset($_POST[$value]) || $_POST[$value]=='') - && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory + && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory + && (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10 + ) ) { $ok=0;