FIX : dupliacete customer or supplier code must be error dipslayed with new code proposed
This commit is contained in:
parent
7a93c11ae0
commit
b80bd8d1f8
@ -634,18 +634,22 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' || ($result==-3 && in_array('ErrorCustomerCodeAlreadyUsed', $object->errors))) // TODO Sometime errors on duplicate on profid and not on code, so we must manage this case
|
||||
if ($result==-3 && in_array('ErrorCustomerCodeAlreadyUsed', $object->errors))
|
||||
{
|
||||
$duplicate_code_error = true;
|
||||
$object->code_client = null;
|
||||
}
|
||||
|
||||
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' || ($result==-3 && in_array('ErrorSupplierCodeAlreadyUsed',$object->errors))) // TODO Sometime errors on duplicate on profid and not on code, so we must manage this case
|
||||
if ($result==-3 && in_array('ErrorSupplierCodeAlreadyUsed',$object->errors))
|
||||
{
|
||||
$duplicate_code_error = true;
|
||||
$object->code_fournisseur = null;
|
||||
}
|
||||
|
||||
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$duplicate_code_error = true;
|
||||
}
|
||||
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user