NEW add triiger and event on totally received status

This commit is contained in:
lvessiller 2022-02-15 09:54:40 +01:00 committed by Laurent Destailleur
parent 690a91d546
commit 9b1d800311

View File

@ -640,9 +640,18 @@ class Reception extends CommonObject
if ($status < 0) {
$error++;
} else {
$ret = $this->setStatut($status, $this->origin_id, 'commande_fournisseur');
if (!$ret) {
$error++;
$trigger_key = '';
if ($status == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) {
$ret = $this->commandeFournisseur->Livraison($user, dol_now(), 'tot', '');
if ($ret < 0) {
$error++;
$this->errors = array_merge($this->errors, $this->commandeFournisseur->errors);
}
} else {
$ret = $this->setStatut($status, $this->origin_id, 'commande_fournisseur', $trigger_key);
if ($ret < 0) {
$error++;
}
}
}