Init code_client and code_fournisseur to '', not null

This commit is contained in:
MDW 2024-03-13 21:55:43 +01:00
parent e36dccff59
commit 4e05ac84f1
No known key found for this signature in database

View File

@ -562,12 +562,12 @@ if (empty($reshook)) {
} else {
if ($result == -3 && in_array('ErrorCustomerCodeAlreadyUsed', $object->errors)) {
$duplicate_code_error = true;
$object->code_client = null;
$object->code_client = '';
}
if ($result == -3 && in_array('ErrorSupplierCodeAlreadyUsed', $object->errors)) {
$duplicate_code_error = true;
$object->code_fournisseur = null;
$object->code_fournisseur = '';
}
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { // TODO Sometime errors on duplicate on profid and not on code, so we must manage this case