Merge pull request #9423 from ptibogxiv/patch-55
Fix error when delete stripe customer
This commit is contained in:
commit
e2df3fd4ad
@ -550,13 +550,17 @@ if (empty($reshook))
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (empty($newcu)) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity;
|
||||
} else {
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."societe_account";
|
||||
$sql.= " SET key_account = '".$db->escape(GETPOST('key_account', 'alpha'))."'";
|
||||
$sql.= " WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
|
||||
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$num = $db->num_rows($resql);
|
||||
if (empty($num))
|
||||
if (empty($num) && !empty($newcu))
|
||||
{
|
||||
$societeaccount = new SocieteAccount($db);
|
||||
$societeaccount->fk_soc = $object->id;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user