Fix hooks from supplierorder to supplierinvoice
This commit is contained in:
parent
2f30e769f6
commit
3880013940
@ -255,16 +255,23 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$result=$this->update_price();
|
$result=$this->update_price();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
// Actions on extra fields (by external module or standard code)
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
// FIXME le hook fait double emploi avec le trigger !!
|
||||||
|
$hookmanager->initHooks(array('supplierinvoicedao'));
|
||||||
|
$parameters=array('socid'=>$this->id);
|
||||||
|
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
if ($result < 0)
|
|
||||||
{
|
{
|
||||||
$error++;
|
$result=$this->insertExtraFields();
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ($reshook < 0) $error++;
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
|
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
|
|||||||
@ -1083,7 +1083,7 @@ elseif ($action == 'update_extras')
|
|||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields (by external module or standard code)
|
||||||
// FIXME le hook fait double emploi avec le trigger !!
|
// FIXME le hook fait double emploi avec le trigger !!
|
||||||
$hookmanager->initHooks(array('supplierorderdao'));
|
$hookmanager->initHooks(array('supplierinvoicedao'));
|
||||||
$parameters=array('id'=>$object->id);
|
$parameters=array('id'=>$object->id);
|
||||||
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user