Fix the trigger COMPANY_MODIFY provide information of thirdparty merged
This commit is contained in:
parent
9af3ff2926
commit
2693e5db6d
@ -146,7 +146,8 @@ if (empty($reshook))
|
|||||||
$object->client = $object->client | $soc_origin->client;
|
$object->client = $object->client | $soc_origin->client;
|
||||||
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
|
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
|
||||||
$listofproperties=array(
|
$listofproperties=array(
|
||||||
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'url', 'barcode', 'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
|
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'url', 'barcode',
|
||||||
|
'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
|
||||||
'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis',
|
'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis',
|
||||||
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
|
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
|
||||||
'code_client', 'code_fournisseur', 'code_compta', 'code_compta_fournisseur',
|
'code_client', 'code_fournisseur', 'code_compta', 'code_compta_fournisseur',
|
||||||
@ -183,7 +184,7 @@ if (empty($reshook))
|
|||||||
$object->setCategories($suppcats, 'supplier');
|
$object->setCategories($suppcats, 'supplier');
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
$object->update($object->id, $user);
|
$object->update($object->id, $user, 0);
|
||||||
|
|
||||||
// Move links
|
// Move links
|
||||||
$objects = array(
|
$objects = array(
|
||||||
@ -237,6 +238,17 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (! $error && $call_trigger)
|
||||||
|
{
|
||||||
|
$object->context=array('merge'=>1, 'mergefromid'=>$soc_origin->id);
|
||||||
|
|
||||||
|
// Call trigger
|
||||||
|
$result=$object->call_trigger('COMPANY_MODIFY',$user);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
if (!$errors)
|
if (!$errors)
|
||||||
{
|
{
|
||||||
//We finally remove the old thirdparty
|
//We finally remove the old thirdparty
|
||||||
|
|||||||
@ -727,7 +727,7 @@ class Societe extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param int $id Id of company (deprecated, use 0 here and call update on an object loaded by a fetch)
|
* @param int $id Id of company (deprecated, use 0 here and call update on an object loaded by a fetch)
|
||||||
* @param User $user Utilisateur qui demande la mise a jour
|
* @param User $user Utilisateur qui demande la mise a jour
|
||||||
* @param int $call_trigger 0=non, 1=oui
|
* @param int $call_trigger 0=no, 1=yes
|
||||||
* @param int $allowmodcodeclient Inclut modif code client et code compta
|
* @param int $allowmodcodeclient Inclut modif code client et code compta
|
||||||
* @param int $allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
|
* @param int $allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
|
||||||
* @param string $action 'add' or 'update'
|
* @param string $action 'add' or 'update'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user