From 5b771eb798ad246c37bbef82182d5375f59186ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Mar 2021 21:56:14 +0100 Subject: [PATCH] Fix merge of 2 record. --- htdocs/don/class/don.class.php | 17 +++++++++++++++++ htdocs/fourn/class/fournisseur.class.php | 17 +++++++++++++++++ htdocs/societe/card.php | 1 + 3 files changed, 35 insertions(+) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index be9426415fe..0717870ac42 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -1090,4 +1090,21 @@ class Don extends CommonObject return 0; } } + + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old third-party id + * @param int $dest_id New third-party id + * @return bool + */ + public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + { + $tables = array( + 'don' + ); + + return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + } } diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index 4ca073a38c7..877f24803a5 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -204,4 +204,21 @@ class Fournisseur extends Societe } return $arr; } + + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old third-party id + * @param int $dest_id New third-party id + * @return bool + */ + public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + { + $tables = array( + 'facture_fourn' + ); + + return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 4afb596fbda..43a976ba9b2 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -232,6 +232,7 @@ if (empty($reshook)) // TODO Mutualise the list into object societe.class.php $objects = array( 'Adherent' => '/adherents/class/adherent.class.php', + 'Don' => '/don/class/don.class.php', 'Societe' => '/societe/class/societe.class.php', //'Categorie' => '/categories/class/categorie.class.php', 'ActionComm' => '/comm/action/class/actioncomm.class.php',