diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1f24b2e7662..61e7e0c0ce0 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -932,6 +932,10 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c9fe00b4594..1459dac849e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2538,7 +2538,8 @@ if ($action == 'create') } // Confirmation de la validation - if ($action == 'valid') { + if ($action == 'valid') + { // on verifie si l'objet est en numerotation provisoire $objectref = substr($object->ref, 1, 4); if ($objectref == 'PROV') { @@ -2569,7 +2570,8 @@ if ($action == 'create') $qualified_for_stock_change = $object->hasProductsOrServices(1); } - if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { + if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) + { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 842fe9fcf0b..5970843b74d 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -947,7 +947,7 @@ class FactureFournisseur extends CommonInvoice } // Triggers call - if (! $error && $notrigger) + if (! $error && empty($notrigger)) { // Call trigger $result=$this->call_trigger('BILL_SUPPLIER_VALIDATE',$user); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 96de2262d25..fe22a154251 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -534,8 +534,8 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && } } else - { - setEventMessage($object->error, 'errors'); + { + setEventMessages($object->error, $object->errors, 'errors'); } // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 7f75f34a149..325a9e5d591 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -157,8 +157,7 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $result = $object->validate($user,'',$idwarehouse); if ($result < 0) { - setEventMessage($object->error,'errors'); - setEventMessage($object->errors,'errors'); + setEventMessages($object->error,$object->errors,'errors'); } } }