diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 583b12368dc..e3de399538a 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -98,7 +98,6 @@ if (!empty($conf->loan->enabled)) { $list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE'; if (!empty($conf->societe->enabled)) { $list_account[] = '---Deposits---'; - $list_account[] = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; } /* @@ -106,7 +105,7 @@ if (!empty($conf->societe->enabled)) { */ if ($action == 'update') { $error = 0; - + // Process $list_account_main foreach ($list_account_main as $constname) { $constvalue = GETPOST($constname, 'alpha'); @@ -114,7 +113,7 @@ if ($action == 'update') { $error++; } } - + // Process $list_account foreach ($list_account as $constname) { $reg = array(); if (preg_match('/---(.*)---/', $constname, $reg)) { // This is a separator @@ -128,6 +127,13 @@ if ($action == 'update') { } } + $constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; + $constvalue = GETPOST($constname, 'int'); + if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -246,10 +252,24 @@ foreach ($list_account as $key) { } } + +// Customer deposit account +print '