mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX : dupliacete customer or supplier code must be error dipslayed with new code proposed
This commit is contained in:
parent
d1c66059cd
commit
7a93c11ae0
|
|
@ -634,11 +634,16 @@ if (empty($reshook))
|
|||
}
|
||||
else
|
||||
{
|
||||
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
|
||||
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
|
||||
{
|
||||
$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
|
||||
{
|
||||
$duplicate_code_error = true;
|
||||
$object->code_fournisseur = null;
|
||||
$object->code_client = null;
|
||||
}
|
||||
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user