mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 19:25:22 +01:00
Merge pull request #17493 from FHenry/13_fix_bank_url_merge_account
FIX: merge thirparty also work for bank URL entry
This commit is contained in:
@@ -1676,6 +1676,28 @@ class Account extends CommonObject
|
||||
$this->owner_address = 'Owner address';
|
||||
$this->country_id = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to replace a thirdparty id with another one.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old thirdparty id
|
||||
* @param int $dest_id New thirdparty id
|
||||
* @return bool
|
||||
*/
|
||||
public static function replaceThirdparty($db, $origin_id, $dest_id)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_url SET url_id = ".((int) $dest_id)." WHERE url_id = ".((int) $origin_id)." AND type='company'";
|
||||
|
||||
if (!$db->query($sql))
|
||||
{
|
||||
//if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B.
|
||||
//$this->errors = $db->lasterror();
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -254,7 +254,8 @@ if (empty($reshook))
|
||||
'Product' => '/product/class/product.class.php',
|
||||
'Project' => '/projet/class/project.class.php',
|
||||
'Ticket' => '/ticket/class/ticket.class.php',
|
||||
'User' => '/user/class/user.class.php'
|
||||
'User' => '/user/class/user.class.php',
|
||||
'Account' => '/compta/bank/class/account.class.php',
|
||||
);
|
||||
|
||||
//First, all core objects must update their tables
|
||||
|
||||
Reference in New Issue
Block a user