Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-06-26 12:00:42 +02:00
commit df6d160374
2 changed files with 7 additions and 1 deletions

View File

@ -193,7 +193,7 @@ if (empty($reshook)) {
exit();
} else {
$langs->load("errors");
setEventMessages($object->error, $object->errors, 'errors');
setEventMessages($objectutil->error, $objectutil->errors, 'errors');
$action = '';
}
} elseif ($action == 'reopen' && $usercanreopen) {

View File

@ -1235,14 +1235,20 @@ class Facture extends CommonInvoice
$result = $object->create($user);
if ($result < 0) {
$error++;
$this->error = $object->error;
$this->errors = $object->errors;
} else {
// copy internal contacts
if ($object->copy_linked_contact($this, 'internal') < 0) {
$error++;
$this->error = $object->error;
$this->errors = $object->errors;
} elseif ($this->socid == $object->socid) {
// copy external contacts if same company
if ($object->copy_linked_contact($this, 'external') < 0) {
$error++;
$this->error = $object->error;
$this->errors = $object->errors;
}
}
}