diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 899aba82057..feb8646442a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -36,6 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; $langs->load("errors"); $langs->load("admin"); @@ -586,6 +588,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) // Clean some parameters if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0 if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0 + 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 // Si verif ok et action add, on ajoute la ligne if ($ok && GETPOST('actionadd')) @@ -1308,6 +1313,9 @@ if ($id) { $align="center"; } + else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') { + $valuetoshow = length_accountg($valuetoshow); + } // Show value for field if ($showfield) print '