FIX Disable customer type by default if type prospect/customer is disabled

This commit is contained in:
Alexandre SPANGARO 2022-02-13 13:42:40 +01:00
parent 8db6152a4d
commit a15353fa33

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -229,6 +230,8 @@ if ($action == "setaskforshippingmet") {
if ($action == "setdisableprospectcustomer") { if ($action == "setdisableprospectcustomer") {
$setdisableprospectcustomer = GETPOST('value', 'int'); $setdisableprospectcustomer = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity); $res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity);
// Remove customer type by default if type prospect/customer is disabled
$res = dolibarr_del_const($db, "THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT", $conf->entity);
if (!($res > 0)) { if (!($res > 0)) {
$error++; $error++;
} }