diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 6a3d7918ac3..d9d65048fa8 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1398,16 +1398,29 @@ class CommandeFournisseur extends CommonOrder * @param int $idligne Id of line to delete * @return 0 if Ok, <0 ik Ko */ - function deleteline($idligne) + function deleteline($idligne, $notrigger=0) { if ($this->statut == 0) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid = ".$idligne; $resql=$this->db->query($sql); - - dol_syslog(get_class($this)."::deleteline sql=".$sql); + + dol_syslog(get_class($this)."::deleteline sql=".$sql); + + if(!$notrigger && $resql){ + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $result = 0; + $interface=new Interfaces($this->db); + $result = $interface->run_triggers('LINEORDER_SUPPLIER_DELETE',$this,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + } + if ($resql) - { + { $result=$this->update_price(); return 0; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 060d2d51a83..74949814577 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1258,8 +1258,8 @@ class FactureFournisseur extends CommonInvoice $error=0; $this->db->begin(); - - if (! $error && ! $notrigger) + + if (! $error && ! $notrigger) { // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 214fc41770b..ffa72ecf9ac 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1583,7 +1583,7 @@ elseif (! empty($object->id)) // Edit line if ($action != 'edit_line' || $_GET['rowid'] != $line->id) { - print ''; + print ''; // Show product and description print ''; @@ -1634,6 +1634,13 @@ elseif (! empty($object->id)) } print ''.price($line->total_ht).''; + + if (is_object($hookmanager)) + { + $parameters=array('line'=>$line,'num'=>$num,'i'=>$i); + $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$object,$action); + } + if ($object->statut == 0 && $user->rights->fournisseur->commande->creer) { print 'id.'#'.$line->id.'">'; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 073ea94b40e..3722ceaac51 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1941,7 +1941,7 @@ else } else // Affichage simple de la ligne { - print ''; + print ''; // Show product and description print ''; @@ -1996,7 +1996,13 @@ else print ''.price($object->lines[$i]->total_ht).''; print ''.price($object->lines[$i]->total_ttc).''; - + + if (is_object($hookmanager)) + { + $parameters=array('line'=>$object->lines[$i],'num'=>$num,'i'=>$i); + $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$object,$action); + } + print ''; if ($object->statut == 0) print 'lines[$i]->rowid.'">'.img_edit().''; else print ' '; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b0ad7dd35c6..a4d7ad03c06 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -522,6 +522,12 @@ if ($id || $ref) print $productfourn->fourn_unitcharges?price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty?price($productfourn->fourn_charges/$productfourn->fourn_qty):" "); print ''; } + + if (is_object($hookmanager)) + { + $parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$product->id); + $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$object,$action); + } // Modify-Remove print '';